This is an automated email from the ASF dual-hosted git repository. mbien pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans-mavenutils-nbm-maven-plugin.git
The following commit(s) were added to refs/heads/master by this push: new 779dba2 Updated CI workflow + fixed some tests + added junit report step new 040803a Merge pull request #115 from mbien/ci-updates 779dba2 is described below commit 779dba27d024608c16efdbb4907059b52167e1c8 Author: Michael Bien <mbie...@gmail.com> AuthorDate: Mon Nov 6 18:47:50 2023 +0100 Updated CI workflow + fixed some tests + added junit report step it should now build/test on JDK 21 --- .github/workflows/ci.yml | 32 +++++++++++++++++++- nbm-maven-plugin/src/it/full/pom.xml | 34 +++++++++++++++++++--- .../nbm/CreateNetBeansFileStructureTest.java | 21 ++++++++----- 3 files changed, 74 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1914ed..a7dfadf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,20 @@ +# 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. + name: Verify on: @@ -14,20 +31,33 @@ concurrency: jobs: build: + name: Build and Test on JDK ${{ matrix.java }} runs-on: ubuntu-latest strategy: matrix: - java: [ 8, 11, 21 ] + java: [ 8, 11, 17, 21 ] + fail-fast: false + steps: - uses: actions/checkout@v4 with: persist-credentials: false submodules: false show-progress: false + - name: "Set up JDK ${{ matrix.java }}" uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} distribution: 'temurin' + - name: Build & Test run: ./mvnw -B verify -P run-its + + - name: Create Test Summary + uses: mikepenz/action-junit-report@v4 + if: always() + with: + annotate_only: true + detailed_summary: true + report_paths: 'nb*/target/surefire-reports/TEST-*.xml' diff --git a/nbm-maven-plugin/src/it/full/pom.xml b/nbm-maven-plugin/src/it/full/pom.xml index 3321cce..1323ef5 100644 --- a/nbm-maven-plugin/src/it/full/pom.xml +++ b/nbm-maven-plugin/src/it/full/pom.xml @@ -44,13 +44,12 @@ under the License. </configuration> </plugin> <plugin> - <!-- NetBeans 6.9+ requires JDK 6, starting NetBeans 7.4 source 1.7 is required --> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>2.5.1</version> + <version>3.11.0</version> <configuration> - <source>1.7</source> - <target>1.7</target> + <source>8</source> + <target>8</target> </configuration> </plugin> <plugin> @@ -63,10 +62,37 @@ under the License. </archive> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>3.2.1</version> + </plugin> </plugins> </pluginManagement> </build> + <profiles> + <profile> + <id>jdk17</id> + <activation> + <jdk>[17,)</jdk> + </activation> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <argLine>-Djava.security.manager=allow --add-opens=java.base/java.net=ALL-UNNAMED</argLine> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + </profile> + </profiles> + <modules> <module>branding</module> <module>application</module> diff --git a/nbm-maven-plugin/src/test/java/org/apache/netbeans/nbm/CreateNetBeansFileStructureTest.java b/nbm-maven-plugin/src/test/java/org/apache/netbeans/nbm/CreateNetBeansFileStructureTest.java index 8c89a27..7bd2447 100644 --- a/nbm-maven-plugin/src/test/java/org/apache/netbeans/nbm/CreateNetBeansFileStructureTest.java +++ b/nbm-maven-plugin/src/test/java/org/apache/netbeans/nbm/CreateNetBeansFileStructureTest.java @@ -30,22 +30,27 @@ import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.artifact.resolver.ArtifactResolver; import org.apache.maven.plugin.testing.AbstractMojoTestCase; -public class CreateNetBeansFileStructureTest - extends AbstractMojoTestCase -{ +public class CreateNetBeansFileStructureTest extends AbstractMojoTestCase { + + public void testWriteExternal() throws Exception { + + String version = "4.13.2"; // TODO must be in local repo downloaded by other means -> fix this test! - public void testWriteExternal() - throws Exception - { String localRepository = System.getProperty( "localRepository" ); ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.class.getName() ); ArtifactResolver artifactResolver = (ArtifactResolver) lookup( ArtifactResolver.class.getName() ); - Artifact a = artifactFactory.createBuildArtifact( "junit", "junit", "4.12", "jar" ); + Artifact a = artifactFactory.createBuildArtifact( "junit", "junit", version, "jar" ); // DefaultArtifactRepository central = new DefaultArtifactRepository( "central", "http://repo.maven.apache.org/maven2", new DefaultRepositoryLayout() ); artifactResolver.resolve( a, Collections.<ArtifactRepository>emptyList(), new DefaultArtifactRepository( "local", new File( localRepository ).toURI().toString(), new DefaultRepositoryLayout() ) ); StringWriter w = new StringWriter(); CreateNetBeansFileStructure.writeExternal( new PrintWriter( w ), a ); - assertEquals( "CRC:1355517765\nSIZE:314932\nURL:m2:/junit:junit:4.12:jar\nURL:http://repo.maven.apache.org/maven2/junit/junit/4.12/junit-4.12.jar\n", w.toString() ); + assertEquals( + "CRC:1161534166\n" + + "SIZE:384581\n" + + "URL:m2:/junit:junit:"+version+":jar\n" + + "URL:http://repo.maven.apache.org/maven2/junit/junit/"+version+"/junit-"+version+".jar\n", + w.toString() + ); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists