You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2020/12/20 18:28:33 UTC
[maven-integration-testing] 01/01: [MNG-7045] Drop CDI API from
Maven
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch MNG-7045
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git
commit 7ed874703d8fe70112f6304da3fa7d9e3f6df564
Author: Christoph Hümbert <ch...@commsult.de>
AuthorDate: Mon Dec 14 22:07:42 2020 +0100
[MNG-7045] Drop CDI API from Maven
This closes #88
---
.../org/apache/maven/it/IntegrationTestSuite.java | 1 +
...nITmng7045DropUselessAndOutdatedCdiApiTest.java | 31 ++++++++++
.../src/test/resources/bootstrap/group-11/pom.xml | 15 +++++
core-it-suite/src/test/resources/mng7045/pom.xml | 66 ++++++++++++++++++++++
4 files changed, 113 insertions(+)
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index 5c78f9a..fc10839 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -107,6 +107,7 @@ public class IntegrationTestSuite
// -------------------------------------------------------------------------------------------------------------
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+ suite.addTestSuite( MavenITmng7045DropUselessAndOutdatedCdiApiTest.class );
suite.addTestSuite( MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest.class );
suite.addTestSuite( MavenITmng6754TimestampInMultimoduleProject.class );
suite.addTestSuite( MavenITmng6981ProjectListShouldIncludeChildrenTest.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7045DropUselessAndOutdatedCdiApiTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7045DropUselessAndOutdatedCdiApiTest.java
new file mode 100644
index 0000000..f735926
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7045DropUselessAndOutdatedCdiApiTest.java
@@ -0,0 +1,31 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.apache.maven.it.util.ResourceExtractor;
+import org.junit.Test;
+
+public class MavenITmng7045DropUselessAndOutdatedCdiApiTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng7045DropUselessAndOutdatedCdiApiTest()
+ {
+ super( "[4.0.0-alpha-1,)" );
+ }
+
+ @Test
+ public void testCdiApi()
+ throws IOException, VerificationException
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng7045" );
+ Verifier verifier = newVerifier( testDir.getAbsolutePath()) ;
+
+ verifier.executeGoal( "process-classes") ;
+ verifier.resetStreams();
+ verifier.verifyErrorFreeLog();
+ }
+
+}
diff --git a/core-it-suite/src/test/resources/bootstrap/group-11/pom.xml b/core-it-suite/src/test/resources/bootstrap/group-11/pom.xml
index 30be7ce..3442b61 100644
--- a/core-it-suite/src/test/resources/bootstrap/group-11/pom.xml
+++ b/core-it-suite/src/test/resources/bootstrap/group-11/pom.xml
@@ -44,5 +44,20 @@ under the License.
<artifactId>plexus-utils</artifactId>
<version>1.5.6</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy</artifactId>
+ <version>3.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
+ <version>1.11.0</version>
+ </dependency>
</dependencies>
</project>
diff --git a/core-it-suite/src/test/resources/mng7045/pom.xml b/core-it-suite/src/test/resources/mng7045/pom.xml
new file mode 100644
index 0000000..e983c1f
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng7045/pom.xml
@@ -0,0 +1,66 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.mng7045</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0</version>
+
+ <name>Maven Integration Test :: MNG-7045</name>
+ <description>
+ Do a Maven exec-java which executes some CDI 2.0 code which would fail if maven leaks CDI API 1.0.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ <version>1.3</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ <configuration>
+ <source>8</source>
+ <target>8</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
+ <version>1.11.0</version>
+ <executions>
+ <execution>
+ <id>run</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <scripts>
+ <script><![CDATA[
+println("InstanceSource=" + javax.enterprise.inject.Instance.class.getProtectionDomain().getCodeSource())
+javax.enterprise.inject.Instance.class.getDeclaredMethod("stream")
+ ]]></script>
+ </scripts>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy</artifactId>
+ <version>3.0.7</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+