-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test to ensure we handle relocations, closes #289
Signed-off-by: Kevin Conner <kev.conner@gmail.com>
- Loading branch information
Showing
4 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.cyclonedx.maven; | ||
|
||
import java.io.File; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder; | ||
import io.takari.maven.testing.executor.MavenVersions; | ||
import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner; | ||
|
||
/** | ||
* test for https://github.com/CycloneDX/cyclonedx-maven-plugin/issues/289 | ||
* NPE when handling relocations | ||
*/ | ||
@RunWith(MavenJUnitTestRunner.class) | ||
@MavenVersions({"3.6.3"}) | ||
public class Issue289Test extends BaseMavenVerifier { | ||
|
||
public Issue289Test(MavenRuntimeBuilder runtimeBuilder) throws Exception { | ||
super(runtimeBuilder); | ||
} | ||
|
||
@Test | ||
public void testForRelocations() throws Exception { | ||
File projDir = resources.getBasedir("issue-289"); | ||
|
||
verifier | ||
.forProject(projDir) | ||
.withCliOption("-Dcurrent.version=" + getCurrentVersion()) // inject cyclonedx-maven-plugin version | ||
.withCliOption("-X") // debug | ||
.withCliOption("-B") | ||
.execute("clean", "package") | ||
.assertErrorFreeLog(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.example</groupId> | ||
<artifactId>issue289_parent</artifactId> | ||
<version>1.0.0</version> | ||
</parent> | ||
|
||
<artifactId>issue289_dependency1</artifactId> | ||
|
||
<name>Dependency 1</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>axis</groupId> | ||
<artifactId>axis-ant</artifactId> | ||
<version>1.4</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>axis</groupId> | ||
<artifactId>axis</artifactId> | ||
<version>1.4</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.example</groupId> | ||
<artifactId>issue289_parent</artifactId> | ||
<version>1.0.0</version> | ||
</parent> | ||
|
||
<artifactId>issue289_dependency2</artifactId> | ||
|
||
<name>Dependency 2</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>axis</groupId> | ||
<artifactId>axis-ant</artifactId> | ||
<version>1.3</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.example</groupId> | ||
<artifactId>issue289_dependency1</artifactId> | ||
<version>1.0.0</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>issue289_parent</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0.0</version> | ||
|
||
<name>Issue 289 Parent</name> | ||
|
||
<modules> | ||
<module>dependency1</module> | ||
<module>dependency2</module> | ||
</modules> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.cyclonedx</groupId> | ||
<artifactId>cyclonedx-maven-plugin</artifactId> | ||
<version>${current.version}</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>makeAggregateBom</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<projectType>library</projectType> | ||
<schemaVersion>1.4</schemaVersion> | ||
<includeBomSerialNumber>true</includeBomSerialNumber> | ||
<includeCompileScope>true</includeCompileScope> | ||
<includeProvidedScope>false</includeProvidedScope> | ||
<includeRuntimeScope>false</includeRuntimeScope> | ||
<includeSystemScope>false</includeSystemScope> | ||
<includeTestScope>false</includeTestScope> | ||
<includeLicenseText>false</includeLicenseText> | ||
<outputFormat>xml</outputFormat> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
</project> |