您的位置:首页 > 产品设计 > UI/UE

maven offline jar for build

2016-01-01 17:49 706 查看
fedora下面需要安装:
yum install xmvn
yum install maven-local
才能使用%mvn_build命令

使用pom_xpath_remove移除不必要的依赖:
%pom_xpath_remove "pom:extension[pom:artifactId[text()='wagon-webdav-jackrabbit']]"
%pom_xpath_remove "pom:build/pom:extensions" trust-agent/his-clients/pom.xml
%pom_xpath_remove "pom:build/pom:extensions" trust-agent/TrustAgent/pom.xml
%pom_remove_plugin :svn-revision-number-maven-plugin
# trust-agent/his-clients

%build
%mvn_build

对于使用此命令出现问题:

[ERROR] Failed to execute goal
org.fedoraproject.xmvn:xmvn-mojo:1.2.0:install (default-cli) on project
pom: Some reactor artifacts have dependencies with scope "system". Such
dependencies are not supported by XMvn installer. You should either
remove any dependencies with scope "system" before the build or not run
XMvn instaler. -> [Help 1]

解决办法就是在oat.spec(或者其他spec文件)文件中remove掉这个依赖再add(前提是这个包可以通过pom.xml文件找到,也可以理解为这个包使用maven打的):
%pom_remove_dep javax.servlet.jsp:jsp-api trust-agent/HisPrivacyCAWebServices2/pom.xml
%pom_add_dep javax.servlet.jsp:jsp-apitrust-agent/HisPrivacyCAWebServices2/pom.xml
--如果这个包不适用maven打的,就add不到.

另外如果这个包不是用maven打的,解决办法就是:
jar xf /usr/share/java/asm.jar ----强制引入,可以被maven识别,但是在该pom.xml文件中应该存在此dependency
哪个包报错就需要先用%pom_remove_dep去掉那个包然后使用上面命令强制引入进来。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: