java – 从maven-antrun-plugin调用ant脚本时出现IllegalAccessError
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了java – 从maven-antrun-plugin调用ant脚本时出现IllegalAccessError,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1590字,纯文字阅读大概需要3分钟。
内容图文
![java – 从maven-antrun-plugin调用ant脚本时出现IllegalAccessError](/upload/InfoBanner/zyjiaocheng/782/9ef04ff8085e4a958c10c801db294145.jpg)
我刚刚将Maven从2.0.9更新到2.2.1,并且在运行maven构建时遇到以下异常:
INFO] [antrun:run {execution: precompile-jsp}] [INFO] Executing tasks default: jspc: [mkdir] Created dir: C:\builds\trunk\webapps\vyre_portlets\WEB-INF\jsp_src [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] An Ant BuildException has occured: The following error occurred while executing this line: C:\unify\trunk\portlets\build-jsps.xml:87: The following error occurred while executing this line: C:\unify\trunk\portlets\build-jsps.xml:7: java.lang.IllegalAccessError: tried to access method org.apache.tools.ant.launch.Locator.decodeUri(Ljava/lang/String;)Ljava/lang/String; from class org.apache.tools.ant.AntClassLoader
build-jsps.xml ant脚本运行org.apache.jasper.JspC任务,以在maven正在构建的webapp中预编译JSP.这与Maven 2.0.9一起运行良好.
谷歌给了很多人提出类似的问题,但没有答案.有没有人碰到这个并知道如何解决这个问题?或者甚至只是为什么我得到了IllegalAccessError?
解决方法:
尝试明确地为“maven-antrun-plugin”设置ANT依赖性.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
....
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
</plugin>
请注意,您可以在Maven的公共存储库中找到ANT的多个位置:
>< groupId> org.apache.ant< / groupId>
>< groupId> ant< / groupId>
(2)是旧的,所以使用(1)代替
内容总结
以上是互联网集市为您收集整理的java – 从maven-antrun-plugin调用ant脚本时出现IllegalAccessError全部内容,希望文章能够帮你解决java – 从maven-antrun-plugin调用ant脚本时出现IllegalAccessError所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。