Skip to content

Commit 64f577b

Browse files
authored
[MSHADE-459] Adjust to test also with Java 21 (#196)
1 parent e56294a commit 64f577b

File tree

10 files changed

+75
-23
lines changed

10 files changed

+75
-23
lines changed

.github/workflows/maven-verify.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ jobs:
2424
build:
2525
name: Verify
2626
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3
27+
with:
28+
ff-jdk: "21"
29+
ff-jdk-distribution: "corretto"

pom.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@
327327
<plugin>
328328
<groupId>org.apache.maven.plugins</groupId>
329329
<artifactId>maven-invoker-plugin</artifactId>
330+
<version>3.6.0</version>
330331
<configuration>
331332
<goals>
332333
<goal>package</goal>
@@ -365,5 +366,44 @@
365366
</plugins>
366367
</build>
367368
</profile>
369+
370+
<!-- TODO remove with parent pom or spotless plugin update https://github.com/diffplug/spotless/issues/1774 -->
371+
<profile>
372+
<id>java11+</id>
373+
<activation>
374+
<jdk>[11,)</jdk>
375+
</activation>
376+
<build>
377+
<plugins>
378+
<plugin>
379+
<groupId>com.diffplug.spotless</groupId>
380+
<artifactId>spotless-maven-plugin</artifactId>
381+
<version>2.39.0</version>
382+
</plugin>
383+
</plugins>
384+
</build>
385+
</profile>
386+
387+
<profile>
388+
<id>java21+</id>
389+
<activation>
390+
<jdk>[21,)</jdk>
391+
</activation>
392+
<build>
393+
<plugins>
394+
<plugin>
395+
<groupId>com.diffplug.spotless</groupId>
396+
<artifactId>spotless-maven-plugin</artifactId>
397+
<configuration>
398+
<java>
399+
<palantirJavaFormat>
400+
<version>2.35.0</version>
401+
</palantirJavaFormat>
402+
</java>
403+
</configuration>
404+
</plugin>
405+
</plugins>
406+
</build>
407+
</profile>
368408
</profiles>
369409
</project>

src/it/MSHADE-321_respectDrpFlag/verify.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import groovy.xml.XmlParser
1920

2021
File jarRenamedFile = new File(basedir, "target/shade_321.jar")
2122
assert jarRenamedFile.isFile()

src/it/projects/MSHADE-185/verify.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import groovy.xml.XmlSlurper;
1920

2021
File pomFile = new File( basedir, "dependency-reduced-pom.xml" );
2122
assert pomFile.isFile()

src/it/projects/dep-reduced-pom-artifactset-provided-excludes/verify.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import groovy.xml.XmlParser
1920

2021
File pomFile = new File( basedir, "target/dependency-reduced-pom.xml" );
2122
assert pomFile.isFile()

src/it/projects/dep-reduced-pom-exclusions/verify.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import groovy.xml.XmlParser
1920

2021
File pomFile = new File( basedir, "dependency-reduced-pom.xml" )
2122
assert pomFile.isFile()

src/it/projects/dep-reduced-pom-unique/verify.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.io.*;
2121
import java.util.Properties;
22+
import groovy.xml.XmlParser
2223

2324
def drps = basedir.listFiles( { dir, file -> file ==~ "dependency-reduced-.*\\.xml" } as FilenameFilter )
2425

src/it/projects/dep-reduced-pom-use-base-version/verify.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import groovy.xml.XmlParser
1920

2021
File pomFile = new File( basedir, "target/dependency-reduced-pom.xml" );
2122
assert pomFile.isFile()

src/it/projects/dep-reduced-pom/verify.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import groovy.xml.XmlParser
1920

2021
File pomFile = new File( basedir, "target/dependency-reduced-pom.xml" );
2122
assert pomFile.isFile()
Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
14-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
18-
*/
19-
def shadedJar = new File( basedir, "app/target/mshade-135-1.0.jar")
20-
def pluginXml = new URL( "jar:" + shadedJar.toURL() + "!/META-INF/maven/plugin.xml" )
21-
def plugin = new XmlSlurper().parse( pluginXml.openStream() );
22-
assert plugin.mojos.mojo[0].implementation == "hidden.impl.TestMojo";
23-
assert plugin.mojos.mojo[0].parameters.parameter[0].type == "hidden.impl.Entry";
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
import groovy.xml.XmlSlurper
20+
21+
def shadedJar = new File( basedir, "app/target/mshade-135-1.0.jar")
22+
def pluginXml = new URL( "jar:" + shadedJar.toURL() + "!/META-INF/maven/plugin.xml" )
23+
def plugin = new XmlSlurper().parse( pluginXml.openStream() );
24+
assert plugin.mojos.mojo[0].implementation == "hidden.impl.TestMojo";
25+
assert plugin.mojos.mojo[0].parameters.parameter[0].type == "hidden.impl.Entry";
2426
assert plugin.mojos.mojo[0].requirements.requirement[0].role == "hidden.api.Component";

0 commit comments

Comments
 (0)