project.setArtifactId( relocation.getArtifactId() );
project.setArtifactId( relocation.getArtifactId() );
public void setArtifactId(String artifactId) { wrapped.setArtifactId(artifactId); }
public void setArtifactId( String artifactId ) { getMavenProject().setArtifactId( artifactId ); }
public void setArtifactId(final String id) { getDelegate().setArtifactId(id); }
/** * Given a GAV in the form [groupId]:[artifactId]:[version] return a MavenProject object that has groupId, artifactId, and version set */ public MavenProject getMavenProject(String gav) { // Split the string into tokens String[] tokens = StringUtils.splitByWholeSeparator(gav.trim(), ":"); // Setup some local storage String groupId = null; String artifactId = null; String version = null; // Extract information from the tokens if (tokens.length > 0) { groupId = tokens[0].trim(); } if (tokens.length > 1) { artifactId = tokens[1].trim(); } if (tokens.length > 2) { version = tokens[2].trim(); } // Store info into a MavenProject MavenProject project = new MavenProject(); project.setGroupId(groupId); project.setArtifactId(artifactId); project.setVersion(version); return project; }
private MavenProject convert(MavenProjectInfo prjInfo) { MavenProject prj = new MavenProject(); prj.setArtifactId(prjInfo.getArtifactId()); prj.setGroupId(prjInfo.getGroupId()); prj.setVersion(prjInfo.getVersion()); return prj; }
protected Pom createDummyPom( ArtifactRepository localRepository ) { Pom pom = new Pom(); MavenProject minimalProject = createMinimalProject( localRepository ); // we nulled out these fields to allow inheritance when creating poms, but the dummy // needs to be a valid pom, so set them back to something that's OK to resolve minimalProject.setGroupId( "org.apache.maven" ); minimalProject.setArtifactId( "super-pom" ); minimalProject.setVersion( "2.0" ); minimalProject.setPackaging( "pom" ); pom.setMavenProject( minimalProject ); return pom; }
depMavenProject.setArtifactId( artifact.getArtifactId() ); depMavenProject.getArtifact().setArtifactId( artifact.getArtifactId() );
/** * Create a minimal project when no POM is available. * * @param localRepository * @return */ protected MavenProject createMinimalProject( ArtifactRepository localRepository ) { MavenProjectBuilder projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE ); DefaultProjectBuilderConfiguration builderConfig = new DefaultProjectBuilderConfiguration( ); builderConfig.setLocalRepository( localRepository ); builderConfig.setGlobalProfileManager( getProfileManager() ); try { MavenProject mavenProject = projectBuilder.buildStandaloneSuperProject(builderConfig); // if we don't null out these fields then the pom that will be created is at the super-pom's // GAV coordinates and we will not be able to inherit partial GAV coordinates from a parent GAV. mavenProject.setGroupId(null); mavenProject.setArtifactId(null); mavenProject.setVersion(null); return mavenProject; } catch ( ProjectBuildingException e ) { throw new BuildException( "Unable to create dummy Pom", e ); } }
toBuild.setArtifactId(config.getArtifactId()); toBuild.setVersion(project.getVersion()); toBuild.setPackaging("pom");
MavenProject toGenerate = project.clone(); toGenerate.setGroupId(project.getGroupId()); toGenerate.setArtifactId(config.getArtifactId()); toGenerate.setVersion(project.getVersion()); toGenerate.setPackaging("pom");