Skip to content

Commit b7c506a

Browse files
jaxws-maven-plugin to 2.3.X (#929)
* migrate jaxws-maven-plugin to 2.5.X * use version pattern * Update src/test/java/org/openrewrite/java/migrate/maven/MigrateJaxwsMavenPluginTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * end description with '.' * re add import * Fix version and xPath for jaxws-mavem-plugin migration * apply pr feedback * MigrateJaxwsMavenPluginTest.java aktualisieren Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent ee64233 commit b7c506a

File tree

3 files changed

+174
-0
lines changed

3 files changed

+174
-0
lines changed

src/main/resources/META-INF/rewrite/java-version-11.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ recipeList:
3737
# Add an explicit JAXB/JAX-WS runtime and upgrade the dependencies to Jakarta EE 8
3838
- org.openrewrite.java.migrate.javax.AddJaxbDependenciesWithRuntime
3939
- org.openrewrite.java.migrate.javax.AddJaxwsDependencies
40+
- org.openrewrite.java.migrate.javax.MigrateJaxBWSPlugin
4041
- org.openrewrite.java.migrate.javax.AddInjectDependencies
4142
- org.openrewrite.java.migrate.javax.AddCommonAnnotationsDependencies
4243
# Remediate deprecations
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Copyright 2025 the original author or authors.
3+
# <p>
4+
# Licensed under the Moderne Source Available License (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# <p>
8+
# https://docs.moderne.io/licensing/moderne-source-available-license
9+
# <p>
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
---
18+
type: specs.openrewrite.org/v1beta/recipe
19+
name: org.openrewrite.java.migrate.javax.MigrateJaxBWSPlugin
20+
displayName: Migrate JAXB-WS Plugin
21+
description: Upgrade the JAXB-WS Maven plugin to be compatible with Java 11.
22+
tags:
23+
- java11
24+
recipeList:
25+
- org.openrewrite.maven.ChangePluginGroupIdAndArtifactId:
26+
oldGroupId: org.jvnet.jax-ws-commons
27+
oldArtifactId: jaxws-maven-plugin
28+
newGroupId: com.sun.xml.ws
29+
newVersion: 2.3.7
30+
- org.openrewrite.xml.AddOrUpdateChildTag:
31+
parentXPath: //plugin[artifactId='jaxws-maven-plugin']/executions/execution
32+
newChildTag: <phase>generate-sources</phase>
33+
- org.openrewrite.xml.ChangeTagName:
34+
elementName: //plugin[artifactId='jaxws-maven-plugin']/executions/execution/configuration/nocompile
35+
newName: xnocompile
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/*
2+
* Copyright 2025 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.openrewrite.java.migrate.maven;
17+
18+
import org.junit.jupiter.api.Test;
19+
import org.openrewrite.DocumentExample;
20+
import org.openrewrite.test.RecipeSpec;
21+
import org.openrewrite.test.RewriteTest;
22+
23+
import static org.openrewrite.maven.Assertions.pomXml;
24+
25+
class MigrateJaxwsMavenPluginTest implements RewriteTest {
26+
27+
@Override
28+
public void defaults(RecipeSpec spec) {
29+
spec.recipeFromResources("org.openrewrite.java.migrate.javax.MigrateJaxBWSPlugin");
30+
}
31+
32+
@DocumentExample
33+
@Test
34+
void migrateJaxwsPluginFromJvnetToSunXmlWs() {
35+
rewriteRun(
36+
//language=xml
37+
pomXml(
38+
"""
39+
<project>
40+
<modelVersion>4.0.0</modelVersion>
41+
<groupId>com.example</groupId>
42+
<artifactId>jaxws-service</artifactId>
43+
<version>1.0.0</version>
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.jvnet.jax-ws-commons</groupId>
48+
<artifactId>jaxws-maven-plugin</artifactId>
49+
<version>2.1</version>
50+
<executions>
51+
<execution>
52+
<id>wsimport-from-jdk</id>
53+
<goals>
54+
<goal>wsimport</goal>
55+
</goals>
56+
<configuration>
57+
<sourceDestDir>${project.build.directory}/generated-sources/wsimport</sourceDestDir>
58+
<wsdlDirectory>${project.basedir}/src/main/resources/wsdl</wsdlDirectory>
59+
<wsdlFiles>
60+
<wsdlFile>STSSAPPrimingService.wsdl</wsdlFile>
61+
</wsdlFiles>
62+
<packageName>org.example.generated</packageName>
63+
<keep>true</keep>
64+
<nocompile>true</nocompile>
65+
<verbose>true</verbose>
66+
</configuration>
67+
</execution>
68+
</executions>
69+
</plugin>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-compiler-plugin</artifactId>
73+
<version>3.14.1</version>
74+
<executions>
75+
<execution>
76+
<configuration>
77+
<nocompile>true</nocompile>
78+
</configuration>
79+
</execution>
80+
</executions>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
</project>
85+
""",
86+
"""
87+
<project>
88+
<modelVersion>4.0.0</modelVersion>
89+
<groupId>com.example</groupId>
90+
<artifactId>jaxws-service</artifactId>
91+
<version>1.0.0</version>
92+
<build>
93+
<plugins>
94+
<plugin>
95+
<groupId>com.sun.xml.ws</groupId>
96+
<artifactId>jaxws-maven-plugin</artifactId>
97+
<version>2.3.7</version>
98+
<executions>
99+
<execution>
100+
<id>wsimport-from-jdk</id>
101+
<goals>
102+
<goal>wsimport</goal>
103+
</goals>
104+
<configuration>
105+
<sourceDestDir>${project.build.directory}/generated-sources/wsimport</sourceDestDir>
106+
<wsdlDirectory>${project.basedir}/src/main/resources/wsdl</wsdlDirectory>
107+
<wsdlFiles>
108+
<wsdlFile>STSSAPPrimingService.wsdl</wsdlFile>
109+
</wsdlFiles>
110+
<packageName>org.example.generated</packageName>
111+
<keep>true</keep>
112+
<xnocompile>true</xnocompile>
113+
<verbose>true</verbose>
114+
</configuration>
115+
<phase>generate-sources</phase>
116+
</execution>
117+
</executions>
118+
</plugin>
119+
<plugin>
120+
<groupId>org.apache.maven.plugins</groupId>
121+
<artifactId>maven-compiler-plugin</artifactId>
122+
<version>3.14.1</version>
123+
<executions>
124+
<execution>
125+
<configuration>
126+
<nocompile>true</nocompile>
127+
</configuration>
128+
</execution>
129+
</executions>
130+
</plugin>
131+
</plugins>
132+
</build>
133+
</project>
134+
"""
135+
)
136+
);
137+
}
138+
}

0 commit comments

Comments
 (0)