ant

How to fail on pathelement not exists in apache ant?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 05:58:24
问题 I have a really long class path using a <path /> section. On a different machine, lots of the jars dont exist. How can I check the pathelements all exist? 回答1: Use the present selector : <project> <fileset dir="/home/rosebud/temp/dir1" includes="*.jar" id="srcfileset"> <present present="srconly" targetdir="/home/rosebud/temp/dir2"/> </fileset> <echo>Missing files => ${toString:srcfileset}</echo> </project> echoes all files only present in /home/rosebud/temp/dir1 If all files from /home

Overriding WAR classes directory

一曲冷凌霜 提交于 2019-12-13 05:56:29
问题 If you use the Ant to create your WAR via the war task, then (as explained here) it will automatically create a WEB_INF/classes/ directory in the WAR. I would like to change the name of this generated classes/ directory to, say, classpath/ and can't figure out how. If this is possible, would someone provide a code example as well as a reference to the documentation that shows how to do this (I'm curious!). Thanks! 回答1: You shouldn't change the name of the classes to something else. The

Dexguard vs Android plugin - breaks build process

别等时光非礼了梦想. 提交于 2019-12-13 05:16:30
问题 When i try to use dexguard plugin in place of android plugin ( dexguard plugin extends android ), my gradle build process fails with this error: $ ./gradlew assembleDebug FAILURE: Build failed with an exception. * Where: Build file '/projectRoot/app/build.gradle' line: 1 * What went wrong: A problem occurred evaluating project ':projectRoot:app'. Could not create plugin of type 'g'. The first line build.gradle for my app module is apply plugin: 'dexguard' The build.gradle for my whole project

The import package cannot be resolved

你离开我真会死。 提交于 2019-12-13 05:02:56
问题 I have a liferay portlet. I've added some external libraries using maven. In ide no errors, it can recognize, but when deploying with ant , it says no such package and class import pack.SomeClass; The import pack cannot be resolved code: import pack.SomeClass; public class MainPortlet extends MVCPortlet { public void doView(RenderRequest renderRequest,RenderResponse renderResponse) { SomeClass a = new SomeClass(); } } 回答1: If you are using maven and you have defined your dependency with scope

ClassNotFoundException - when running ant-junit

半世苍凉 提交于 2019-12-13 04:55:50
问题 I'm trying to create a Proof of concept for the actual application, The task is to run ant-junit tests without adding stuff to the global environment. I've achieved it so far in ant, but, I'm stuck with the following exception. ClassTest.java is the java class that has sample unit testcase. (Junit 3.0 style). I'm not sure why ant-junit does not find the class inspite of mentioning the paths in the batchrun task. project structure I get the following exception when running ant-junit task.

Building project.war file Via ant missed the files in java->server folder

混江龙づ霸主 提交于 2019-12-13 04:55:42
问题 I am creating project.war file using ant and worklight-ant-builder.jar file in the MFP. While my project is build using mfp or via eclipse in the bin the .war file and classes folder have all the things including content in my server->java folder. But when i build the ant file using step 1 i dont get the files in my server->java folder. Note i have verified this by using 7-zip to see the contents in the .war file and also seen the folder classes created by the mobileFirst which contains

ant-contrib: get count result in 'resourcecount' nested in <for/> loop

荒凉一梦 提交于 2019-12-13 04:54:32
问题 To search for multiple 'searchStrings' in a fileset the following ANT seems to do the job. <taskdef resource="net/sf/antcontrib/antlib.xml"> <classpath> <pathelement location="/usr/share/java/ant-contrib.jar"/> </classpath> </taskdef> <loadfile property="list" srcFile="searchStrings.txt"/> <echo>.:${list}:.</echo> <target name="main"> <for list="${list}" param="search4" delimiter="${line.separator}"> <sequential> <fileset id="existing" dir="../src"> <patternset id="files"> <include name="**/*

Dynamically generate JAR files based on package name with ANT

那年仲夏 提交于 2019-12-13 04:26:51
问题 My current build file has the following repetitive tasks: <jar jarfile="${build.lib}/${prefix}-foo.jar"> <fileset dir="${build.classes}"> <include name="com/a/c/foo/**"/> </fileset> </jar> <jar jarfile="${build.lib}/${prefix}-bar.jar"> <fileset dir="${build.classes}"> <include name="com/a/c/bar/**"/> </fileset> </jar> ... etc. The issue is that the build.xml must be modified for each new package or for each new sub-project. This is a frequent occurrence where I work. I would like to replace

ivy cleancache but specific folders

与世无争的帅哥 提交于 2019-12-13 04:23:54
问题 We have some internal jars in a remote repository and do not build them very often.The resolver looks like this: view-snapshots is a local repo and hub-releases is a shared repo. <chain name="hub-internal-library-chain" returnFirst="true"> <resolver ref="view-snapshots"/> <resolver ref="hub-releases"/> </chain> By default,if a developer publishes anything it goes to view-snapshots cache.We need to keep the flag return first-"true" for performance issues.So the issue I want to delete some

ant copy a list of files evenly across multiple folders

亡梦爱人 提交于 2019-12-13 04:17:12
问题 I'm using ant to drive some test automation. I have a flattened folder that has about 100 files of the same type. I'd like to spread these files across 4 folders evenly to spread the execution across a few machines. So the project would create the four folders and then run through the hundred files passing one file to a folder and then continue on. file 1 goes to folder 1, 2 to 2, 3 to 3, 4 to 4, 5 to 1, etc. The names and numbers of files will fluctuate. I can write a small utility to do