Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Eclipse support for tycho-compiler-plugin: extraClasspathElements

On Thu, Aug 1, 2013 at 4:29 PM, Sievers, Jan <jan.sievers@xxxxxxx> wrote:
> also see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=392764
>
> Looks like there is way to use maven-scr-plugin with standard  annotations:
> http://apache-felix.18485.x6.nabble.com/maven-bundle-BND-plugin-support-for-OSGi-R4-3-SCR-annotations-org-osgi-service-component-annotations-td5000226.html#a5000242

Actually there, is see below...

>
> The standard OSGi DS annotations are provided by bundle org.eclipse.osgi.services and are part of e.g. the eclipse Kepler p2 repo.
> So if you have an Import-Package dependency on org.osgi.service.component.annotations, it should resolve fine against Kepler.

Thanks for the info! I managed to make the build work with a little
config tweaking using the maven-scr-plugin and
org.osgi.service.component.annotations. Briefly, I configured the
maven-scr-plugin to

- be active for the 'eclipse-plugin' packaging type
- depend on  the annotation parser for the standard DS annotations (
also provided by the Apache Felix project )
- depend on a Maven artifact containing these annotations ( in my case
org.osgi.compendium )
- output its descriptors in the root directory, to get the generated
descriptors in OSGI-INF/*.xml

The last point is the one I'm not happy about, but if I generate them
in /target/scr-plugin-generated/OSGI-INF, per the Maven conventions, I
can't get the descriptors to resolve at runtime.

>
> If you solve it, would be nice if you can comment here or on the bug above.

I'll post a more detailed description in the bug report early next week.

Robert

>
> Regards
> Jan
>
> -----Original Message-----
> From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Robert Munteanu
> Sent: Donnerstag, 1. August 2013 11:19
> To: Tycho user list
> Subject: [tycho-user] Eclipse support for tycho-compiler-plugin: extraClasspathElements
>
> Hi,
>
> I'm trying to combine a tycho build with the maven-scr-plugin. The
> maven-scr-plugin allows me to annotate classes and then generates SCR
> descriptors for them automatically, rather than me having to maintain
> them manually.
>
> This also requires the org.apache.felix.scr.annotations jar to be part
> of the classpath. Given that this jar is not a bundle and not present
> in a p2 repository, it seemed like a roadblock. Courtesy of
> StackOverflow [1] I was able to get the tycho build working, by
>
> - using the tycho-compiler-plugin: extraClasspathElements
> configuration option to add the annotations jar to the class path
> - binding the maven-scr-plugin to the compile phase
> - using the tycho-packaging-plugin to include the generated
> descriptors in the final jar
>
> The only blocker that I have is that inside Eclipse the annotations
> are not added to the classpath and therefore Eclipse generates
> compiler errors.
>
> How can I convince Eclipse/the tycho m2e configurator to add jars from
> the extraClassPathElements to the project's classpath?
>
> Thanks,
>
> Robert
>
> [1]: http://stackoverflow.com/questions/17835007/using-annotations-from-a-library-which-is-not-a-bundle-in-a-tycho-build
>
> --
> http://robert.muntea.nu/
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-user
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-user



-- 
http://robert.muntea.nu/


Back to the top