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 192566 - support for maven tycho projects
Summary: support for maven tycho projects
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-27 11:54 UTC by Milos Kleint
Modified: 2012-10-23 19:48 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Kleint 2010-11-27 11:54:01 UTC
just an enhancement request, not sure if reasonably implementable though.

the eclipse tycho is a set of maven plugins for building eclipse plugins. it defines it's own packaging etc. So far so good. but it also dynamically creates maven dependencies during the build from the eclipse' META-INF/manifest.mf file. That means that in netbeans these projects load (since 7.0) but are all red and cannot be worked with.
as an example see https://github.com/sonatype/m2eclipse-core

It would be nice to be able to have an option or similar that would tell the netbeans project support to execute the validate phase on top of loading the project. It will be painfully slow (as the resolution of dependencies using p2 is slow but at least would load correct afterwards (I suppose)
Comment 1 Jesse Glick 2010-11-29 20:59:11 UTC
I doubt I have the expertise to implement this. From a quick look at m2eclipse-core, it seems that these are pretty different from regular Maven projects. I started to try to build them, but just gave up after downloading tons of stuff in ~/.m2/repository/p2/.

Presumably you could have some check for packaging eclipse-plugin (also eclipse-test-plugin?) that would run the validate phase during online project load.
Comment 2 Milos Kleint 2010-11-30 07:03:52 UTC
(In reply to comment #1)
> I doubt I have the expertise to implement this. From a quick look at
> m2eclipse-core, it seems that these are pretty different from regular Maven
> projects. I started to try to build them, but just gave up after downloading
> tons of stuff in ~/.m2/repository/p2/.

Igor would disagree but yes, these are pretty much deviated from the regular maven projects. Unlike most others it's not purely declarative and indeed injects stuff at the validate phase. not sure if it's tycho or p2 fault but it also does a pretty bad job at caching. So if you try building the project again, it will download a bunch of stuff again. It's not an issue in eclipse as PDE takes over and manages the dependencies from manifest but I assume it could hit netbeans as project reloading is relatively common and relies on being fast.

> 
> Presumably you could have some check for packaging eclipse-plugin (also
> eclipse-test-plugin?) that would run the validate phase during online project
> load.

That's the only workaround that I could think of. The critical path here is how often the project is reloaded (it used to be reloaded after maven builds for example)..
Comment 3 Jesse Glick 2010-11-30 17:44:04 UTC
(In reply to comment #2)
> not sure if it's tycho or p2 fault but it
> also does a pretty bad job at caching. [...] it could
> hit netbeans as project reloading is relatively common and relies on being
> fast.

Right, it may be necessary to fix caching "upstream" before this becomes practical.

> The critical path here is how often the project is reloaded

Frequently enough that it needs to be fairly fast. Checking for artifacts in ~/.m2/repository/ is OK, but no more.

Another issue is security. Currently the embedder will never execute any goals unless you actually run a build. The same is true for Ant-based projects, and it means that you need not fear "trojan horses" in the build script just from _opening_ a project. If we run the validate phase during load - even if this is done only for limited packagings - then we need to ensure that if the POM contains some goal bound to validate which uses e.g. maven-antrun-plugin that it is skipped or crippled. This might be feasible by only running goals from a small whitelist of plugins known to do benign things during this phase, or perhaps by creating a sandbox ClassRealm for plugins from the embedder.
Comment 4 Jesse Glick 2011-10-31 17:46:53 UTC
Have not heard any requests for this. All users of Tycho I can find are building Eclipse RCP apps and are unlikely to be using NB for development.
Comment 5 everflux 2012-09-07 10:20:00 UTC
Just for the record: Building a tycho based project (using tycho-maven-plugin ) works in Netbeans in general (Netbeans calls maven, so no surprise here). Dependency resolution does not work in the IDE, so many red flags and errors.
At least all builds (even projects depending on the tycho project) work well, this sets Netbeans above IntelliJ at the moment :)
The only way to really develop tycho/eclipse modules is using Eclipse at the moment, which should be fine for the mainstream user base.
Comment 6 gbivins 2012-10-23 19:48:31 UTC
I'm not sure of how useful my "nice to have" is for this feature but it sure would be handy right now. There is an existing Eclipse RCP application that we'd like to integrate with and I had the idea, since it is a maven project, that we could create a NBP app to pull in our NBM's and the tycho generated artifcacts in as well and see how things behave. If successful, it could be used as demonstrating that NBP as the main platform. Currently we are having to move existing swing applications to Eclipse RCP due to what I like to call "legacy justification'.