protected void mergeParent_RelativePath( Parent target, Parent source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getRelativePath(); if ( src != null ) { if ( sourceDominant || target.getRelativePath() == null ) { target.setRelativePath( src ); target.setLocation( "relativePath", source.getLocation( "relativePath" ) ); } } }
private ModelSource getParentPomFile( Model childModel, ModelSource source ) { if ( !( source instanceof ModelSource2 ) ) { return null; } String parentPath = childModel.getParent().getRelativePath(); if ( parentPath == null || parentPath.length() <= 0 ) { return null; } return ( (ModelSource2) source ).getRelatedSource( parentPath ); }
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; }
/** * 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 )
if ( childModel.getProjectDirectory() != null ) if ( parent.getRelativePath() == null || parent.getRelativePath().length() <= 0 )
String parentRelativePath = parentModel.getRelativePath(); parentModel.getRelativePath() + "\' for project: " + project.getId() ); parentModel.getRelativePath() + "' in parent specification in " + project.getId() + ":" + "\n Specified: " + parentModel.getId() + "\n Found: " + candidateParent.getId() );
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(); }
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(); } } }
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(); } }
/** * 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 )
private boolean belongsToMultiModuleProject(File pom) throws Exception { Model model = reader.read(new FileInputStream(pom)); Parent parent = model.getParent(); if (parent != null) { return new File(pom.getParentFile(), parent.getRelativePath()).exists(); } return false; } }
protected void mergeParent_RelativePath( Parent target, Parent source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getRelativePath(); if ( src != null ) { if ( sourceDominant || target.getRelativePath() == null ) { target.setRelativePath( src ); target.setLocation( "relativePath", source.getLocation( "relativePath" ) ); } } }
private ModelSource getParentPomFile( Model childModel, ModelSource source ) { if ( !( source instanceof ModelSource2 ) ) { return null; } String parentPath = childModel.getParent().getRelativePath(); if ( parentPath == null || parentPath.length() <= 0 ) { return null; } return ( (ModelSource2) source ).getRelatedSource( parentPath ); }
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(); } } }
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(); } } }
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(); } }
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(); } }
/** * Method updateParent. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateParent(Parent value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "artifactId", value.getArtifactId(), null); findAndReplaceSimpleElement(innerCount, root, "groupId", value.getGroupId(), null); findAndReplaceSimpleElement(innerCount, root, "version", value.getVersion(), null); findAndReplaceSimpleElement(innerCount, root, "relativePath", value.getRelativePath(), "../pom.xml"); } } //-- void updateParent(Parent, String, Counter, Element)
/** * Method updateParent * * @param value * @param element * @param counter * @param xmlTag */ protected void updateParent(Parent value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "artifactId", value.getArtifactId(), null); findAndReplaceSimpleElement(innerCount, root, "groupId", value.getGroupId(), null); findAndReplaceSimpleElement(innerCount, root, "version", value.getVersion(), null); findAndReplaceSimpleElement(innerCount, root, "relativePath", value.getRelativePath(), "../pom.xml"); } } //-- void updateParent(Parent, String, Counter, Element)
/** * Method updateParent. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateParent(Parent value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "artifactId", value.getArtifactId(), null); findAndReplaceSimpleElement(innerCount, root, "groupId", value.getGroupId(), null); findAndReplaceSimpleElement(innerCount, root, "version", value.getVersion(), null); findAndReplaceSimpleElement(innerCount, root, "relativePath", value.getRelativePath(), "../pom.xml"); } } // -- void updateParent(Parent, String, Counter, Element)