ant

Change working directory in ant junit task

坚强是说给别人听的谎言 提交于 2019-12-07 06:07:11
问题 I have a ant file that runs JUnits tests. These tests rely on a relative path to certain configuration files. I've tried to set the working directory for the batch test, but fail. I want the working directory to be ${plugins.dir}/${name} The JUnit part of the ant script: <junit haltonfailure="no" printsummary="on" fork="true" showoutput="true" dir="${plugins.dir}/${name}"> <jvmarg value="-Duser.dir=${plugins.dir}/${name}"/> <classpath> <path refid="project.classpath"/> <pathelement location="

start/stop tomcat using maven

南楼画角 提交于 2019-12-07 05:30:13
问题 How can i start/stop remote tomcat using maven. I am using cargo plugin which helps me in deploying the application , but doesn't provides the functionality to start/stop the remote tomcat. 回答1: You can try to use the maven tomcat plugin or if it does not give you everything you need, you can always use an ant task here is a reference on the task 回答2: Indeed, You can NOT start and stop Tomcat running remotely using Cargo, only deploy and undeploy your web application. Actually, to my

Immediate JUnit test logging with <junit> Ant Task

♀尐吖头ヾ 提交于 2019-12-07 05:30:00
问题 I have the following in my build.xml : <junit fork="yes" printsummary="yes" filtertrace="yes"> <classpath>...</classpath> <test name="tests.AllTests"/> <formatter type="plain" usefile="false"/> </junit> I would like the JUnit results to be reported for each test as soon as they complete, unfortunately the JUnit task only prints the test results after the whole test case has completed. The test case (AllTests) is rather large, so I have to wait quite a while for the output. Is there any way to

Maven and Ant Can't run Java - CreateProcess error=206, The filename or extension is too long

我是研究僧i 提交于 2019-12-07 05:28:15
问题 When maven via antrun executes this java code I get the dreaded error=206, The filename or extension is too long <java classname="com.me.api" failonerror="true" fork="true" maxmemory="128m" output="${wsdlFile}.out"> <arg value="${className}" /> <arg value="${name}" /> <arg value="${wsdlFile}" /> <classpath> <path refid="maven.test.classpath" /> </classpath> 回答1: Maven creates lengthy classpaths due to the structure and location of the local maven repo. We need to use a pathing jar. Convert

Passing java system properties to ant tests

梦想的初衷 提交于 2019-12-07 05:06:08
问题 I have ant executing a jar with the following code <target name="start.my.jar" description="start my jar"> <echo message="Starting the jar" /> <java jar="${jars.dir}/${my.stub.jar}" fork="true" dir="${jars.dir}" spawn="true"> <sysproperty key="properties.filename" value="${basedir}/path/path/path/filename.properties"/> <arg value="start" /> </java> </target> inside the jar there is a class with the following code public static MyFacade createFacade() throws FileNotFoundException, IOException

Problem with compiling a gwt project with ant

寵の児 提交于 2019-12-07 04:51:15
问题 I've been using GWT for quite some time now and have only used the eclipse plugin to compile my projects so far. Due to a new requirement I need to use an ant build (for the first time) to build a gwt project. First I'll say that I have 2 modules which have an entry point and 2 other common modules which only contain java classes (which should be translated to js) and they sit in a different project in my workspace. Currently I have the GWT project which requires the Common project which in

Getting the Ant <modified> selector to work properly

谁都会走 提交于 2019-12-07 04:49:53
问题 I have a target in ANT that needs to run a compiler on a given set of files twice: once for debug, once for production. I only want to run the compiler if the source file has changed, so I set up a <modified> selector. However, since I need both the debug and prod task to run for a given modified file, I set the update property to false on the first run. I have something along the lines of: <!-- Do the debug build --> <apply executable="compiler"> <fileset dir="${js.src.dir}" includes="*.js">

How to do OpenJPA enhancement with Ant + IntelliJ IDEA

試著忘記壹切 提交于 2019-12-07 03:54:25
问题 This is driving me crazy and I'm shocked that official documentation is absolutely useles. Here is what I have: IntelliJ IDEA 11 OpenJPA 2.1.1 Since openjpa is added into list of used libraries I already had classpath to OpenJPA which looks like this <path id="library.openjpa.classpath"> <fileset dir="${basedir}/lib/openjpa"> <patternset refid="library.patterns"/> </fileset> </path> According to official documentation I added following target <target name="enhance"> <copy includeemptydirs=

Ant build classpath jar generates “error in opening zip file”

杀马特。学长 韩版系。学妹 提交于 2019-12-07 03:25:25
问题 I have a project built in eclipse with a dependencies on 3rd party jars. I'm trying to generate a suitable build file for ant - using eclipses built-in export->ant buildfile feature as a starting block. When I run the build target I get the following error: [javac] error: error reading /base/repo/FabTrace/lib/apache/geronimo/specs/geronimo-j2ee-management_1.0_spec/1.0/geronimo-j2ee-management_1.0_spec-1.0.jar; error in opening zip file And the whole build file (auto-generated by eclipse)

How to avoid copying 40M of java lib's within a WAR when the WAR's size is 41M?

馋奶兔 提交于 2019-12-07 03:19:53
问题 At the moment my build process consists of repackaging the war file with all required java libraries under WEB-INF/lib and then copying the war file to development/demo/production server to be redeployed by tomcat. The packaged war file's size is about 41M and it has at the moment something like 40M of external java libraries. There has to be a better way. How have you solved this issue? My development machine is a windows box with Eclipse as my IDE and Ant as my build tool. The servers are