我想将我的maven编译的OSGi包部署到远程OSGi存储库中。我在Windows 7上使用eclipse中的maven-bundle-plugin (2.3.7)。存储库在linux上,可以通过ssh访问。
我在settings.xml中配置了使用plink和pscp (Putty )来完成ssh工作。在<distributionManagement>中,我设置了存储库url,它以scpexe://开头
maven-部署目标运行良好,并将jar文件和metadata.xml上传到存储库。
现在,我还希望生成和上传OBR元数据。因此,我添加了maven-bundle-plugin,<remoteOBR>my-repository</remoteOBR> (与<distributionManagement>中的存储库相同的ID )的配置。
在执行部署时(在成功完成maven部署阶段之后),我将得到错误。
未能在项目引导程序上执行目标org.apache.felix:maven-bundle-plugin:2.3.7:deploy (默认部署):传输失败:退出代码:1- 'scp‘不能识别为内部或外部命令、可操作的程序或批处理文件。 ->帮助1
这意味着maven-bundle插件不使用settings.xml中指定的settings.xml命令,而是使用路径上不可用的"scp“。
如何配置maven-bundle插件以使用PuTTY的pscp?上载OBR数据
发布于 2014-01-22 16:56:51
我最终找到了一个可行的解决方案:
因此POM看起来像(注意,scp://协议用于url)
<project>
...
<distributionManagement>
<repository>
<id>my-repository</id>
<url>scp://repo.myserver.com/path/to/repo/</url>
</repository>
</distributionManagement>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
...
<remoteOBR>my-repository</remoteOBR>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.5</version>
</extension>
</extensions>
</build>
...和settings.xml (位于C:\Users\myUsernameOnWindows.m2)
<settings>
<servers>
<server>
<id>my-repository</id>
<username>myUsernameOnRepo</username>
<privateKey>C:/path/to/private/key/id_rsa</privateKey>
<passphrase>myPrivateKeyPassphrase</passphrase>
</server>
</servers>
</settings>https://stackoverflow.com/questions/21262882
复制相似问题