Skip to content

Commit

Permalink
use project.url for component website instead of organisation url
Browse files Browse the repository at this point in the history
Signed-off-by: Hervé Boutemy <[email protected]>
  • Loading branch information
hboutemy committed Dec 23, 2022
1 parent 1502876 commit 164cd1a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
25 changes: 25 additions & 0 deletions src/it/makeAggregateBom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
<packaging>pom</packaging>

<name>cyclonedx:makeAggregateBom smoke test with default configuration</name>
<description>This is a smoke test to show how the plugin should be used in the simplest ways and see the results.</description>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin</url>

<inceptionYear>2017</inceptionYear>
<organization>
<name>OWASP Foundation</name>
<url>https://owasp.org/</url>
</organization>

<licenses>
<license>
Expand All @@ -35,6 +43,23 @@
</license>
</licenses>

<scm>
<connection>scm:git:[email protected]:CycloneDX/cyclonedx-maven-plugin.git</connection>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin.git</url>
<developerConnection>scm:git:[email protected]:CycloneDX/cyclonedx-maven-plugin.git</developerConnection>
<tag>HEAD</tag>
</scm>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin/issues</url>
</issueManagement>

<ciManagement>
<system>GitHub</system>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin/actions</url>
</ciManagement>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
25 changes: 25 additions & 0 deletions src/it/makeBom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
<version>1.0-SNAPSHOT</version>

<name>cyclonedx:makeBom smoke test with default configuration</name>
<description>This is a smoke test to show how the plugin should be used in the simplest ways and see the results.</description>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin</url>

<inceptionYear>2017</inceptionYear>
<organization>
<name>OWASP Foundation</name>
<url>https://owasp.org/</url>
</organization>

<licenses>
<license>
Expand All @@ -34,6 +42,23 @@
</license>
</licenses>

<scm>
<connection>scm:git:[email protected]:CycloneDX/cyclonedx-maven-plugin.git</connection>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin.git</url>
<developerConnection>scm:git:[email protected]:CycloneDX/cyclonedx-maven-plugin.git</developerConnection>
<tag>HEAD</tag>
</scm>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin/issues</url>
</issueManagement>

<ciManagement>
<system>GitHub</system>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin/actions</url>
</ciManagement>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
2 changes: 2 additions & 0 deletions src/it/makeBom/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ File bomFileJson = new File(basedir, "target/bom.json")

assert bomFileXml.exists()
assert bomFileJson.exists()

assert bomFileXml.text.contains('<reference type="website"><url>https://github.com/CycloneDX/cyclonedx-maven-plugin</url></reference>')
2 changes: 1 addition & 1 deletion src/main/java/org/cyclonedx/maven/BaseCycloneDxMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ private void extractMetadata(MavenProject project, Component component) {
if (CycloneDxSchema.Version.VERSION_10 != schemaVersion()) {
if (project.getOrganization() != null && project.getOrganization().getUrl() != null) {
if (!doesComponentHaveExternalReference(component, ExternalReference.Type.WEBSITE)) {
addExternalReference(ExternalReference.Type.WEBSITE, project.getOrganization().getUrl(), component);
addExternalReference(ExternalReference.Type.WEBSITE, project.getUrl(), component);
}
}
if (project.getCiManagement() != null && project.getCiManagement().getUrl() != null) {
Expand Down

0 comments on commit 164cd1a

Please sign in to comment.