Quantcast
Channel: tycho-user
Viewing all articles
Browse latest Browse all 4647

Re: [tycho-user] How to extend tycho-osgi-runtime via TychoOsgiRuntimeArtifacts?

$
0
0
Hello Jan,

thanks for your answers.Â

I followed your advices/suggestions and get the following outcome:

====================== CUT HERE =======================

1) No implementation for org.apache.maven.plugin.LegacySupport was bound.
 while locating org.eclipse.tycho.core.osgitools.BuildPropertiesParserImpl
 at ClassRealm[coreExtension>mygroupid:my-artifact:1.0.0-SNAPSHOT, parent: ClassRealm[plexus.core, parent: null]] (via modules: org.eclipse.sisu.wire.Wire
Module -> org.eclipse.sisu.plexus.PlexusBindingModule)
 at ClassRealm[coreExtension>mygroupid:my-artifact:1.0.0-SNAPSHOT, parent: ClassRealm[plexus.core, parent: null]] (via modules: org.eclipse.sisu.wire.Wire
Module -> org.eclipse.sisu.plexus.PlexusBindingModule)
 while locating org.eclipse.tycho.core.shared.BuildPropertiesParser
 while locating org.eclipse.tycho.core.osgitools.OsgiBundleProject
 at ClassRealm[coreExtension>mygroupid:my-artifact:1.0.0-SNAPSHOT, parent: ClassRealm[plexus.core, parent: null]] (via modules: org.eclipse.sisu.wire.Wire
Module -> org.eclipse.sisu.plexus.PlexusBindingModule)
 at ClassRealm[coreExtension>mygroupid:my-artifact:tycho-mvnurl:1.0.0-SNAPSHOT, parent: ClassRealm[plexus.core, parent: null]] (via modules: org.eclipse.sisu.wire.Wire
Module -> org.eclipse.sisu.plexus.PlexusBindingModule)
 while locating org.eclipse.tycho.core.TychoProject annotated with @com.google.inject.name.Named(value=eclipse-plugin)

1 error
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
    at java.util.AbstractMap.get(AbstractMap.java:187)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:62)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:90)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:267)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    ... 11 more


====================== CUT HERE =======================

It seems my maven core extension (now registered via .mvn/extensions.xml) triggers a whole lot of other components.
Obviously my extension has a dependency to org.eclipse.tycho:tycho-core, but for only one class.

Does this help?
Maybe I can setup a sample project, but this will take some time.

Thanks in advance,
Marco


2017-10-17 8:54 GMT+02:00 Sievers, Jan <jan.sievers@xxxxxxx>:
another thing is to make sure the plexus descriptors are generated, like in

https://github.com/eclipse/tycho/blob/5951a62696123bff26cead593ca54d7b124a70e6/pom.xml#L365-L377

otherwise dependency injection will not happen

Regards
Jan

On 17.10.17, 08:46, "tycho-user-bounces@eclipse.org on behalf of Sievers, Jan" <tycho-user-bounces@eclipse.org on behalf of jan.sievers@xxxxxxx> wrote:

  Looks like the OSGi runtime should be extensible but I never tried this.

  You may have to add it as a maven core build extension so the classloader sees it, i.e.

  <extensions>true</extensions>

  similar to tycho itself, see [1].


  this where you would have to start debugging (mvnDebug):

  https://github.com/eclipse/tycho/blob/master/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java#L122

  Regards
  Jan


  [1] https://github.com/eclipse/tycho-demo/blob/7f78a458a4b368472995610a338ac5e68c2b7709/itp01/pom.xml#L31

  On 16.10.17, 23:43, "tycho-user-bounces@eclipse.org on behalf of Marco Lehmann-MÃrz" <tycho-user-bounces@eclipse.org on behalf of mlehmannm@xxxxxxxxx> wrote:

    Hello everybody,


    I want tycho to include my osgi-bundle into its runtime. (It registers a custom url via org.osgi.service.url.URLStreamHandlerService.)
    It does not work.


    What a tried so far:


    1. I wrote the osgi bundle that provides the service (BTW: build with tycho).

    2. I wrote a maven extension that exports a plexus component with role TychoOsgiRuntimeArtifacts and hint mycustomurl.

    3. I registered the extension in the parent pom of another tycho build where I want tycho to use my custom url in p2 repository loading.


    The extension is never loaded. Any ideas?


    --
    Tschà Marco











  _______________________________________________
  tycho-user mailing list
  tycho-user@xxxxxxxxxxx
  To change your delivery options, retrieve your password, or unsubscribe from this list, visit
  https://dev.eclipse.org/mailman/listinfo/tycho-user

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user



--
Tschà Marco

Viewing all articles
Browse latest Browse all 4647

Latest Images

Trending Articles



Latest Images