phax / phive-rules

A set of preconfigured rules for the phive engine
Other
25 stars 8 forks source link

Add documentation for how to use without OSGi #7

Closed eivinhb closed 3 years ago

eivinhb commented 3 years ago

I see that these are build as OSGi-bundles? I'm having big trouble finding out how I am supposed to use the rules together with phive-api in my NON OSGi environment. Maven is like 🤷‍♂️.

OSGi is not a big thing here in Norway. :)

phax commented 3 years ago

It's a regular JAR file to be used in plain Java. These build instructions just add additional metadata that are ignored when used in non-OSGI environments. If you look closely, you can see the same declarations in ph-schematron and everything worked just out of the box. Personally I never used OSGI myself - it's just upon request of others... hth

eivinhb commented 3 years ago

But maven is not able to add a <packaging>bundle</packaging> to classpath because it has no type bundle. Thus the artifact is downloaded but not added to classpath. It builds with maven if I edit the pom in my .m2/repo to packaging jar.

I guess that with <packaging>bundle</packaging> and using fenix maven-bundle-plugin makes this an OSGi bundle. What am I missing?

phax commented 3 years ago

What Maven version are you using? Is it 3.6.x? By using this plugin in the POM

        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>

this adds support for the "bundle" type. What artefact exactly is causing problems, or all of them? Can you paste the details of the problem here? What JDK are you using?

I never heard of any problems in this area....

eivinhb commented 3 years ago

After changing the packaging to jar in phive-rules-peppol-2.0.3.pom Intellij was able to add the jar to classpath. I did som coding just to test. And it worked. Then I pushet to Github at it builds there. So I deleted the downloaded dependencies in my local repository. And now that worked also. This is so strange.

phax commented 3 years ago

Okay, so it was an IntelliJ problem. Shit happens... I am closing this for now and just calling this a temporary, non-critical but resolved issue :)