Skip to content

Conversation

@pepness
Copy link
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
      • 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 2025-02-10 15-19-29

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


public static final String MAVEN_PLUGINS_GROUP_ID = "org.apache.maven.plugins"; //NOI18N
public static final String WAR_PLUGIN_ARTIFACT_ID = "maven-war-plugin"; //NOI18N
public static final String WAR_PLUGIN_VERSION = "2.3.4"; //NOI18N
Copy link
Contributor

Choose a reason for hiding this comment

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

I would bump to 3.4.0 if there is not a very good reason to stay on the old version. I remember that I bumped several projects to a 3.X version as 2.X failed when used with JDK 21+

*/
public final class MavenModelUtils {

private static Profile profile;
Copy link
Contributor

Choose a reason for hiding this comment

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

This will become a problem. If you have one maven project with JakartaEE and one with JavaEE open, both will use the same profile. You will need to pass the "isJakarta" property (or the profile) from the external entry points, to decide per call.

A passing question: is it save to assume this is only called for JavaEE/JakarataEE projects? If it is called for JavaSE projects, there will be no profile.

pepness added 20 commits June 18, 2025 15:28
 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
Remove subtypes from @ProjectServiceProvider
 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 subtypes from @ProjectServiceProvider
-Use psf LOGGER
-
-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.
-Add support for Car and Jar projects to isJakartaEENameSpace()
-Add method getSourceLevel()
-Pattern Matching for instanceof
-Switch Expressions
-Add useful variable for debugging
-Remove unused imports
Use try-with-resources
@mbien mbien added the Maven [ci] enable "build tools" tests label Jun 20, 2025
Copy link
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)

-Remove the redundant Xpp3Dom variable
-close all wrapped streams in try-with-resources with 'bw'
@ebarboni ebarboni modified the milestones: NB27, NB28 Jul 23, 2025
@matthiasblaesing
Copy link
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
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