admin管理员组文章数量:1123933
I've very recently begun working with Ant as my primary buildtool, and have been enjoying it so much that I really would rather stick with it for a while. The only frustrating issue I've run into is when it comes to integrating dependency management with Ivy. The retrieval process goes fine, and all of the necessary JARs are successfully downloaded into an autogenerated library folder called 'lib.' The issue, then, comes during the compilation process. Without fail, the compiler returns errors for every instance of a jar-dependent class (or jar import statement) found in the code.
file tree (.png)
build.xml
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="CELLMAX" default="run">
<target name="resolve">
<ivy:retrieve/>
</target>
<target name="compile">
<mkdir dir="classes"/>
<mkdir dir="jars"/>
<javac srcdir="src" destdir="classes"/>
<jar destfile="jars/CELLMAX.jar" basedir="classes">
<manifest>
<attribute name="Main-Class" value="main.java.Driver"/>
</manifest>
</jar>
</target>
<target name="run">
<java jar="jars/CELLMAX.jar" fork="true"/>
</target>
</project>
sample error log
[javac] /home/pablo/javar/CELLMAX/src/main/java/Reader.java:4: error: package org.openqa.selenium does not exist
[javac] import org.openqa.selenium.By;
I've tried changing (and deleting) the import statements altogether, moving the lib folder into the .java file directory and having them point to the jars via the lib folder, all with no success. Does anyone have any idea what might be preventing the compiler from automatically identifying jars within the lib folder? Does Ant not have any such feature? Attached below are my project file tree, buildfile, and compiler error logs.
本文标签:
版权声明:本文标题:Java compiler (via Apache Ant) not detecting jars in library folder (generated by Apache Ivy) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736601076a1945220.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论