Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multi-module classpath issues (closes #183) #185

Merged
merged 1 commit into from
Dec 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.11.2-SNAPSHOT</version>
<version>1.12.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -55,11 +55,6 @@
<version>3.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-classworlds</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
Expand Down Expand Up @@ -391,7 +386,6 @@
version may not match the compilation version -->
<ignore>org/apache/maven/*</ignore>
<ignore>org/codehaus/plexus/*</ignore>
<ignore>org/codehaus/classworlds/*</ignore>
</ignores>
</configuration>
</plugin>
Expand Down
55 changes: 55 additions & 0 deletions src/it/multimodulePluginAndProjectClasspath/a/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath</artifactId>
<version>testing</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath-a</artifactId>
<version>testing</version>
<name>GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test A Module</name>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
<configuration>
<scripts>
<script><![CDATA[
assert Class.forName('org.junit.Test') != null
try {
Class.forName('org.junit.jupiter.api.Test')
assert null != null // should throw exception and never reach
} catch (ClassNotFoundException e) {
// do nothing, this is expected
}
]]></script>
</scripts>
</configuration>
</plugin>
</plugins>
</build>

</project>
55 changes: 55 additions & 0 deletions src/it/multimodulePluginAndProjectClasspath/b/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath</artifactId>
<version>testing</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath-b</artifactId>
<version>testing</version>
<name>GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test B Module</name>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
<configuration>
<scripts>
<script><![CDATA[
assert Class.forName('org.junit.jupiter.api.Test') != null
try {
Class.forName('org.junit.Test')
assert null != null // should throw exception and never reach
} catch (ClassNotFoundException e) {
// do nothing, this is expected
}
]]></script>
</scripts>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals=clean test
#invoker.debug = true
87 changes: 87 additions & 0 deletions src/it/multimodulePluginAndProjectClasspath/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin-it-root</artifactId>
<version>testing</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath</artifactId>
<version>testing</version>
<name>GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test</name>
<packaging>pom</packaging>

<profiles>
<profile>
<id>indy</id>
<dependencies>
<dependency>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
<dependency>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy-ant</artifactId>
<classifier>indy</classifier>
</dependency>
</dependencies>
</profile>
<profile>
<id>nonindy</id>
<dependencies>
<dependency>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy-ant</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>pre2.3-indy</id>
<dependencies>
<dependency>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
</dependencies>
</profile>
<profile>
<id>pre2.3-nonindy</id>
<dependencies>
<dependency>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>

<modules>
<module>a</module>
<module>b</module>
</modules>

</project>
55 changes: 55 additions & 0 deletions src/it/multimodulePluginAndProjectClasspath2/a/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2</artifactId>
<version>testing</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2-a</artifactId>
<version>testing</version>
<name>GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test 2 A Module</name>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
<configuration>
<scripts>
<script><![CDATA[
assert Class.forName('org.junit.Test') != null
try {
Class.forName('org.junit.jupiter.api.Test')
assert null != null // should throw exception and never reach
} catch (ClassNotFoundException e) {
// do nothing, this is expected
}
]]></script>
</scripts>
</configuration>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>@junitVersion@</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

</project>
55 changes: 55 additions & 0 deletions src/it/multimodulePluginAndProjectClasspath2/b/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2</artifactId>
<version>testing</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2-b</artifactId>
<version>testing</version>
<name>GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test 2 B Module</name>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
<configuration>
<scripts>
<script><![CDATA[
assert Class.forName('org.junit.jupiter.api.Test') != null
try {
Class.forName('org.junit.Test')
assert null != null // should throw exception and never reach
} catch (ClassNotFoundException e) {
// do nothing, this is expected
}
]]></script>
</scripts>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit5Version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals=clean test
#invoker.debug = true