打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Intellij Ant打包reportng报程序包不存在错误
userphoto

2016.08.04

关注
在研究reportng打包之前,试过eclipse自带的打包方式很多遍,替换掉reportng-1.1.4.jar;一直是不可用的, 添加进去,eclipse就报错,举步艰难呀。

于是,从官网下载了Intellij工具使用Ant build打包。
但是,打包的时候遇到了这个问题。
 
 
之后通过查阅各种相关maven、pom.xml,settings.xml,Ant build资料,终于自己给陶腾出来了,毕竟Ant使用的年代久远,source稀缺。

1.首先,需要知道maven重要的就是pom.xml自动关联并依赖jar的使用,但reportng不是用maven来打包的。
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>2.45.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>

2.而是通过antlib外部lib文件 uncommons-antlib-0.3.2.jar进行依赖,使用Ant build进行release的,故在它的build.xml中也要对我在pom.xml所使用的相关jar进行关联。
需要修改2处地方。

1.引入pom.xml中使用到的jar, 由build.xml来进行关联依赖并编译。
<!-- Build application JAR files. -->
<target name="jar" depends="compile" description="Create the application JAR files.">
<uncommons:jar module="reportng"
jarfile="${artifact.identifier}.jar"
classpath="velocity-dep-1.4.jar" />
<uncommons:jar module="reportng"
jarfile="${artifact.identifier}.jar"
classpath="selenium-api-2.45.0.jar" />
<uncommons:jar module="reportng"
jarfile="${artifact.identifier}.jar"
classpath="commons-io-2.4.jar" />
</target>
2.lib->runtime中添加build所需要编译的jar

 
3.修改完之后,再次执行Ant bulid release即可。
 
 
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Maven 2.0:编译、测试、部署、运行
Maven的配置文件pom.xml
Maven中文手册
用Maven做项目管理
Maven图文闪电入门
使用Ant打包工具
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服