private static String getPomText ( ReleaseId releaseId , ReleaseId ... dependencies ) { String pom = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <groupId>" + releaseId . getGroupId ( ) + "</groupId>\n" + " <artifactId>" + releaseId . getArtifactId ( ) + "</artifactId>\n" + " <version>" + releaseId . getVersion ( ) + "</version>\n" + "\n" ; if ( dependencies != null && dependencies . length > 0 ) { pom += "<dependencies>\n" ; for ( ReleaseId dep : dependencies ) { pom += "<dependency>\n" ; pom += " <groupId>" + dep . getGroupId ( ) + "</groupId>\n" ; pom += " <artifactId>" + dep . getArtifactId ( ) + "</artifactId>\n" ; pom += " <version>" + dep . getVersion ( ) + "</version>\n" ; pom += "</dependency>\n" ; } pom += "</dependencies>\n" ; } pom += "</project>" ; return pom ; }
Create the pom that will be placed in the KJar .