{"id":326,"date":"2014-09-15T07:37:37","date_gmt":"2014-09-15T12:37:37","guid":{"rendered":"http:\/\/www.buluschek.com\/?p=326"},"modified":"2023-07-02T10:49:23","modified_gmt":"2023-07-02T08:49:23","slug":"deploying-a-pre-existing-bundle-on-osgi-obr","status":"publish","type":"post","link":"https:\/\/www.buluschek.com\/?p=326","title":{"rendered":"Deploying a pre-existing bundle on OSGi OBR"},"content":{"rendered":"<p>Using the maven-bundle-plugin, you can deploy a preexisting jar bundle from your local maven repository to your remote OBR. For this you use the <code>deploy-file<\/code> target of the maven-bundle-plugin directly, with a command line like:<br \/>\n<code><br \/>\n    mvn org.apache.felix:maven-bundle-plugin:2.4.0:deploy-file<br \/>\n    -DrepositoryId=my-repository-id<br \/>\n    -Durl=scp:\/\/url\/to\/my\/repository<br \/>\n    -DpomFile=C:\\Users\\myuser\\.m2\\repository\\com\\...\\the-bundle-to-deploy-1.0.0.pom<br \/>\n<\/code><br \/>\nwhere <code>my-repository-id<\/code> is the id you also use in your settings.xml for storing the access data (username, private key, passphrase etc).<\/p>\n<p>In my case, this simple command failed with the error:<\/p>\n<p><code><br \/>\n[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.4.0:deploy-file (default-cli) on project standalone-pom: Unsupported protocol: 'scp': Cannot find wagon which supports the requested protocol: scp: java.util.NoSuchElementException<br \/>\n[ERROR] role: org.apache.maven.wagon.Wagon<br \/>\n[ERROR] roleHint: scp<br \/>\n<\/code><br \/>\nand later<br \/>\n<code><br \/>\n Error injecting: org.apache.maven.wagon.providers.ssh.jsch.ScpWagon<br \/>\n<\/code><br \/>\nand even later<br \/>\n<code>Error injecting: org.apache.maven.wagon.providers.ssh.jsch.interactive.PrompterUIKeyboardInteractive<br \/>\n<\/code><\/p>\n<p>To resolve this, I had to add the following jars to the %M2_HOME\/lib directory (so they are added to the classpath). <\/p>\n<ul>\n<li>wagon-ssh-2.5.jar<\/li>\n<li>wagon-ssh-common-2.5.jar<\/li>\n<li>jsch-0.1.51.jar<\/li>\n<li>plexus-interactivity-api-1.0-alpha-6.jar<\/li>\n<\/ul>\n<p>M2_HOME is where the maven executable are located, in my case <code>C:\\springsource\\apache-maven-3.0.3\\lib<\/code> and which can be found (on windows) by executing:<br \/>\n<code>where mvn<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using the maven-bundle-plugin, you can deploy a preexisting jar bundle from your local maven repository to your remote OBR. For this you use the deploy-file target of the maven-bundle-plugin directly, with a command line like: mvn org.apache.felix:maven-bundle-plugin:2.4.0:deploy-file -DrepositoryId=my-repository-id -Durl=scp:\/\/url\/to\/my\/repository -DpomFile=C:\\Users\\myuser\\.m2\\repository\\com\\&#8230;\\the-bundle-to-deploy-1.0.0.pom where my-repository-id is the id you also use in your settings.xml for storing the access [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,26,25],"tags":[],"class_list":["post-326","post","type-post","status-publish","format-standard","hentry","category-java","category-maven-2","category-osgi"],"_links":{"self":[{"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/posts\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=326"}],"version-history":[{"count":6,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/posts\/326\/revisions"}],"predecessor-version":[{"id":332,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/posts\/326\/revisions\/332"}],"wp:attachment":[{"href":"https:\/\/www.buluschek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}