Bug 191864 - Improved NetBeans Maven's "Sources" flexibility
Improved NetBeans Maven's "Sources" flexibility
Status: RESOLVED WONTFIX
Product: projects
Classification: Unclassified
Component: Maven
6.x
All All
: P3 (vote)
: 7.3
Assigned To: Milos Kleint
issues@projects
: PLAN
: 203585 (view as bug list)
Depends on: 198650 170700 187595 189134
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-11 16:27 UTC by dhcavalcanti
Modified: 2012-08-03 06:57 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dhcavalcanti 2010-11-11 16:27:48 UTC

    
Comment 1 dhcavalcanti 2010-11-11 16:35:51 UTC
Currently, the only way to "add" generated sources to a NetBeans maven project is to have maven generate these sources into the ${basedir}/target/generated-sources/FOOBAR folder, where FOOBAR is typically the name of the plugin. This comes directly from the NetBeans project's "Project Properties" window.

However, it's not always possible to have the generated source code in this directories. For example, where I work, the IDE of choice is Eclipse, but I prefer NetBeans. The projects are Maven based. One of our projects is a web-service (contract first), where we generate the JAX-WS classes from the WSDL files. The pom.xml configured for this project places the generated source code in the ${basedir}/target/generated directory. From Eclipse, we can (explicitly) add that folder as source. I can't do that from NetBeans. Instead, I must modify the pom.xml file locally (which is under version control, so I can't really commit/submit those changes) to make it conform to what NetBeans expects.

Instead, a great improvement would be to have NetBeans allow us to choose folders that contain "generated sources" as opposed to expect these sources to be in a particular directory. That would be awesome because then developers can choose their preferred IDE. Those who like Eclipse can stick with it, and those who like NetBeans can stay with it.
Comment 2 Jesse Glick 2010-11-11 16:54:20 UTC
Best would be to commit the edit to the pom.xml to use ${basedir}/target/generated-sources/jaxws or similar; using ${basedir}/target/generated is nonstandard and also open to conflict between plugins.

That said, the IDE ought to look for the source output dirs of well-known plugins; see some related issues. (Manual configuration is to be avoided, especially since it requires IDE-specific metadata.) What is your actual plugin configuration?
Comment 3 Jesse Glick 2011-10-12 22:47:11 UTC
*** Bug 203585 has been marked as a duplicate of this bug. ***
Comment 4 Jesse Glick 2011-10-29 01:36:06 UTC
*** Bug 203585 has been marked as a duplicate of this bug. ***
Comment 5 Milos Kleint 2012-02-17 12:07:14 UTC
(In reply to comment #2)
> 
> That said, the IDE ought to look for the source output dirs of well-known
> plugins; see some related issues. (Manual configuration is to be avoided,
> especially since it requires IDE-specific metadata.) What is your actual plugin
> configuration?

the major problem there is the definition of "well-known". Until there is some generally accepted maven api to declaratively query the generated source roots, we don't have any solution to custom locations that scales well for every plugin out there. But in a sense the problem will remain the same, the various maven plugins need to adhere to the api, like they should adhere to the current convention. A few years back I did go out and filed issues and created patches for a lot of plugins..

adding build-helper:add-source configuration to your pom would help as well, but there again we face your organizational problem of having to modify the pom file. What is actually the reason for not being able to modify the pom? that eclipse people would have to manually modify the source root once changed?
Comment 6 Jesse Glick 2012-02-20 20:23:07 UTC
(In reply to comment #5)
> the major problem there is the definition of "well-known"

Just those plugins for which we have received bug reports, I guess.
Comment 7 Milos Kleint 2012-02-24 07:51:53 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > the major problem there is the definition of "well-known"
> 
> Just those plugins for which we have received bug reports, I guess.

that doesn't scale really well, just by running a few on well knows projects like glassfish, some apache stuff, hudson etc. you arrive at pretty much a big list. Additionally there is the problem with multiple versions (one would have to check not only the latest version of the plugin and verify the parameter has not been not changed).

Please note that m2e (the eclipse integration for maven) has a such a non-scaling solution in place, they require an eclipse plugin for each maven plugin to handle the CP and in-IDE building of the project. That's been the major source of complaints from users ever since. 

OTOH changing the default generated source location on the maven plugin side is a trivial change to make and is backward compatible. A few years back for every report on missing generated sources, I've filed an issue with the maven plugin and the problem was fixed for most of the plugins. I suggest we do the same with jaxws. And in the meantime, the scalable workaround is to change the folder in the pom.

Reporter, please what is the plugin you are using? and what is the goal and parameter name? just wildly googling for jaxws got me here [1] but it all seems to have the right default values.

IMHO, this is a wontfix issue on our side after we or the reported files an issue against the plugin affected.

[1] http://jax-ws-commons.java.net/jaxws-maven-plugin/
Comment 8 Milos Kleint 2012-08-03 06:57:32 UTC
considered resolved as "won't fix". the current strategy of observing well defined locations like target/generated-sources/XXX is scalable and working.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo