What's wrong with this Ant path?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 01:06:57

问题


Note: even though this question involves GWT, it's really an Ant question. All I'm asking is: is the Ant PATH that I have below a "legal" path?

I am getting ClassNotFoundExceptions on a type (com.google.gwt.dev.Compiler) that is packaged inside gwt-dev.jar (which as you can see is configured to be on the path below). Does the gwt.path look wrong to anyone:

<path id="gwt.path">
    <pathelement location="${gen.bin.main.dir}"/>
    <fileset dir="${gen.lib.main.dir}">
        <filename name="gin-2.1.2.jar"/>
        <filename name="guice-3.0.0.jar"/>
        <filename name="guice-assistedinject-3.0.0.jar"/>
        <filename name="gwt-bootstrap-2.2.2.jar"/>
        <filename name="gwt-bootstrap-sources-2.2.2.jar"/>
        <filename name="gwt-dev.jar"/>
        <filename name="gwt-user.jar"/>
        <filename name="javax-inject-1.0.0.jar"/>
        <filename name="requestfactory-apt.jar"/>
        <filename name="requestfactory-client+src.jar"/>
        <filename name="validation-api-1.0.0.GA.jar"/>
        <filename name="validation-api-1.0.0.GA-sources.jar"/>
    </fileset>
</path>

If now then I will explore other avenues.


回答1:


To see if an ant path is correct use the ant touch command:

<touch file="myfile"/>

This is similar to the unix touch command and should create an empty file named myfile in that path, if the path is correct.

In this case, are you trying to add some jars to the classpath? In that case you should use the classpath element and not path.




回答2:


I figured it out. It was bad Ant. All the <fileset> elements need to be <pathelement location="the-jar"/> instead.



来源:https://stackoverflow.com/questions/20459267/whats-wrong-with-this-ant-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!