Skip to content

Commit 57bb839

Browse files
committed
Adding more details on the project
Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
1 parent ebdc7f9 commit 57bb839

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

maven-plugin/src/main/java/org/wildfly/galleon/maven/AbstractFeaturePackBuildMojo.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import org.apache.maven.artifact.DefaultArtifact;
6464
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
6565
import org.apache.maven.execution.MavenSession;
66+
import org.apache.maven.model.License;
6667
import org.apache.maven.plugin.AbstractMojo;
6768
import org.apache.maven.plugin.MojoExecutionException;
6869
import org.apache.maven.plugin.MojoFailureException;
@@ -915,6 +916,25 @@ private void generateMetadata(FeaturePackDescription desc, ProvisioningLayout<Fe
915916
fpMetadata.put("version", project.getVersion());
916917
fpMetadata.put("feature-pack-location", project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion());
917918
fpMetadata.put("description", project.getDescription());
919+
if(project.getLicenses() != null && !project.getLicenses().isEmpty()) {
920+
ArrayNode licences = mapper.createArrayNode();
921+
for(License licence : project.getLicenses()) {
922+
licences.add(licence.getName());
923+
}
924+
fpMetadata.set("licence", licences);
925+
} else {
926+
fpMetadata.set("licence", mapper.createArrayNode());
927+
}
928+
if (project.getUrl() != null) {
929+
fpMetadata.put("url", project.getUrl());
930+
} else {
931+
fpMetadata.put("url", "");
932+
}
933+
if(project.getScm()!= null && project.getScm().getUrl() != null) {
934+
fpMetadata.put("scm", project.getScm().getUrl());
935+
} else {
936+
fpMetadata.put("scm", "");
937+
}
918938
fpMetadata.put("name", project.getName());
919939
Map<String, List<ConfigLayerSpec>> layerSpecs = new HashMap<>();
920940
if(addFeaturePacksDependenciesInMetadata) {

0 commit comments

Comments
 (0)