List of usage examples for org.apache.maven.artifact Artifact setGroupId
void setGroupId(String groupId);
From source file:com.linkedin.oneclick.hadoop.LauncherPlugin.java
License:Apache License
static void convert(LauncherConfig.Artifact src, Artifact dest) { dest.setGroupId(src.getGroupId()); dest.setArtifactId(src.getArtifactId()); dest.setVersion(src.getVersion());//from ww w . j a va 2s . co m dest.setFile(src.getFile()); dest.setScope(src.getScope()); }
From source file:org.apache.archiva.converter.artifact.LegacyToDefaultConverter.java
License:Apache License
private boolean doRelocation(Artifact artifact, org.apache.maven.model.v3_0_0.Model v3Model, ArtifactRepository repository, FileTransaction transaction) throws IOException { Properties properties = v3Model.getProperties(); if (properties.containsKey("relocated.groupId") || properties.containsKey("relocated.artifactId") //$NON-NLS-1$ //$NON-NLS-2$ || properties.containsKey("relocated.version")) //$NON-NLS-1$ {//from w w w . java 2 s.c om String newGroupId = properties.getProperty("relocated.groupId", v3Model.getGroupId()); //$NON-NLS-1$ properties.remove("relocated.groupId"); //$NON-NLS-1$ String newArtifactId = properties.getProperty("relocated.artifactId", v3Model.getArtifactId()); //$NON-NLS-1$ properties.remove("relocated.artifactId"); //$NON-NLS-1$ String newVersion = properties.getProperty("relocated.version", v3Model.getVersion()); //$NON-NLS-1$ properties.remove("relocated.version"); //$NON-NLS-1$ String message = properties.getProperty("relocated.message", ""); //$NON-NLS-1$ //$NON-NLS-2$ properties.remove("relocated.message"); //$NON-NLS-1$ if (properties.isEmpty()) { v3Model.setProperties(null); } writeRelocationPom(v3Model.getGroupId(), v3Model.getArtifactId(), v3Model.getVersion(), newGroupId, newArtifactId, newVersion, message, repository, transaction); v3Model.setGroupId(newGroupId); v3Model.setArtifactId(newArtifactId); v3Model.setVersion(newVersion); artifact.setGroupId(newGroupId); artifact.setArtifactId(newArtifactId); artifact.setVersion(newVersion); return true; } else { return false; } }
From source file:org.apache.aries.plugin.eba.stubs.EbaMavenProjectStub.java
License:Apache License
public Artifact getArtifact() { Artifact artifact = new EbaArtifactStub(); artifact.setGroupId(getGroupId()); artifact.setArtifactId(getArtifactId()); artifact.setVersion(getVersion());// w ww .j a va2s. c o m return artifact; }
From source file:org.apache.aries.plugin.eba.stubs.EbaMavenProjectStub.java
License:Apache License
protected Artifact createArtifact(String groupId, String artifactId, String version, boolean optional) { Artifact artifact = new EbaArtifactStub(); artifact.setGroupId(groupId); artifact.setArtifactId(artifactId);//from ww w .j a va 2s.co m artifact.setVersion(version); artifact.setOptional(optional); artifact.setFile(new File(getBasedir() + "/src/test/remote-repo/" + artifact.getGroupId().replace('.', '/') + "/" + artifact.getArtifactId() + "/" + artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + ".jar")); return artifact; }
From source file:org.apache.aries.plugin.esa.stubs.EsaMavenProjectStub.java
License:Apache License
public Artifact getArtifact() { Artifact artifact = new EsaArtifactStub(); artifact.setGroupId(getGroupId()); artifact.setArtifactId(getArtifactId()); artifact.setVersion(getVersion());/*from w ww.j a va2s . c o m*/ return artifact; }
From source file:org.apache.aries.plugin.esa.stubs.EsaMavenProjectStub.java
License:Apache License
protected Artifact createArtifact(String groupId, String artifactId, String version, String type, boolean optional) { Artifact artifact = new EsaArtifactStub(); artifact.setGroupId(groupId); artifact.setArtifactId(artifactId);//from ww w.j a va2 s . co m artifact.setVersion(version); artifact.setOptional(optional); artifact.setFile(new File(getBasedir() + "/src/test/remote-repo/" + artifact.getGroupId().replace('.', '/') + "/" + artifact.getArtifactId() + "/" + artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + "." + type)); return artifact; }
From source file:org.codehaus.mojo.cobertura.AbstractCoberturaTestCase.java
License:Apache License
private Artifact createArtifact(String groupId, String artifactId, String version, String type, String localRepository) { Artifact artifact; artifact = new ArtifactStub(); artifact.setGroupId(groupId); artifact.setArtifactId(artifactId);/*from w ww . j a v a 2 s. co m*/ artifact.setVersion(version); artifact.setFile(new File(localRepository + "/" + groupId.replace(".", "/") + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + type)); assertArtifactExists(artifact); return artifact; }
From source file:org.jfrog.jade.plugins.idea.stubs.SimpleMavenProjectStub.java
License:Apache License
public Artifact getArtifact() { Artifact artifact = new IdeaArtifactStub(); artifact.setGroupId(getGroupId()); artifact.setArtifactId(getArtifactId()); artifact.setVersion(getVersion());//from w w w .j a v a2 s . c o m return artifact; }
From source file:org.jfrog.jade.plugins.idea.stubs.SimpleMavenProjectStub.java
License:Apache License
protected Artifact createArtifact(String groupId, String artifactId, String version) { Artifact artifact = new IdeaArtifactStub(); artifact.setGroupId(groupId); artifact.setArtifactId(artifactId);/* w ww. ja va 2 s . com*/ artifact.setVersion(version); artifact.setFile(new File(PlexusTestCase.getBasedir(), "target/local-repo/" + artifact.getGroupId().replace('.', '/') + "/" + artifact.getArtifactId() + "/" + artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + ".jar")); return artifact; }
From source file:uk.co.trenddevs.plugin.cba.stubs.CbaMavenProjectStub.java
License:Apache License
protected Artifact createArtifact(String groupId, String artifactId, String version, boolean optional) { Artifact artifact = new CbaArtifactStub(); artifact.setGroupId(groupId); artifact.setArtifactId(artifactId);/*from www . j av a 2 s . c o m*/ artifact.setVersion(version); artifact.setOptional(optional); artifact.setFile(new File(getBasedir() + "/src/test/remote-repo/" + artifact.getGroupId().replace('.', '/') + "/" + artifact.getArtifactId() + "/" + artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + ".jar")); return artifact; }