Skip to content

Fix #8087-Unable to add new web service client#8228

Open
pepness wants to merge 10 commits into
apache:masterfrom
pepness:fix-8087
Open

Fix #8087-Unable to add new web service client#8228
pepness wants to merge 10 commits into
apache:masterfrom
pepness:fix-8087

Conversation

@pepness
Copy link
Copy Markdown
Member

@pepness pepness commented Feb 10, 2025

Fix issue 8087
NetBeans Notes:

  • Add support for Jakarta EE 9/10 plugins for metro, jax-ws, and maven-war-plugin
  • Add support for jakarta namespaces for Jakarta EE 9 and later
  • Change jax-ws group id to com.sun.xml.ws
  • Add instance variables to JaxWsClientCreator that will help with the new logic to support jakarta namespaces and reduce method calls
  • Refactor code and add missing add support for creating web service clients for EJB, CAR and Java SE maven
    projects
  • Simplify logic that compute whether a project is Web, Car, Jar, EJB
  • Add missing EJB version support
  • Add missing Servlet version support
  • Add missing AppClient descriptor for Jakarta EE 11
  • Add missing AppClient resolvers Java EE 7 to Jakarta EE 11
  • Add new method getProfile()
  • Change logic in getJ2eeProfile() and use the new method getProfile()
  • Remove version model when calling addJaxWSPlugin(), the default version will vary for the computed Profile, Java EE 8 will use model 2.2, Jakarta EE 9/10/11 will use 3.0
  • Generate new code for equals() and hashCode() methods
  • Use Pattern Matching for instanceof
  • Use Switch Expressions
  • Use constants when possible
  • Use diamond inference
  • Use try-with-resources
  • Increase array size

NetBeans Testing:

  • Verify successful execution of libraries and licenses Ant test
  • Verify successful execution of Verify Sigtests
  • Verify successful execution of unit tests for modules maven.jaxws
  • Started NetBeans and ensure the log didn't have any ERROR or new WARNINGS
  • Successfully register GlassFish 5/6/7
    • Create a Jakarta EE 8/9/10 maven web app and create a new Web Service from WSDL and Web Service Client
    • Create a Jakarta EE 8/9/10 maven ejb app and create a new Web Service from WSDL and Web Service Client
    • Create a maven Java App with Java 8/11/25 and create a new Web Service from WSDL and Web Service Client
      • Verify that it creates a new Web Service
      • Verify that the generated sources are using the correct version plugins
      • Verify that the generated sources are using the correct namespace

Jakarta EE 8
Screenshot from 2025-02-10 15-19-47
Jakarta EE 9
Screenshot from 2025-02-10 15-19-40
Jakarta EE 10
Screenshot From 2026-05-11 18-04-36
Tested with multiple projects (Web, EJB, JavaSE) with different Java/JakartaEE versions
Screenshot From 2026-05-11 19-13-11

@pepness pepness added Java EE/Jakarta EE [ci] enable enterprise job enterprise [ci] enable enterprise job labels Feb 10, 2025
@pepness pepness added this to the NB26 milestone Feb 10, 2025
@pepness pepness self-assigned this Feb 10, 2025
@pepness pepness linked an issue Feb 10, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! In general looks sane to me. I left inline comments.

Comment thread enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/MavenModelUtils.java Outdated
Comment thread enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/MavenModelUtils.java Outdated
@neilcsmith-net neilcsmith-net modified the milestones: NB26, NB27 Apr 16, 2025
@mbien mbien added the Maven [ci] enable "build tools" tests label Jun 20, 2025
Copy link
Copy Markdown
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments while looking through it - nice cleanups!

(please don't forget to squash btw)

Comment thread enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java Outdated
Comment thread enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java Outdated
Comment thread enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/WSUtils.java Outdated
@ebarboni ebarboni modified the milestones: NB27, NB28 Jul 23, 2025
@matthiasblaesing
Copy link
Copy Markdown
Contributor

@pepness what is the state of this? I think it would be good to rebase this onto current master, cleanup the history and check if all comments are addressed. The static profile variable is still there and globals like these are really ugly to debug.

@ebarboni ebarboni modified the milestones: NB28, NB29 Oct 15, 2025
@ebarboni ebarboni modified the milestones: NB29, NB30 Jan 22, 2026
@mbien mbien modified the milestones: NB30, NB31 Apr 14, 2026
@pepness
Copy link
Copy Markdown
Member Author

pepness commented May 12, 2026

@pepness what is the state of this? I think it would be good to rebase this onto current master, cleanup the history and check if all comments are addressed. The static profile variable is still there and globals like these are really ugly to debug.

I updated some maven plugins and removed the use of the static variable. Will re-test everything and finish by tomorrow.

@pepness
Copy link
Copy Markdown
Member Author

pepness commented May 13, 2026

All done.

Copy link
Copy Markdown
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me.

Final wish: Please check if the number of commits could be reduced. Should there be a need to revert this after merge 24 commits are really ugly to remove.

Apart from that I think merging this now, i.e. early in the 31 cycle is a very good idea.

Thank you!

* @see hasJaxWsAPI
*/
private static void getProfile(Project project) {
public Profile getProfile(Project project) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm mistaken, getProfile can stay static as there is no state other than what is stored in project that is passed in. The instances created in the *Creator classes can be dropped and replaced with a static call.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, done.

pepness added 3 commits May 14, 2026 19:17
 maven-war-plugin
-Add support for jakarta namespaces for Jakarta EE 9 and later
-Change jax-ws group id to 'com.sun.xml.ws'
-Add instance variables to 'JaxWsClientCreator' that will help with the
 new logic to support jakarta namespaces and reduce method calls
-Use constants when possible
-Use diamond inference
-Use try-with-resources
-Increase array size
Add missing Servlet version support
Add missing AppClient descriptor for Jakarta EE 11
Add missing AppClient resolvers Java EE 7 to Jakarta EE 11
Bump default profile return to Jakarta EE 8
-Add @OverRide annotation
-Use diamond operator
-Use parseBoolean over valueOf
-Use Multi-catch
-Bump default deployment descriptor to AppClient 8
-Replace usage of deprecated methods from codehaus
-Refactor code and add missing support for Client Applications
pepness added 7 commits May 14, 2026 19:17
-Remove subtypes from @ProjectServiceProvider
-Move method getProfileFromPOM to MavenProjectSupport class and use it
 when computing the profile in all implementations.
-Add getSourceLevel method to MavenProjectSupport, useful with JSE maven
 projects
-Change logic in getJ2eeProfile() and use the new method getProfile()
-Generate new code for equals() and hashCode() methods
-Use Pattern Matching for instanceof
-Use Switch Expressions
-Remove unused imports
-Remove subtypes from @ProjectServiceProvider
-Use psf LOGGER
-Add import for Plugin class
-Fix wrong if statement
-Remove version model when calling addJaxWSPlugin(), the default version
 will vary for the computed Profile, Java EE 8 will use model 2.2,
 Jakarta EE 9/10/11 will use 3.0.
 projects.
-Simplify logic that compute whether a project is Web, Car, Jar, EJB
-Add support for Car and Jar projects to isJakartaEENameSpace()
-Add method getSourceLevel()
-Add a new module dependency in order to get the source level of a java
 file
-Add module maven.jaxws as a friend
-Add useful variable for debugging
-Remove unused imports
-Fix wrong artifact and update GlassFish 7/8 version
-Bump javac to version 17 and use:
 -Pattern Matching for instanceof
 -Switch Expressions
 types should be in the same if statement.
-Revert: Remove subtypes from @ProjectServiceProvider
-Fix mismatch when using MavenProjectSupport.getProfileFromPOM() to
 retrieve the correct Profile.
-Add Logger and use it
-Use try-with-resources
-equals() and hashCode( should cover the same fields
-Remove the redundant Xpp3Dom variable
-close all wrapped streams in try-with-resources with 'bw'
-Bump 'webservices-api' & 'webservices-rt' version to 4.0.6
-Bump 'maven-war-plugin' version to 3.5.1
-Remove use of static variable 'profile' and compute the profile in the
 classes that create the WS Client; 'JaxWsClientCreator' and
 'JaxWsServiceCreator'
-Change 'getProfile' method to static and remove 'MavenModelUtils'
 instances.
@pepness
Copy link
Copy Markdown
Member Author

pepness commented May 15, 2026

All done.

Looks sane to me.

Final wish: Please check if the number of commits could be reduced. Should there be a need to revert this after merge 24 commits are really ugly to remove.

Apart from that I think merging this now, i.e. early in the 31 cycle is a very good idea.

Thank you!

Rebase and squash it to 10 commits.

@matthiasblaesing
Copy link
Copy Markdown
Contributor

Unless I'm mistaken nothing in here touches the sig files (the most probable cause for merge conflicts after a release), so my perspective this can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enterprise [ci] enable enterprise job Java EE/Jakarta EE [ci] enable enterprise job Maven [ci] enable "build tools" tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to add new web service client

5 participants