Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to deploy OSGi bundle to Maven repo with deploy:deploy-file?
    text
    copied!<p>I have an OSGi bundle that was built using Maven by another team. The POM file declares its packaging as "bundle" and uses the Apache Felix plugin.</p> <p>I need to deploy this artifact to a local Maven repository (Nexus) so that it can be used by our internal projects.</p> <p>I have used the <code>deploy:deploy-file</code> target to deploy the bundle to the repository, just as you would with a standard JAR file and this works without error. I extracted the embedded POM from the bundle and passed that on the command line, so the command line was:</p> <pre><code>mvn deploy:deploy-file -Dfile=3rdpartybundle.jar -DpomFile=pom.xml -DrepositoryId=internal -Durl=http://internalserver/nexus </code></pre> <p>The issue is that when I deploy it like this, the packaging is set to bundle and as a result the name of the artifact in the repository ends up with a .bundle extension, instead of a .jar extension.</p> <p>Now, we cannot figure out how to declare it as a dependency. If we declare it like this:</p> <pre><code> &lt;dependency&gt; &lt;groupId&gt;...&lt;/groupId&gt; &lt;artifactId&gt;...&lt;/artifactId&gt; &lt;version&gt;...&lt;/version&gt; &lt;type&gt;bundle&lt;/type&gt; &lt;/dependency&gt; </code></pre> <p>We get an error stating that the dependency cannot be resolved. The interesting thing is that the GAV coordinates in the error message actually has "jar" as the value for the type of the dependency even though we set it as "bundle".</p> <p>If we change the dependency to:</p> <pre><code> &lt;dependency&gt; &lt;groupId&gt;...&lt;/groupId&gt; &lt;artifactId&gt;...&lt;/artifactId&gt; &lt;version&gt;...&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;/dependency&gt; </code></pre> <p>We get the exact same unresolved dependency error.</p> <p>So how are you supposed to deploy an artifact packaged as a bundle to a Maven repository, so that it can be used as a compile time dependency for another project?</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload