Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 ant 为项目创建一个 jar。
这是目标
<jar destfile="artifacts/my-jar-file.jar" basedir="."> <include name="bin/**" /> </jar>
jar 正在创建,但它将包创建为:
bin.com.aryasindhu.testjar。...
但我不需要在包装前附加 bin。
请建议我在 jar 创建目标中需要更改的内容。
尝试这个:
<jar destfile="artifacts/my-jar-file.jar" basedir="./bin"> <include name="*/**" /> </jar>
我刚得到我的答案。
这是我现在使用的目标的变化:
<jar destfile="artifacts/my-jar-file.jar"> <fileset dir="bin" includes="**/*.class" /> </jar>