public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ) { return artifactFactory.createArtifact( groupId, artifactId, version, scope, type ); }
result = artifactFactory.createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getScope(), artifact.getType() );
if (includeGML) { artifacts.add( artifactFactory.createArtifact( "org.geotools", "gt2-xml-gml2", "2.7-SNAPSHOT", "compile", "jar" artifactFactory.createArtifact( "org.geotools", "gt2-xml-gml3", "2.7-SNAPSHOT", "compile", "jar" artifactFactory.createArtifact( "org.geotools", "gt2-xml-filter", "2.7-SNAPSHOT", "compile", "jar" artifactFactory.createArtifact( "org.geotools", "gt2-xml-sld","2.7-SNAPSHOT", "compile", "jar"
Dependency dep = (Dependency) d.next(); Artifact artifact = artifactFactory.createArtifact( dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), null, dep.getType() );
Dependency dep = (Dependency) i.next(); if ( "jar".equals( dep.getType() ) ) { Artifact artifact = artifactFactory.createArtifact( dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getScope(), dep.getType()
public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ) { return artifactFactory.createArtifact( groupId, artifactId, version, scope, type ); }
/** * Use provided instead of just test, so it's available on both compile and test classpath (MCOBERTURA-26) * * @param artifact * @return re-scoped artifact */ private Artifact artifactScopeToProvided( Artifact artifact ) { return factory.createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), Artifact.SCOPE_PROVIDED, artifact.getType() ); } }
/** * Convert an artifact to a test artifact. * * @param artifact to convert * @return an artifact with a test scope */ private Artifact artifactScopeToTest( Artifact artifact ) { return factory.createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), Artifact.SCOPE_TEST, artifact.getType() ); } }
private Artifact resolveArtifact(String groupId, String artifactId, String version, String type) throws Exception { Artifact art = artifactFactory.createArtifact(groupId, artifactId, version, "runtime", type); artifactResolver.resolve(art, remoteRepositories, localRepository); return art; }
public Artifact createQuery(final String key) { assert key != null; return artifactFactory.createArtifact( template.getGroupId(), template.getArtifactId() + key, template.getVersion(), template.getScope(), template.getType()); }
public static Artifact getResolvedArtifact(String groupId, String artifactId, String version, String type, String scope) throws MojoExecutionException { Artifact artifact = MavenUtils.artifactFactory.createArtifact(groupId,artifactId,version,scope,type); try { MavenUtils.resolver.resolve(artifact,MavenUtils.remoteRepositories,MavenUtils.localRepository); } catch (ArtifactResolutionException e) { throw new MojoExecutionException("ERROR",e); } catch (ArtifactNotFoundException e) { throw new MojoExecutionException("ERROR",e); } return artifact; }
public Artifact createQuery(final String key) { assert key != null; return artifactFactory.createArtifact( template.getGroupId(), template.getArtifactId() + key, template.getVersion(), template.getScope(), template.getType()); }
private String classpath(List<URL> dependencies) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < dependencies.size(); i++) { URL s = dependencies.get(i); sb.append(s.getPath()).append(File.pathSeparatorChar); } final Artifact artifact =artifactFactory.createArtifact("fr.inria.spirals","npefix", HARDCODED_NPEFIX_VERSION, null, "jar"); File file = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifact)); sb.append(file.getAbsoluteFile()); System.out.println(sb); return sb.toString(); }
/** * Returns {@link MavenArtifact} for the hpi variant of this artifact. */ public MavenArtifact getHpi() throws IOException { Artifact a = artifactFactory .createArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), SCOPE_COMPILE, getResolvedType()); return new MavenArtifact(a,resolver,artifactFactory,builder,remoteRepositories,localRepository); }
private List<URL> getAstorClasspath() { List<URL> classpath = new ArrayList<>(); Artifact artifactPom = artifactFactory.createArtifact("org.inria.sacha.automaticRepair","astor", HARDCODED_ASTOR_VERSION, null, "pom"); Artifact artifactJar = artifactFactory.createArtifact("org.inria.sacha.automaticRepair","astor", HARDCODED_ASTOR_VERSION, null, "jar"); File filePom = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifactPom)); File fileJar = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifactJar)); classpath.addAll(getClassPathFromPom(filePom, fileJar)); return classpath; }
private List<URL> getNopolClasspath() { List<URL> classpath = new ArrayList<>(); Artifact artifactPom = artifactFactory.createArtifact("fr.inria.gforge.spirals","nopol", HARDCODED_NOPOL_VERSION, null, "pom"); Artifact artifactJar = artifactFactory.createArtifact("fr.inria.gforge.spirals","nopol", HARDCODED_NOPOL_VERSION, null, "jar"); File filePom = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifactPom)); File fileJar = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifactJar)); classpath.addAll(getClassPathFromPom(filePom, fileJar)); return classpath; }
public ArtifactHandlerImpl() throws Exception { String id = "org.codehaus.mojo.groovy.runtime:groovy-runtime-loader"; this.base = (Artifact) pluginArtifactMap.get(id); if (base == null) { throw new ProviderException("Missing dependency in the list of plugin artifacts: " + id); } this.template = artifactFactory.createArtifact("org.codehaus.mojo.groovy.runtime", "groovy-runtime-", base.getBaseVersion(), base.getScope(), base.getType()); this.originating = artifactFactory.createBuildArtifact("dummy", "dummy", "1.0", "jar"); }
private MavenProject getMavenProject(ArtifactRevisionIdentifier artifactIdentifier) throws ProjectBuildingException { logger.debug("Fetching artifact " + artifactIdentifier); org.apache.maven.artifact.Artifact artifact = artifactFactory.createArtifact(artifactIdentifier.getGroupId(), artifactIdentifier.getArtifactId(), artifactIdentifier.getVersion(), org.apache.maven.artifact.Artifact.SCOPE_COMPILE, POM_TYPE); return mavenProjectBuilder.buildFromRepository( artifact, Collections.<ArtifactRepository>emptyList(), localRepository, false); }
public ArtifactHandlerImpl() throws Exception { String id = "org.codehaus.gmaven.runtime:gmaven-runtime-loader"; Artifact base = (Artifact) pluginArtifactMap.get(id); if (base == null) { throw new ProviderException("Missing dependency in the list of plugin artifacts: " + id); } this.template = artifactFactory.createArtifact("org.codehaus.gmaven.runtime", "gmaven-runtime-", base.getBaseVersion(), base.getScope(), base.getType()); // This is a synthetic artifact, using a reasonable sounding name to avoid confusing users about the dummy artifact this.originating = artifactFactory.createBuildArtifact("org.codehaus.gmaven.runtime", "gmaven-runtime-loader-stub", base.getBaseVersion(), "jar"); }
/** * Creates a Maven Artifact from a GShell Artifact. */ private org.apache.maven.artifact.Artifact createArtifact(final Artifact source) { assert source != null; ArtifactFactory factory = artifactManager.getArtifactFactory(); org.apache.maven.artifact.Artifact artifact = factory.createArtifact(source.getGroup(), source.getName(), source.getVersion(), null, source.getType()); artifact.setFile(source.getFile()); return artifact; } }