Giter VIP home page Giter VIP logo

ebr's Introduction

Build Status

Eclipse Orbit's EBR maven plug-ins

This repositories hosts maven plug-ins for building OSGi bundles from Java Maven artifacts. Please see the main Eclipse Orbit pages for additional information.

How the Maven plug-in works

  1. Direct dependencies are collected an unzipped.
  2. Direct dependencies are then merged with the output produced already by the Maven module, i.e. any content in src/main/resources or even source code compiled before from src/main/java will take precedence over stuff coming from dependencies.
  3. OSGi manifest is generated (via Apache Felix Maven Bundle plug-in).
    • Bundle-SymbolicName is assumed to be the artifact id (This is an important assumption made throughout the plug-in which can't be changed!)
    • Instructions for BND can be specified via module POM and overwrite any default behavior described below
    • The bundle version is inherited from the project version. In case the project version ends with "-SNAPSHOT" it will be replaced with ".qualifier". Tycho's qualifier expansion is supported. Thus, if Tycho computed a proper build qualifier then this one will be used as the qualifier replacement.
    • The Bundle-Name is inherited from the Maven project name.
    • The Bundle-Description is inherited from the Maven project description.
  4. Final bundle jar is produced.
  5. Source code for dependencies is collected (via sources classifier).
  6. OSGi manifest for source bundle is generated together with OSGI-INF/l10n/bundle.properties for localizable-ready content (Keys are bundleName and bundleVendor; inherited from main OSGi manifest generated before.)
  7. Final source bundle jar is produced.
  8. p2 metadata is generated (via Tycho p2 plug-in).

History

Eclipse Bundle Recipes (EBR) used to be an independent project and included contibuted recipes as well as the Maven plug-ins. In early 2023 the EBR project was restructured and the Maven plug-ins were moved to the Eclipse Orbit project and the rest of the project was archived. See this email thread for more details that led to this change.

ebr's People

Contributors

akurtakov avatar briandealwis avatar cdietrich avatar erwindl0 avatar guw avatar irbull avatar jonahgraham avatar mailaender avatar nikhilnanivadekar avatar rgrunber avatar turesheim avatar vidyadharv avatar violetagg avatar vorburger avatar zulus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ebr's Issues

NoSuchMethodError during p2 repository generation

~/ebr/releng/p2$ mvn clean package
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for MY_EBR_BUNDLES_GROUP:org.eclipse.ebr.releng.feature.aggregation:eclipse-feature:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.eclipse.tycho.extras:tycho-source-feature-plugin is missing. @ line 21, column 15
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
---------------------------------------------------
constituent[0]: file:/usr/share/maven/conf/logging/
constituent[1]: file:/usr/share/maven/lib/maven-slf4j-provider-3.x.jar
constituent[2]: file:/usr/share/maven/lib/maven-settings-builder-3.x.jar
constituent[3]: file:/usr/share/maven/lib/sisu-inject.jar
constituent[4]: file:/usr/share/maven/lib/maven-resolver-provider-3.x.jar
constituent[5]: file:/usr/share/maven/lib/plexus-sec-dispatcher.jar
constituent[6]: file:/usr/share/maven/lib/maven-repository-metadata-3.x.jar
constituent[7]: file:/usr/share/maven/lib/javax.inject.jar
constituent[8]: file:/usr/share/maven/lib/maven-resolver-connector-basic.jar
constituent[9]: file:/usr/share/maven/lib/maven-plugin-api-3.x.jar
constituent[10]: file:/usr/share/maven/lib/aopalliance.jar
constituent[11]: file:/usr/share/maven/lib/maven-resolver-spi.jar
constituent[12]: file:/usr/share/maven/lib/maven-artifact-3.x.jar
constituent[13]: file:/usr/share/maven/lib/plexus-cipher.jar
constituent[14]: file:/usr/share/maven/lib/maven-embedder-3.x.jar
constituent[15]: file:/usr/share/maven/lib/jcl-over-slf4j.jar
constituent[16]: file:/usr/share/maven/lib/commons-cli.jar
constituent[17]: file:/usr/share/maven/lib/sisu-plexus.jar
constituent[18]: file:/usr/share/maven/lib/maven-settings-3.x.jar
constituent[19]: file:/usr/share/maven/lib/cdi-api.jar
constituent[20]: file:/usr/share/maven/lib/maven-resolver-transport-wagon.jar
constituent[21]: file:/usr/share/maven/lib/maven-core-3.x.jar
constituent[22]: file:/usr/share/maven/lib/maven-compat-3.x.jar
constituent[23]: file:/usr/share/maven/lib/slf4j-api.jar
constituent[24]: file:/usr/share/maven/lib/jansi.jar
constituent[25]: file:/usr/share/maven/lib/maven-resolver-api.jar
constituent[26]: file:/usr/share/maven/lib/maven-model-builder-3.x.jar
constituent[27]: file:/usr/share/maven/lib/maven-builder-support-3.x.jar
constituent[28]: file:/usr/share/maven/lib/plexus-component-annotations.jar
constituent[29]: file:/usr/share/maven/lib/wagon-file.jar
constituent[30]: file:/usr/share/maven/lib/maven-model-3.x.jar
constituent[31]: file:/usr/share/maven/lib/wagon-provider-api.jar
constituent[32]: file:/usr/share/maven/lib/maven-resolver-util.jar
constituent[33]: file:/usr/share/maven/lib/commons-io.jar
constituent[34]: file:/usr/share/maven/lib/jsr250-api.jar
constituent[35]: file:/usr/share/maven/lib/guava.jar
constituent[36]: file:/usr/share/maven/lib/plexus-interpolation.jar
constituent[37]: file:/usr/share/maven/lib/plexus-utils.jar
constituent[38]: file:/usr/share/maven/lib/maven-resolver-impl.jar
constituent[39]: file:/usr/share/maven/lib/wagon-http-shaded.jar
constituent[40]: file:/usr/share/maven/lib/guice.jar
constituent[41]: file:/usr/share/maven/lib/maven-shared-utils.jar
constituent[42]: file:/usr/share/maven/lib/commons-lang3.jar
---------------------------------------------------
Exception in thread "main" java.lang.NoSuchMethodError: 'org.eclipse.tycho.IDependencyMetadata org.eclipse.tycho.p2.metadata.DependencyMetadataGenerator.generateMetadata(org.eclipse.tycho.p2.metadata.IArtifactFacade, java.util.List, org.eclipse.tycho.core.resolver.shared.OptionalResolutionAction, org.eclipse.tycho.p2.metadata.PublisherOptions)'
        at org.eclipse.tycho.extras.sourcefeature.SourceFeatureP2MetadataProvider.getDependencyMetadata(SourceFeatureP2MetadataProvider.java:112)
        at org.eclipse.tycho.p2.resolver.P2DependencyResolver$1.run(P2DependencyResolver.java:160)
        at org.eclipse.tycho.core.maven.utils.PluginRealmHelper.execute(PluginRealmHelper.java:122)
        at org.eclipse.tycho.p2.resolver.P2DependencyResolver.getDependencyMetadata(P2DependencyResolver.java:155)
        at org.eclipse.tycho.p2.resolver.P2DependencyResolver.setupProjects(P2DependencyResolver.java:133)
        at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:97)
        at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:90)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:264)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Exception in thread "Timer-0" java.lang.NoClassDefFoundError: org/eclipse/osgi/internal/messages/Msg
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.setProperties(ServiceRegistrationImpl.java:162)
        at org.apache.felix.scr.impl.ComponentRegistry$4.run(ComponentRegistry.java:743)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: java.lang.ClassNotFoundException: org.eclipse.osgi.internal.messages.Msg
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
        ... 4 more

Support java 15+

current error:

[INFO] Generating OSGi MANIFEST.MF
[ERROR] An internal error occurred
java.util.ConcurrentModificationException
    at java.util.TreeMap.callMappingFunctionWithCheck (TreeMap.java:742)
    at java.util.TreeMap.computeIfAbsent (TreeMap.java:596)
    at aQute.bnd.osgi.Jar.putResource (Jar.java:288)
    at aQute.bnd.osgi.Jar$1.visitFile (Jar.java:202)
    at aQute.bnd.osgi.Jar$1.visitFile (Jar.java:177)
    at java.nio.file.Files.walkFileTree (Files.java:2804)
    at aQute.bnd.osgi.Jar.buildFromDirectory (Jar.java:176)
    at aQute.bnd.osgi.Jar.<init> (Jar.java:119)
    at aQute.bnd.osgi.Jar.<init> (Jar.java:172)
    at org.apache.felix.bundleplugin.BundlePlugin.getOSGiBuilder (BundlePlugin.java:604)
    at org.apache.felix.bundleplugin.ManifestPlugin.getAnalyzer (ManifestPlugin.java:285)
    at org.apache.felix.bundleplugin.ManifestPlugin.execute (ManifestPlugin.java:111)
    at org.eclipse.ebr.maven.BundleMojo.buildBundle (BundleMojo.java:358)
    at org.eclipse.ebr.maven.BundleMojo.execute (BundleMojo.java:462)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

previous attempt here #40 which was finally reverted #44

EBR 1.3.0-SNAPSHOT causing build failures in Eclipse Collections

Error message from GitHub action logs - https://github.com/eclipse/eclipse-collections/runs/4016216089?check_suite_focus=true

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution null of goal org.eclipse.ebr:ebr-tycho-extras-plugin:1.3.0-SNAPSHOT:assemble-bundle-p2-repository failed: An API incompatibility was encountered while executing org.eclipse.ebr:ebr-tycho-extras-plugin:1.3.0-SNAPSHOT:assemble-bundle-p2-repository: java.lang.NoSuchMethodError: 'void org.eclipse.tycho.core.ee.ExecutionEnvironmentConfigurationImpl.<init>(org.codehaus.plexus.logging.Logger, boolean, org.apache.maven.toolchain.ToolchainManager, org.apache.maven.execution.MavenSession)'

This seems to be the same issue we faced a year ago, details captured here. We would like your help with the next steps in resolving this issue. Let us know if you have any other questions.

Tagging @nikhilnanivadekar and @donraab from Eclipse Collections.

ebr-maven-plugin should have capability to reuse all artifact OSGi metadata

This would be a pretty specific use case but for bundle recipes that package a single artifact that happens to have OSGi metadata already present where the user would just like to use it, it would be nice to have an option to skip regenerating attributes and just use it as-is.

The most intuitive way to do this would by having this behaviour when the osgi.bnd file is missing. Entry point for code would probably be in BundleMojo#buildBundle @ "Generating OSGi MANIFEST.MF" .

Porting the ebr-bundle plugin to tycho?

I wonder if it would be a good idea to port the ebr-bundle-plugin to tycho (there are already some additional tools mojos in tycho-extras).

I would see the following benefits:

  1. user do not need to build the plugin itself before starting to use ebr
  2. because its integrated in the usual release cycle no incompatibilities with newer tycho version (or at least they will be discovered very early)
  3. tighter integration possible, currently its a two-step-process we should check how this can be integrated more smooth to make this work in one go.

Tycho version support

I wanted to update Tycho version used by Eclipse Orbit in the hope it may just solve removing packed jars, but when I do update to tycho 2.2.0, the EBR plugins stop working with this error:

ERROR] Failed to execute goal org.eclipse.ebr:ebr-maven-plugin:1.3.0-SNAPSHOT:bundle (default-bundle) on project org.antlr.runtime: Unable to execute mojo: Execution null of goal org.eclipse.ebr:ebr-tycho-extras-plugin:1.3.0-SNAPSHOT:assemble-bundle-p2-repository failed: An API incompatibility was encountered while executing org.eclipse.ebr:ebr-tycho-extras-plugin:1.3.0-SNAPSHOT:assemble-bundle-p2-repository: java.lang.NoSuchMethodError: 'org.eclipse.tycho.BuildOutputDirectory org.eclipse.tycho.plugins.p2.repository.AbstractRepositoryMojo.getBuildDirectory()'
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.eclipse.ebr:ebr-tycho-extras-plugin:1.3.0-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/jonah/.m2/repository/org/eclipse/ebr/ebr-tycho-extras-plugin/1.3.0-SNAPSHOT/ebr-tycho-extras-plugin-1.3.0-SNAPSHOT.jar
[ERROR] urls[1] = file:/home/jonah/.m2/repository/org/eclipse/ebr/ebr-maven-shared/1.3.0-SNAPSHOT/ebr-maven-shared-1.3.0-SNAPSHOT.jar
[ERROR] urls[2] = file:/home/jonah/.m2/repository/org/apache/commons/commons-lang3/3.10/commons-lang3-3.10.jar
[ERROR] urls[3] = file:/home/jonah/.m2/repository/org/apache/commons/commons-text/1.8/commons-text-1.8.jar
[ERROR] urls[4] = file:/home/jonah/.m2/repository/commons-io/commons-io/2.7/commons-io-2.7.jar
[ERROR] urls[5] = file:/home/jonah/.m2/repository/org/eclipse/tycho/tycho-p2-repository-plugin/1.7.0/tycho-p2-repository-plugin-1.7.0.jar
[ERROR] urls[6] = file:/home/jonah/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[7] = file:/home/jonah/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar
[ERROR] urls[8] = file:/home/jonah/.m2/repository/org/codehaus/plexus/plexus-archiver/4.2.2/plexus-archiver-4.2.2.jar
[ERROR] urls[9] = file:/home/jonah/.m2/repository/org/codehaus/plexus/plexus-io/3.2.0/plexus-io-3.2.0.jar
[ERROR] urls[10] = file:/home/jonah/.m2/repository/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar
[ERROR] urls[11] = file:/home/jonah/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[12] = file:/home/jonah/.m2/repository/org/tukaani/xz/1.8/xz-1.8.jar
[ERROR] urls[13] = file:/home/jonah/.m2/repository/org/eclipse/platform/org.eclipse.osgi.compatibility.state/1.1.700/org.eclipse.osgi.compatibility.state-1.1.700.jar
[ERROR] urls[14] = file:/home/jonah/.m2/repository/org/eclipse/platform/org.eclipse.osgi/3.15.200/org.eclipse.osgi-3.15.200.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>org.eclipse.orbit.bundles:orbit-recipes:1.0.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.