如何写下从先前汇编的JAR中删除档案的次要任务?
我要说的是,我的联合调查组的档案是:
aaa/bbb/ccc/Class1
aaa/bbb/ccc/Class2
aaa/bbb/def/Class3
aaa/bbb/def/Class4
......和我想到一份没有<代码>aaa.bbb.def包的JAR档案版本,我需要用ant将其删除,因此,我最后要提交一份联合报告,其中载有:
aaa/bbb/ccc/Class1
aaa/bbb/ccc/Class2
感谢!
如何写下从先前汇编的JAR中删除档案的次要任务?
我要说的是,我的联合调查组的档案是:
aaa/bbb/ccc/Class1
aaa/bbb/ccc/Class2
aaa/bbb/def/Class3
aaa/bbb/def/Class4
......和我想到一份没有<代码>aaa.bbb.def包的JAR档案版本,我需要用ant将其删除,因此,我最后要提交一份联合报告,其中载有:
aaa/bbb/ccc/Class1
aaa/bbb/ccc/Class2
感谢!
您是否使用<代码>zipfileset 任务?
<jar destfile="stripped.jar">
<zipfileset src="full.jar" excludes="files/to/exclude/**/*.file" />
</jar>
<property name="library.dir" value="dist" />
<property name="library.file" value="YourJavaArchive.jar" />
<property name="library.path" value="${library.dir}/${library.file}" />
<property name="library.path.new" value="${library.dir}/new-${library.file}" />
<target name="purge-superfluous">
<echo>Removing superfluous files from Java archive.</echo>
<jar destfile="${library.path.new}">
<zipfileset src="${library.path}" excludes="**/ComicSans.ttf" />
</jar>
<delete file="${library.path}" />
<move file="${library.path.new}" tofile="${library.path}" />
</target>
你们必须 un笑。
<unzip src="myjar.jar" dest="/classes/">
<jar destfile="newjar.jar"
basedir="/classes/"
includes="**/*"
excludes="**/def/*"
/>
对我来说,答案没有多大增加——
<zip destfile="tmp.jar">
<zipfileset src="src.jar">
<exclude name="**/*.class" />
</zipfileset>
</zip>
<move file="tmp.jar" tofile="src.jar" />
这使用单一通行证,给建筑增加太多时间
如果能够提供像关于六氯环己烷的“齐p”这样的“杰尔-书”能够存档程序,那么这项任务可以完成。
<exec executable="zip">
<arg value="-d" />
<arg value="myJarCopyToStrip.jar" />
<arg value="aaa/bbb/def/*" />
<arg value="aaa/bbb/def" />
</exec>
Subtree deletion depends on the capabilities of the used archiver.
The "os" attribute of the Ant "exec" task allows to use different archivers on different OS s.
我来到这里,希望把ant作为在格拉斯一带的一些短程。
别的人在无选择的情况下也处于同一个船上。
例如:
task antUnzip() << {
ant.jar(destfile: "stripped.jar") {
zipfileset(src: "full.jar", excludes: "files/to/exclude/**/*.file") {}
}
}
我不相信你的要求是否得到直接解决。 我建议将杰尔扩大到一些温室,然后删除不想要的班级档案。 最后,创立了一个新监狱,拥有必要的班级档案。
ache 参考手册:
Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...
Check this, List<String> list = new ArrayList<String>(); for (int i = 0; i < 10000; i++) { String value = (""+UUID.randomUUID().getLeastSignificantBits()).substring(3, ...
I am in the middle of solving a problem where I think it s best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set ...
I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I ...
I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...
If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...
I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....
I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...