Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Transforming class files in an M2E extension

I recommend you figure out how to represent projects with generated
classes in workspace first. You don't really need m2e or custom builder
to investigate how to make one java projects "see" .class files in
another project. Then you can decide how's the best to implement this.

As for dependencies from Tycho projects to artifacts available from
Maven repositories, have a look at [1] how you can "wrap" thirdparty
dependencies in OSGi bundles. You can use m2e embedded maven runtime for
working example of this technique.

[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts

--
Regards,
Igor

On 1/23/2014, 6:52, Emond Papegaaij wrote:
The problem is that even with BuildContext, types are still not resolved
correctly. Even though the source compiles and runs fine, the editor
does not know about any types, breaking things like organize imports and
type completion and underlining almost everything with errors. Also, I
think a builder should integrate much better with eclipse than the m2e
execute mapping.

However, I'm stuck with writing my builder on a very simple problem: how
do I add a dependency in a tycho project? I need javassist. The maven
artifact for version 3.18.1-GA is a valid osgi bundle, but I just can't
find a way to add it as a dependency. Eclipse keeps flagging the line in
my MANIFEST.MF as error.

Best regards,

Emond Papegaaij

On Wednesday 22 January 2014 15:48:21 Igor Fedorenko wrote:

 > I think BuildContext API is all you need, m2e incremental builder will

 > take care of all plugin dependency resolution, classpath setup, mojo

 > configuration and other plumbing.

 >

 > --

 > Regards,

 > Igor

 >

 > On 1/22/2014, 15:44, Emond Papegaaij wrote:

 > > I agree. After reading some more about Eclipse internals, I think an

 > > incremental project builder suits this usecase better. Currently, I've

 > > created a project configurator that adds the builder and written some

 > > code in the builder to resolve the maven plugin. It should not be too

 > > difficult to read the plugin configuration and transform the classes.

 > > However, I do have one question: how do I load the plugin dependencies

 > > (e.g. the transformer implementation). This class is not on the

 > > classpath in the plugin. Should I setup a new classloader with this

 > > additional maven artifact jar? If so, is there an existing
classloader I

 > > can use? How does m2e solve this? It also needs to load additional

 > > classes from external jars.

 > >

 > > Best regards,

 > > Emond Papegaaij



_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top