Skip to content

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

Open
pepness wants to merge 1 commit into
apache:masterfrom
pepness:fix-8087
Open

Fix #8087-Unable to add new web service client#8228
pepness wants to merge 1 commit 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
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.

@pepness
Copy link
Copy Markdown
Member Author

pepness commented May 18, 2026

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.

Should I squash everything to 1 commit?

@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.

Should I squash everything to 1 commit?

Good question. I depends on whether the commit individually make sense or should be separated. For example if code cleanup and feature work are both present in a PR I prefer separate commits, so that later it is clear what was the intention. On the other hand a single commit is easier to remove should it become necessary.

I thing there are sensible options for squashing. 57b9a65 looks like a candidate to keep separate, but could also be part of a single big change commit.

Does this help you?

@mbien
Copy link
Copy Markdown
Member

mbien commented May 21, 2026

fyi: commit msg is now missing the first line (it is starting with a bullet point), this might not be intended

edit: usually its the pr title or a one sentence summary, followed by blank line

-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
-Replace usage of deprecated methods from codehaus
-Add missing support for Client Applications
-Add a new module dependency in order to get the source level of a java
 file
-Add module 'maven.jaxws' as a friend
-Implement missing interface and its methods
-Move method 'getProfileFromPOM' to 'MavenProjectSupport' class and use
 it when computing the profile in all implementations.
-Add new method 'getSourceLevel'
-Add 'getSourceLevel' method to 'MavenProjectSupport', useful with JSE
 maven projects
-Add new method 'getProfile' that compute the profile in the classes
 that create the WS Client; 'JaxWsClientCreator' and
 'JaxWsServiceCreator'
-Change logic in 'getJ2eeProfile' and use the new method 'getProfile'
-Generate new code for 'equals' and 'hashCode' methods
-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.
-Add support for creating web services for EJB, CAR and Java SE maven
 projects.
-Simplify logic that compute whether a project is Web, Car, Jar, EJB
-Add support for Car and Jar projects to 'isJakartaEENameSpace'
-Fix wrong artifact and update GlassFish 7/8 version
-Update maven coordinates inside test
-Fix mismatch when using 'MavenProjectSupport.getProfileFromPOM' to
 retrieve the correct 'Profile'.
-'equals' and 'hashCode' methods should cover the same fields
-Remove the redundant Xpp3Dom variable
-Bump 'jaxws-maven-plugin' version to 4.0.4
-Bump 'webservices-api' & 'webservices-rt' version to 4.0.6
-Bump 'maven-war-plugin' version to 3.5.1

Cleaning/Refactoring:
-Bump javac to version 17 and use:
 -Pattern Matching for instanceof
 -Switch Expressions
-Use try-with-resources
-Add @OverRide annotation
-Remove unused imports
-Use diamond operator
-Use parseBoolean over valueOf
-Use Multi-catch
-Add Logger and use it
-Replace usage of deprecated methods from codehaus
-Add useful comment for debugging
-Add useful variable for debugging
-Use constants where makes sense
@pepness
Copy link
Copy Markdown
Member Author

pepness commented May 21, 2026

fyi: commit msg is now missing the first line (it is starting with a bullet point), this might not be intended

edit: usually its the pr title or a one sentence summary, followed by blank line

You are right, I fixed the commit message.

@matthiasblaesing
Copy link
Copy Markdown
Contributor

Thanks

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