diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 93e4c18..9f8738b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: os: [ubuntu-latest,windows-latest, macOS-latest] - java: [8, 11, 17] + java: [8, 11, 17, 20] jdk: [temurin] fail-fast: false @@ -43,4 +43,7 @@ jobs: cache: 'maven' - name: Build with Maven - run: mvn install javadoc:javadoc -e -B -V -Pno-tests-if-not-on-osx + run: mvn install javadoc:javadoc -e -B -V + + - name: Build with Maven and target Java level - ${{ matrix.java }} + run: mvn clean install javadoc:javadoc -e -DjavaVersion=${{ matrix.java }} diff --git a/pom.xml b/pom.xml index 37db06a..41ad836 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,9 @@ + + ${javaVersion} + ${javaVersion} 2021-09-21T23:45:11Z @@ -43,7 +46,7 @@ com.google.inject guice - 5.1.0 + 6.0.0 org.junit.jupiter diff --git a/src/test/java/org/codehaus/plexus/testing/PlexusTestJakartaTest.java b/src/test/java/org/codehaus/plexus/testing/PlexusTestJakartaTest.java new file mode 100644 index 0000000..0da3636 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/PlexusTestJakartaTest.java @@ -0,0 +1,39 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import jakarta.inject.Inject; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +@PlexusTest +class PlexusTestJakartaTest { + + @Inject + private TestJakartaComponent testJakartaComponent; + + @Test + void dependencyShouldBeInjected() { + assertNotNull(testJakartaComponent); + assertNotNull(testJakartaComponent.getTestJakartaComponent2()); + assertNotNull(testJakartaComponent.getTestJavaxComponent2()); + } +} diff --git a/src/test/java/org/codehaus/plexus/testing/PlexusTestTest.java b/src/test/java/org/codehaus/plexus/testing/PlexusTestJavaxTest.java similarity index 85% rename from src/test/java/org/codehaus/plexus/testing/PlexusTestTest.java rename to src/test/java/org/codehaus/plexus/testing/PlexusTestJavaxTest.java index 904a6c9..add8490 100644 --- a/src/test/java/org/codehaus/plexus/testing/PlexusTestTest.java +++ b/src/test/java/org/codehaus/plexus/testing/PlexusTestJavaxTest.java @@ -26,14 +26,14 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; @PlexusTest -class PlexusTestTest { +class PlexusTestJavaxTest { @Inject - private TestComponent testComponent; + private TestJavaxComponent testJavaxComponent; @Test void dependencyShouldBeInjected() { - assertNotNull(testComponent); - assertNotNull(testComponent.getTestComponent2()); + assertNotNull(testJavaxComponent); + assertNotNull(testJavaxComponent.getTestComponent2()); } } diff --git a/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent.java b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent.java new file mode 100644 index 0000000..ac71e40 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent.java @@ -0,0 +1,40 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import jakarta.inject.Inject; +import jakarta.inject.Named; + +@Named +public class TestJakartaComponent { + @Inject + private TestJavaxComponent2 testJavaxComponent2; + + @Inject + private TestJakartaComponent2 testJakartaComponent2; + + public TestJavaxComponent2 getTestJavaxComponent2() { + return testJavaxComponent2; + } + + public TestJakartaComponent2 getTestJakartaComponent2() { + return testJakartaComponent2; + } +} diff --git a/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent2.java b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent2.java new file mode 100644 index 0000000..7db989d --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent2.java @@ -0,0 +1,25 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Named; + +@Named +public class TestJakartaComponent2 {} diff --git a/src/test/java/org/codehaus/plexus/testing/TestComponent.java b/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent.java similarity index 84% rename from src/test/java/org/codehaus/plexus/testing/TestComponent.java rename to src/test/java/org/codehaus/plexus/testing/TestJavaxComponent.java index 9d7d03b..6ce98b7 100644 --- a/src/test/java/org/codehaus/plexus/testing/TestComponent.java +++ b/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent.java @@ -23,11 +23,11 @@ import javax.inject.Named; @Named -public class TestComponent { +public class TestJavaxComponent { @Inject - private TestComponent2 testComponent2; + private TestJavaxComponent2 testJavaxComponent2; - public TestComponent2 getTestComponent2() { - return testComponent2; + public TestJavaxComponent2 getTestComponent2() { + return testJavaxComponent2; } } diff --git a/src/test/java/org/codehaus/plexus/testing/TestComponent2.java b/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent2.java similarity index 96% rename from src/test/java/org/codehaus/plexus/testing/TestComponent2.java rename to src/test/java/org/codehaus/plexus/testing/TestJavaxComponent2.java index 2fa4198..d5afd5b 100644 --- a/src/test/java/org/codehaus/plexus/testing/TestComponent2.java +++ b/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent2.java @@ -22,4 +22,4 @@ import javax.inject.Named; @Named -public class TestComponent2 {} +public class TestJavaxComponent2 {}