private String getRelativePomPath ( MavenModule mavenModule , MavenModuleSetBuild mavenBuild ) { String relativePath = mavenModule . getRelativePath ( ) ; if ( StringUtils . isBlank ( relativePath ) ) { return POM_NAME ; } // If this is the root module, return the root pom path. if ( mavenModule . getModuleName ( ) . toString ( ) . equals ( mavenBuild . getProject ( ) . getRootModule ( ) . getModuleName ( ) . toString ( ) ) ) { return mavenBuild . getProject ( ) . getRootPOM ( null ) ; } // to remove the project folder name if exists // keeps only the name of the module String modulePath = relativePath . substring ( relativePath . indexOf ( "/" ) + 1 ) ; for ( String moduleName : mavenModules ) { if ( moduleName . contains ( modulePath ) ) { return createPomPath ( relativePath , moduleName ) ; } } // In case this module is not in the parent pom return relativePath + "/" + POM_NAME ; }
Retrieve the relative path to the pom of the module