/** * @return the id as <code>groupId:artifactId:version</code> */ public String getId() { StringBuilder id = new StringBuilder( 64 ); id.append( getGroupId() ); id.append( ":" ); id.append( getArtifactId() ); id.append( ":" ); id.append( "pom" ); id.append( ":" ); id.append( getVersion() ); return id.toString(); }
protected void mergeParent_ArtifactId( Parent target, Parent source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getArtifactId(); if ( src != null ) { if ( sourceDominant || target.getArtifactId() == null ) { target.setArtifactId( src ); target.setLocation( "artifactId", source.getLocation( "artifactId" ) ); } } }
addEdge( projectMap, vertexMap, null, projectVertex, parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), true, false );
public static Parent cloneParent( Parent src ) { if ( src == null ) { return null; } Parent result = new Parent(); result.setArtifactId( src.getArtifactId() ); result.setGroupId( src.getGroupId() ); result.setRelativePath( src.getRelativePath() ); result.setVersion( src.getVersion() ); return result; }
final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", parent.getVersion() ); String.format( "No versions matched the requested parent version range '%s'", parent.getVersion() ), parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); String.format( "The requested parent version range '%s' does not specify an upper bound", parent.getVersion() ), parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); return resolveModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); throw new UnresolvableModelException( e.getMessage(), parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), e );
final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", parent.getVersion() ); String.format( "No versions matched the requested parent version range '%s'", parent.getVersion() ), parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); String.format( "The requested parent version range '%s' does not specify an upper bound", parent.getVersion() ), parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); return resolveModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); throw new UnresolvableModelException( e.getMessage(), parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), e );
parent.getArtifactId().equals( model.getArtifactId() ) )
String artifactId = parent.getArtifactId(); String version = parent.getVersion(); ModelData parentData = new ModelData( modelSource, parentModel, parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
resolver.resolveRawModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); || !artifactId.equals( parent.getArtifactId() ) ) buffer.append( parent.getArtifactId() ).append( ", please verify your project structure" );
/** * Method writeParent. * * @param parent * @param serializer * @param tagName * @throws java.io.IOException */ private void writeParent( Parent parent, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( parent.getGroupId() != null ) { serializer.startTag( NAMESPACE, "groupId" ).text( parent.getGroupId() ).endTag( NAMESPACE, "groupId" ); } if ( parent.getArtifactId() != null ) { serializer.startTag( NAMESPACE, "artifactId" ).text( parent.getArtifactId() ).endTag( NAMESPACE, "artifactId" ); } if ( parent.getVersion() != null ) { serializer.startTag( NAMESPACE, "version" ).text( parent.getVersion() ).endTag( NAMESPACE, "version" ); } if ( ( parent.getRelativePath() != null ) && !parent.getRelativePath().equals( "../pom.xml" ) ) { serializer.startTag( NAMESPACE, "relativePath" ).text( parent.getRelativePath() ).endTag( NAMESPACE, "relativePath" ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeParent( Parent, String, XmlSerializer )
else if ( StringUtils.isEmpty( parentModel.getArtifactId() ) ) parentModel.getArtifactId().equals( model.getArtifactId() ) ) createCacheKey( parentModel.getGroupId(), parentModel.getArtifactId(), parentModel.getVersion() ); MavenProject parentProject = (MavenProject) rawProjectCache.get( parentKey ); parentModel.getArtifactId().equals( candidateParent.getArtifactId() ) && parentModel.getVersion().equals( candidateParentVersion ) ) parentModel.getArtifactId(), parentModel.getVersion() );
String artifactId = parent.getArtifactId(); String version = parent.getVersion();
private void writeParent() throws IOException { Parent parent = model.getParent(); if (parent != null) { out.write(" parent(" + br); out.write(" groupId -> \"" + parent.getGroupId() + "\"," + br); out.write(" artifactId -> \"" + parent.getArtifactId() + "\""); if (parent.getVersion() != null) { out.write("," + br); out.write(" version -> \"" + parent.getVersion()+ "\""); } if (parent.getRelativePath() != null) { out.write("," + br); out.write(" relativePath -> \"" + parent.getRelativePath()+ "\"" + br); } out.write(" );" + br); } writeProperties(); }
parent ); validateStringNotEmpty( "parent.artifactId", problems, Severity.FATAL, Version.BASE, parent.getArtifactId(), parent ); parent ); if ( equals( parent.getGroupId(), m.getGroupId() ) && equals( parent.getArtifactId(), m.getArtifactId() ) )
private void parent(PrintWriter pw, Model model) { if (model.getParent() != null) { pw.print(indent + "inherits: " + model.getParent().getGroupId() + ":" + model.getParent().getArtifactId() + ":" + model.getParent().getVersion()); if (model.getParent().getRelativePath() != null) { //pw.println(":" + model.getParent().getRelativePath()); // pw.println(":" + "../pom.atom"); } pw.println(); } }
void parent(Parent parent) { if (parent != null) { p.print("inherit", parent.getGroupId() + ":" + parent.getArtifactId() + ":" + parent.getVersion()); if (parent.getRelativePath() != null ) { if ( parent.getRelativePath().equals( "../pom.xml" ) ) { //p.append( ", '" ).append( "../pom.rb" ).append( "'" ); p.println(); } else { p.append(", '" + parent.getRelativePath() + "'").println(); } } else { p.println(); } } }
return model.getArtifactId(); } else if (model.getParent() != null) { return model.getParent().getArtifactId();
/** * Method writeParent. * * @param parent * @param serializer * @param tagName * @throws java.io.IOException */ private void writeParent( Parent parent, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( parent.getGroupId() != null ) { serializer.attribute( NAMESPACE, "groupId", parent.getGroupId() ); } if ( parent.getArtifactId() != null ) { serializer.attribute( NAMESPACE, "artifactId", parent.getArtifactId() ); } if ( parent.getVersion() != null ) { serializer.attribute( NAMESPACE, "version", parent.getVersion() ); } if ( ( parent.getRelativePath() != null ) && !parent.getRelativePath().equals( "../pom.xml" ) ) { serializer.attribute( NAMESPACE, "relativePath", parent.getRelativePath() ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeParent( Parent, String, XmlSerializer )
public static boolean isEnterpriseProject() { final Model pomModel = ProjectUtils.getPomModel(TargetPom.PROJECT); final Parent parent = pomModel.getParent(); if (parent == null) { return false; } final String groupId = parent.getGroupId(); final String artifactId = parent.getArtifactId(); return groupId.equals(ProjectUtils.ENT_GROUP_ID) && artifactId.equals(ProjectUtils.ENT_ARTIFACT_ID); }
protected Artifact toArtifact( Parent model ) throws MojoExecutionException { Dependency d = new Dependency(); d.setArtifactId( model.getArtifactId() ); d.setGroupId( model.getGroupId() ); d.setVersion( model.getVersion() ); d.setType( "pom" ); d.setScope( Artifact.SCOPE_COMPILE ); return this.toArtifact( d ); }