This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 198951 - Better handling of upstream projects using process-classes
Summary: Better handling of upstream projects using process-classes
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Stupka
URL: http://jira.codehaus.org/browse/MEVEN...
Keywords:
Depends on: 128695
Blocks:
  Show dependency tree
 
Reported: 2011-05-27 12:58 UTC by Jesse Glick
Modified: 2016-07-07 08:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-05-27 12:58:54 UTC
In case there are some process-classes actions in module m1, and module m2 has a dep on m1, including m1/src/main/java as the SFBQ result for m2 may be wrong - the bytecode post-processing might have changed signatures in m1/target/classes.

Currently worked around with a system property mevenide.projectLinksDisable, which disables interproject SFBQ, but this is a hack and takes effect globally. Better to automatically enable this mode just when some goals in process-classes are detected.

Also better to use Result2 with !preferSources in this case, so we can still jump to sources for reference, but the parser will not consider them authoritative.
Comment 1 Milos Kleint 2012-05-09 13:32:45 UTC
do we have examples of maven plugins that do this sort of thing? 

AOP I guess.


quick google search reveals:

http://openjpa.apache.org/enhancement-with-maven.html
http://mojo.codehaus.org/rmic-maven-plugin/
http://jour.sourceforge.net/jour-maven-plugin/

in general this is very,very rare based on how frequently we get a bug report about it.
Comment 2 Jesse Glick 2012-05-09 19:25:03 UTC
(In reply to comment #1)
> do we have examples of maven plugins that do this sort of thing? 

Well "static weaving/bytecode generation" in the original report.

The question is whether there is a straightforward way (i.e. without needing to enumerate specific plugins) to determine if the upstream project binds any goals to the process-classes (*) phase - whether explicitly in its POM mentioning that phase, explicitly mentioning a plugin goal which binds by default to that phase, or implicitly due to the default lifecycle mappings for the project's packaging. If so, a ForeignClassBundler impl can say no for preferSources.

(*) Or process-test-classes, in the case of a dependency on an artifact with classifier=tests.
Comment 3 Milos Kleint 2012-10-11 08:42:18 UTC
https://www.google.com/#q=%22Binds+by+default+to+the+lifecycle+phase%3A+process-classes%22

shows possibly all plugins binding to the process-classes phase. It's not immediately obvious if these should always !preferSources.
Comment 4 Jesse Glick 2012-10-11 22:07:02 UTC
It depends on whether the mojo is affecting the public signature of m1 or at least that part m2 is expected to use. If you are just injecting AOP logging or something, then no.
Comment 5 Milos Kleint 2012-10-12 06:03:16 UTC
I suppose this issue is sort of duplicate of issue 208411 or at least both boil down to the same solution. What's unclear is just the UI (if any) should be to switch the source preference on and off. The simpler ui would be to add action on the dependency popup. However the discoverability of that would be fairly poor.
Comment 6 Jesse Glick 2012-10-12 18:37:27 UTC
An action in the dependency popup also has no obvious UI for reversal if you change your mind.
Comment 7 Milos Kleint 2013-02-21 13:09:38 UTC
(In reply to comment #6)
> An action in the dependency popup also has no obvious UI for reversal if you
> change your mind.

yeah, we would have to make the state of link suppression obvious on the dependency's node label and/or icon
Comment 8 Milos Kleint 2013-03-08 15:55:35 UTC
we currently link dependencies with classifier ut always with !preferSources
Comment 9 Martin Balin 2016-07-07 08:37:55 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss