maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nap4110 <neil.pan...@gs.com>
Subject Using ArtifactResolver
Date Thu, 04 Oct 2007 01:08:21 GMT

Hi, I am doing something that I think is very simple, but cannot get anymore
info from the stack trace.  essentially I want to grab a jar from my
repository.  Here's the code:


ArtifactFactory artifactFactory = new DefaultArtifactFactory();
	 String type = "compile";
     Artifact artifact =  new DefaultArtifact(".hiki", "core",
VersionRange.createFromVersion( "3.0" ), type ,"jar", null, new
DefaultArtifactHandler());
     
     DefaultArtifactResolver artifactResolver = new
DefaultArtifactResolver();
     List remoteRepositories = new ArrayList (1 );
     DefaultArtifactRepository  rep1 = new DefaultArtifactRepository("rep1"
, "http://nhiidla01.ny.fw.com:8081/artifactory/repo" , new
DefaultRepositoryLayout ());
    
     remoteRepositories.add( rep1);
     try
     {
    	 artifactResolver.resolve(artifact, remoteRepositories, rep1);
     }
     catch (Exception e )
     {
    	 e.printStackTrace();
     }
     artifact.getFile();




I am getting an exception.  I do not know how to get to the source code for
this particular class on top of the exception to see what is going on.



java.lang.NullPointerException
	at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:104)
	at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:63)

java.lang.NullPointerException
	at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:104)
	at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:63)
	at com.hik.plugin.packager.DatabasePackager.main(DatabasePackager.java:345)



Any help or guidance will be appreciated.
-- 
View this message in context: http://www.nabble.com/Using-ArtifactResolver-tf4565253s177.html#a13030899
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message