Coder Social home page Coder Social logo

Publish as OSGi bundle about config HOT 23 CLOSED

lightbend avatar lightbend commented on July 24, 2024
Publish as OSGi bundle

from config.

Comments (23)

hseeberger avatar hseeberger commented on July 24, 2024

I can add OSGi support using the sbtosgi plugin a little later ...

from config.

havocp avatar havocp commented on July 24, 2024

I don't know how to do this or how to test it so help would be very welcome :-)

from config.

havocp avatar havocp commented on July 24, 2024

I don't know how to do this or how to test it so help would be very welcome :-)

from config.

 avatar commented on July 24, 2024

well, I do not use sbt :-)

I can show how to produce a bundle
by means of converting your project to a maven project and then with help of
http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

I will be able to test your bundle with help of
http://team.ops4j.org/wiki/display/paxexam/Pax+Exam

from config.

hseeberger avatar hseeberger commented on July 24, 2024

You should consider using sbt, though. I promise you never want to go back to Maven.

Anyway, sit back and relax. I have it almost working. Give me some more time, please, beuse it's weekend and my birthday.

from config.

 avatar commented on July 24, 2024

re: consider sbt

  • only if you make sbt2e as transparent as m2e and it comes standard in eclipse :-)

re: sit back and relax

  • no rush; thank you!

from config.

hseeberger avatar hseeberger commented on July 24, 2024

The necessary changes to the sbt build are in place. Havoc, could you please publish a snapshot release?

from config.

 avatar commented on July 24, 2024

thank you. what is snapshot maven repo url?

from config.

hseeberger avatar hseeberger commented on July 24, 2024

It will be https://oss.sonatype.org/content/repositories/snapshots/ as soon as Havoc has published it.

from config.

havocp avatar havocp commented on July 24, 2024

There's a 0.4.0-SNAPSHOT now. Let me know if it doesn't work so I can fix it before publishing a non-snapshot.

from config.

havocp avatar havocp commented on July 24, 2024

@hseeberger thanks for the fix btw!

from config.

hseeberger avatar hseeberger commented on July 24, 2024

@carrot-garden please try in anger. Did I provide useful OSGi metadata (exported packages, versions, etc.)?

@havocp Sure, was fun! Finally I can make use of my OSGi plugin ;-)

from config.

 avatar commented on July 24, 2024

bundle loads in osgi ok, thank you.

few notes:

  • Include-Resource points to resources not present in jar
    Include-Resource: /opt/hp/checkout/hocon/config/src/main/resources,/opt/
    hp/checkout/hocon/config/target/resource_managed/main
  • version should advance, say 0.4.1-SNAPSHOT
    since 0.4.0 is already a release

from config.

hseeberger avatar hseeberger commented on July 24, 2024

The Include-Resource header comes from bnd, the tool used to create the bundle. This cannot be avoided, but it does no harm, because all manifest headers which are not OSGi bundle headers, are ignored by the OSGi framework.

You are definitely right about the version. I completely missed that fact that there is already a 0.4.0 release, assuming that the version was bumped to the next minor number after the last release. Anyway, it is just a snapshot and we should go for a release soon, because we will need a bundelized config library for Akka, too.

@havocp, could you please release a 0.4.1 or 0.5.0 version?

from config.

havocp avatar havocp commented on July 24, 2024

Release 0.4.1-SNAPSHOT, sorry about that

from config.

 avatar commented on July 24, 2024

you probably could remove Include-Resource with "-removeheaders"
http://www.aqute.biz/Bnd/Format

from config.

mpilquist avatar mpilquist commented on July 24, 2024

See my pull request on scalaz for an example of using -removeheaders: mpilquist/scalaz@fff4cea

from config.

hseeberger avatar hseeberger commented on July 24, 2024

Thanks for this pointer. Actually I think that these headers do no harm, so let's just keep them for this release. We could create a pull request later if we really think that they should be removed.

from config.

havocp avatar havocp commented on July 24, 2024

OK. I published a 0.4.1 as-is and we can always publish newer versions with improvements.

from config.

kevin-looft avatar kevin-looft commented on July 24, 2024

My project has a transitive dependency on this bundle, and I'm trying to use the maven-dependency-plugin to copy my project's dependencies at build time. However that plugin doesn't know how to handle a dependency of type 'bundle' and it results in the below error. Are there any ideas of how to avoid this?

Error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:copy-dependencies (copy-dependencies) on project my-project: Some problems were encountered while processing the POMs:
[ERROR] [ERROR] Unknown packaging: bundle @ line 6, column 16
[ERROR] : 1 problem was encountered while building the effective model for com.typesafe:config:1.3.1
[ERROR] [ERROR] Unknown packaging: bundle @ line 6, column 16

My pom plugin:
<plugin> <extensions>true</extensions> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.1.1</version> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <copyPom>true</copyPom> <excludeTransitive>false</excludeTransitive> <addParentPoms>true</addParentPoms> </configuration> </execution> </executions> </plugin>

from config.

mpilquist avatar mpilquist commented on July 24, 2024

You'll need to add the maven-bundle-plugin to your build so it is aware of the bundle package type. Take a look here: https://stackoverflow.com/questions/51069767/maven-unknown-packaging-bundle-error-from-a-dependency-packaging-as-bundle/51070617#51070617

from config.

kevin-looft avatar kevin-looft commented on July 24, 2024

@mpilquist What would be the syntax in this case? I've tried a few options similar to below but they result in the same error.

<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Include-Resource> com.typesafe.config </Include-Resource> </instructions> </configuration> </plugin>

from config.

mpilquist avatar mpilquist commented on July 24, 2024

It's been a while but I think it's just this:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.felix</groupId>
      <artifactId>maven-bundle-plugin</artifactId>
      <extensions>true</extensions>
    </plugin>
  </plugins>
</build>
...
<dependencies>
  <dependency>
    <groupId>com.lightbend</groupId>
    <artifactId>config</artifactId>
    <version>...</version>
  </dependency>
</dependencies>

from config.

Related Issues (20)

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.