public void setDistributionManagement( DistributionManagement distributionManagement ) { getModel().setDistributionManagement( distributionManagement ); }
public void setDistributionManagement( DistributionManagement distributionManagement ) { getModel().setDistributionManagement( distributionManagement ); }
private Model createStubModel( Artifact projectArtifact ) { getLogger().debug( "Using defaults for missing POM " + projectArtifact ); Model model = new Model(); model.setModelVersion( "4.0.0" ); model.setArtifactId( projectArtifact.getArtifactId() ); model.setGroupId( projectArtifact.getGroupId() ); model.setVersion( projectArtifact.getVersion() ); // TODO: not correct in some instances model.setPackaging( projectArtifact.getType() ); model.setDistributionManagement( new DistributionManagement() ); model.getDistributionManagement().setStatus( ArtifactStatus.GENERATED.toString() ); return model; }
model.setDistributionManagement( pDistMgmt );
model.setDistributionManagement( parseDistributionManagement( parser, strict ) );
model.setDistributionManagement( parseDistributionManagement( parser, strict, source ) );
child.setDistributionManagement( childDistMgmt );
child.setDistributionManagement( childDistMgmt );
/** * Set distribution information for a project that enables * deployment of the site * and artifacts to remote web servers and * repositories respectively. * * @param distributionManagement */ public FluentModelBuilder withDistributionManagement(DistributionManagement distributionManagement) { model.setDistributionManagement(distributionManagement); return this; }
@Override public void set( Model model, DistributionManagement value ) { model.setDistributionManagement( value ); }; };
@Override public void setDistributionManagement(DistributionManagement distributionManagement) { delegate.setDistributionManagement(distributionManagement); }
model.setDistributionManagement( parseDistributionManagement( parser, strict ) );
private MavenProject getMavenModuleProject() throws MojoExecutionException{ if (mavenModuleProject==null) { try { if (!getModuleProject().exists()) { if (groupId==null){ groupId=project.getGroupId(); } mavenModuleProject = CAppMavenUtils.createMavenProject(groupId, getProject().getArtifactId() + "_module", getProject() .getVersion(), "pom"); mavenModuleProject.getModel().setDistributionManagement(project.getDistributionManagement()); CAppMavenUtils.saveMavenProject(mavenModuleProject, getModuleProject()); } mavenModuleProject=CAppMavenUtils.getMavenProject(getModuleProject()); } catch (Exception e) { throw new MojoExecutionException( "Error retrieving module parent project: " + getModuleProject().toString(), e); } } return mavenModuleProject; }
/** * Removes a lot of unnecessary information from the POM. * This includes the build section, reporting, repositories, etc. */ public void trimModel( Model model ) { model.setBuild( null ); model.setReporting( null ); model.setProperties( null ); model.setRepositories( null ); model.setPluginRepositories( null ); model.setProfiles( null ); model.setDistributionManagement( null ); model.setModules( null ); }
private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId, String newArtifactId, String newVersion, String message, ArtifactRepository repository, FileTransaction transaction ) throws IOException { Model pom = new Model(); pom.setGroupId( groupId ); pom.setArtifactId( artifactId ); pom.setVersion( version ); DistributionManagement dMngt = new DistributionManagement(); Relocation relocation = new Relocation(); relocation.setGroupId( newGroupId ); relocation.setArtifactId( newArtifactId ); relocation.setVersion( newVersion ); if ( message != null && message.length() > 0 ) { relocation.setMessage( message ); } dMngt.setRelocation( relocation ); pom.setDistributionManagement( dMngt ); Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$ File pomFile = new File( repository.getBasedir(), repository.pathOf( artifact ) ); StringWriter strWriter = new StringWriter(); MavenXpp3Writer pomWriter = new MavenXpp3Writer(); pomWriter.write( strWriter, pom ); transaction.createFile( strWriter.toString(), pomFile, digesters ); }
private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId, String newArtifactId, String newVersion, String message, ArtifactRepository repository, FileTransaction transaction ) throws IOException { Model pom = new Model(); pom.setGroupId( groupId ); pom.setArtifactId( artifactId ); pom.setVersion( version ); DistributionManagement dMngt = new DistributionManagement(); Relocation relocation = new Relocation(); relocation.setGroupId( newGroupId ); relocation.setArtifactId( newArtifactId ); relocation.setVersion( newVersion ); if ( message != null && message.length() > 0 ) { relocation.setMessage( message ); } dMngt.setRelocation( relocation ); pom.setDistributionManagement( dMngt ); Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$ File pomFile = new File( repository.getBasedir(), repository.pathOf( artifact ) ); StringWriter strWriter = new StringWriter(); MavenXpp3Writer pomWriter = new MavenXpp3Writer(); pomWriter.write( strWriter, pom ); transaction.createFile( strWriter.toString(), pomFile, digesters ); }
private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId, String newArtifactId, String newVersion, String message, ArtifactRepository repository, FileTransaction transaction ) throws IOException { Model pom = new Model(); pom.setGroupId( groupId ); pom.setArtifactId( artifactId ); pom.setVersion( version ); DistributionManagement dMngt = new DistributionManagement(); Relocation relocation = new Relocation(); relocation.setGroupId( newGroupId ); relocation.setArtifactId( newArtifactId ); relocation.setVersion( newVersion ); if ( message != null && message.length() > 0 ) { relocation.setMessage( message ); } dMngt.setRelocation( relocation ); pom.setDistributionManagement( dMngt ); Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$ Path pomFile = Paths.get( repository.getBasedir(), repository.pathOf( artifact ) ); StringWriter strWriter = new StringWriter(); MavenXpp3Writer pomWriter = new MavenXpp3Writer(); pomWriter.write( strWriter, pom ); transaction.createFile( strWriter.toString(), pomFile, digesters ); }
private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId, String newArtifactId, String newVersion, String message, ArtifactRepository repository, FileTransaction transaction ) throws IOException { Model pom = new Model(); pom.setGroupId( groupId ); pom.setArtifactId( artifactId ); pom.setVersion( version ); DistributionManagement dMngt = new DistributionManagement(); Relocation relocation = new Relocation(); relocation.setGroupId( newGroupId ); relocation.setArtifactId( newArtifactId ); relocation.setVersion( newVersion ); if ( message != null && message.length() > 0 ) { relocation.setMessage( message ); } dMngt.setRelocation( relocation ); pom.setDistributionManagement( dMngt ); Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$ File pomFile = new File( repository.getBasedir(), repository.pathOf( artifact ) ); StringWriter strWriter = new StringWriter(); MavenXpp3Writer pomWriter = new MavenXpp3Writer(); pomWriter.write( strWriter, pom ); transaction.createFile( strWriter.toString(), pomFile, digesters ); }
private static void setDistMgmntSiteUrl( Model model, String url ) { if ( model.getDistributionManagement() == null ) { model.setDistributionManagement( new DistributionManagement() ); } if ( model.getDistributionManagement().getSite() == null ) { model.getDistributionManagement().setSite( new Site() ); } model.getDistributionManagement().getSite().setUrl( url ); } }
model.setDevelopers( translateDevelopers( v3Model.getDevelopers() ) ); model.setDistributionManagement( translateDistributionManagement( pomKey, v3Model ) );