ant

How to make work together an Ant filelist inside an Ant copy

此生再无相见时 提交于 2020-01-04 05:22:05
问题 I would like to use the result of the following filelist (Ant): <filelist id="docfiles" dir="doc"> <file name="foo.xml"/> <file name="bar.xml"/> </filelist> into the following copy : <copy todir="folder"> ??? </copy> I have already tried to put them together like: <copy todir="folder"> <filelist id="docfiles" dir="doc"> <file name="foo.xml"/> <file name="bar.xml"/> </filelist> </copy> But Ant answer that FileLists is not supported in a such task. Thanks. 回答1: As specified in the latest Ant

ant excluding files

牧云@^-^@ 提交于 2020-01-04 04:17:24
问题 I have to write an ant target for Junit report. It is an existing application. Some of the Test class files are named as TestSample.java or SampleTest.java. But there are some few java files which are not to do anything with junit testcases are written HeaderTest.java which doesnt extending TestCase. How can i filter these calss files? <junit printsummary="on" fork="off" haltonfailure="false" showoutput="true"> <classpath> <path refid="CLASSPATH_JUNIT"/> </classpath> <batchtest fork="off"

ANT : What is the simplest way to add version number to built jar?

放肆的年华 提交于 2020-01-04 03:59:29
问题 <?xml version="1.0" encoding="UTF-8"?> <project name="myPlugin" default="all"> <target name="artifact.myPlugin:jar" depends="init.artifacts, compile.module.myPlugin" description="Build 'myPlugin:jar' artifact"> <mkdir dir="${artifact.output.myplugin:jar}" /> <jar destfile="${temp.jar.path.myPlugin.jar}" duplicate="preserve" filesetmanifest="mergewithoutmain"> <zipfileset file="${basedir}/META-INF/MANIFEST.MF" prefix="META-INF" /> <zipfileset dir="${myPlugin.output.dir}" /> </jar> <!--How

Cleaning up stale .class files using Apache Ant

一曲冷凌霜 提交于 2020-01-03 18:34:33
问题 How do I clean up stale .class files out of ${workdir} given set of existing .java files in ${srcdir} ? By stale I mean .class files that were generated from now removed .java files. I have tried coming up with something using Ant mappers and filesets etc. but I failed. Removing all .class files older than their respective source .java files would be acceptable, too. 回答1: I'm pretty sure there's an ant task to kill .classes older than the .java... Depend sounds close, and may actually do what

Regex to select last line in a multi-line string

蹲街弑〆低调 提交于 2020-01-03 17:47:25
问题 I have an ANT script which will have a property whose value could be one or more lines e.g. property prop1= A_12.1_REL_B121000_10_18_2011.1700 A_12.1_REL_B121001_10_25_2011.6059 A_12.1_REL_B121001_10_25_2011.2201 A_12.1_REL_B121001_10_25_2011.2014 Please see that all these lines end with a CRLF and end of file is also another CRLF. Now what I need to do is just select the last line using a regex. The number of lines could be less or more e.g prop1= A_12.1_REL_B121000_10_18_2011.1700 In the

Ivy cached a dependency file, but not copy to my lib

女生的网名这么多〃 提交于 2020-01-03 17:20:30
问题 I got a strange problem. I added Guava to my ivy.xml as the following: <dependency org="com.google.guava" name="guava" rev="14.0.1" conf="test"/> When I run ant, I can see it's resolved: [ivy:retrieve] found com.google.guava#guava;14.0.1 in default And I can find the file in the ~/.ivy2/cache. But it didn't get copied to my lib directory. Other dependencies have no problem....Any advice? Thanks. 回答1: Specify the configuration mapping in ivy.xml I had the same problem and couldn't for the life

The @ in a for loop while using scp

浪尽此生 提交于 2020-01-03 17:13:10
问题 Please take a look at this line: ${server_username}:${server_password}@@{server}:/tmp The double @@ causes problems. Instead of user:pass@server it displays as user:passserver and therefore is unable to connect to the remote ssh server. How do you tell ant to leave the @ be? This is my code: <for list="${externalLibs}" param="library"> <sequential> <for list="${servers}" param="server"> <sequential> <echo> Copying @{library} to @{server} ${server_username}:${server_password}@@@{server}:/tmp/@

JavaFX jar with dependencies bundled

半世苍凉 提交于 2020-01-03 17:10:17
问题 I just made a question about using javafxpackager to make JavaFX jars, you can see it here. My problem was that I couldn't include the classpath in the manifest. Well, while I was waiting for the answer, I tried maven-antrun-plugin instead. It worked nice, and I could run my application with dependencies, BUT (there is always a but) only with the dependencies OUTSIDE my final jar. So it is like that: FinalJar.jar lib |_{all dependencies here} My manifest file is pointing to the dependencies

junit gives error java.lang.NoClassDefFoundError: junit/framework/JUnit4TestAdapterCache

主宰稳场 提交于 2020-01-03 16:53:37
问题 I'm trying to run a simple unit test to my project at https://github.com/cdwijayarathna/oj4j. I added both junit-4.12.jar and ant-junit4.jar to the lib folder. But when I ran "rake run_tests", I'm getting following error at the report location I have given. java.lang.NoClassDefFoundError: junit/framework/JUnit4TestAdapterCache at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass

How to encode Java files in UTF-8 using Apache Ant?

不羁岁月 提交于 2020-01-03 10:56:12
问题 In my build.xml file I fetch some Java files by cxf. Some of these Java files need to be encoded in UTF-8. How can I use Ant to change the encoding to UTF-8? PS: I found instructions for how to set the encoding for javac to UTF-8, but prior to javac I need Java files to be in UTF-8. Otherwise I get an error: warning: unmappable character for encoding utf-8 Here is my code: <macrodef name="lpwservice"> <attribute name="name"/> <attribute name="package"/> <sequential> <property name="wsdlfile"