FAQ Database Discussion Community


Code Coverage for Android Library Project while using Robolectric

android,ant,code-coverage,robolectric,eclemma
I have an android library project. We are using Robolectric to run the unit tests. Unit Tests are working fine from the IDE as well as Ant build.xml file. I am able to get the code coverage using the eclEmma plugin in Eclipse. But I am facing problems while getting...

Maven with Ant : exec Command line

java,maven,ant
I want to retrieve the serial number of my computer by running ant task in pom.xml. <profile> <id>generate-license</id> <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>compile</phase> <configuration> <tasks> <exec executable="wmic bios get serialnumber" resultproperty="serialNumber" failonerror="false" /> <echo message="Serial number: ${serialNumber}" /> </tasks>...

Tomcat: war deployed using ANT is not reachable

java,tomcat,ant,intellij-idea
I have two applications deployed in Tomcat server. Both are same just there names are changed. App2 is working as expected and is reachable but app1 is not, it gives error 404 not found on accessing. I have deployed them by different means: app1 - is deployed using ANT. I...

Create build.xml file independant of the location of the libraries on a computer

eclipse,java-ee,ant,build
In order to generate a war file , I've created a build.xml file via eclipse. The build.xml is as shown below: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- WARNING: Eclipse auto-generated file. Any modifications will be overwritten. To include a user specific buildfile here, simply create one in the same directory with...

How to include a Java command in ANT to run the project

java,ant
How to include a Java command in ANT to run the project. I have searched the net and all examples creates a jar and then run it. I don'nt want to use a jar. I tried using below code, it is giving error that Java tag is not complete. My...

IBM MobileFirst Add envirnment via ant script

ant,mobilefirst,mobilefirst-cli
Is there a way to add environment (android,windows and IOS) using ant with the help of any jar Files. Like we create .wlapp,.war and .adpater files with the help of worklight-ant-builder.jar I can do this via mfp CLI but i need to do it with out MFP CLI installed in...

MobileFirst Platform native iOS app building have error while building .wlapp

ios,ant,mobilefirst
I am working on MobileFirst Platform version7 using ant script to build the project .war, .wlapp, .adapter. Everything was working fine while our project was a hybrid one. Now the project is migrated to native-iOS in. I am using following code to build .wlapp. <target name="build-wlapp"> <app-builder worklightServerHost="localhost:10080" applicationFolder="//Users/admin/Documents/workspace/NewProj/apps/Try" environments="iOSnative"...

Ant: Unable to get Ant to copy properties file to classes directory

java,ant,build,war
I have a project which I can build and deploy correctly using Ant I want to build a war file to deploy the project. I can get everything working except I cannot get the properties file to appear in the classes directory. My properties file is located here: /h/a/A/I/S/src/Serv/log4j.properties This...

Setting JDK & ANT in Eclipse Luna

java,eclipse,windows,ant,java-8
In my Eclipse IDE, I'm interested in setting my default JDK & ANT to the one's I have installed on my machine(Windows 8.1 64x). Can anyone provide reasons why I may or may not want to do this, & how it would be done? Thanks.

Calling Ant Macrodef from Gradle

ant,gradle,build.gradle,macrodef
I can't seem to find a way to list and/or call an Ant Macrodef from within my Gradle script. The Gradle User Guide talks about Macrodefs but does not provide an example anywehere. Could anyone tell me how to accomplish this? At the moment I import the Ant build by...

SQL data export

excel,ant
I have the below script to execute SQL file. <target name="dataExcel" > <sql classpath="/ojdbc14.jar" driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:orcl" userid="scott"password="tiger" src="/generateData.sql" /> </target> Is it possible to spool data to Excel file? I need to automate SQL data export to Excel using script. Edit 1 <project name="xlsx task"> <taskdef name="xlsx" classname="net.sourceforge.ant4x.biz.ms.XlsxTask" classpath="PATH/TO/ant4x.jar"/> <target...

How to execute ant and close the command prompt using Runtime.getRuntime().exec()

java,batch-file,command-line,ant,processbuilder
I want to execute an ant file from java. So i decided to use Runtime.getRuntime().exec() to achieve this. My java file will looks something like below, Process p = Runtime.getRuntime().exec("cmd /c start ant mytarget -Darg1="+arg1+" -Darg2="+arg2+" ", null, new File("E:/ant_demo")); System.out.println("Ant file executed"); ... ... .. System.out.println("Completed"); My goal is...

building cassandra test cases failing

ant,build,cassandra
I am trying to build cassandra binaries from source and when I try to compile unit test cases, some of them give me errors. I tried versions 2.0.14, 2.1.4 and 2.1.5 with ubuntu 14.04 and Java 7 as well as Java 8. This is the message I get after building...

Gradle ant ftp error: “425 Connection timed out”

ant,gradle,upload,ftp,gradlew
I have a problem with my gradle build script: apply plugin: 'java' /* * Sources: * http://stackoverflow.com/q/17201815/4490015 * https://github.com/Vazkii/Botania/blob/master/build.gradle */ repositories { mavenCentral() } configurations { ftpAntTask } /* * Load configuration file. */ ext.priv = parseConfig(file('private.properties')) /* * Some project properties */ version = '0.0.1' group = 'randers.notenoughvocab' archivesBaseName...

Specifying filenames for ant junit batchtest

ant,junit
I have a working ant-task that runs me a batch of junit-tests, in the following fashion: <junit printsummary="yes" showoutput="yes" haltonfailure="no"> <formatter type="plain" /> <classpath> <path refid="app.compile.classpath" /> <path id="classes" location="${app.classes.home}" /> <path id="test-classes" location="${app.build.home}/test-classes" /> </classpath> <batchtest fork="no" todir="${app.tests.reports}"> <fileset dir="${app.tests.home}"> <include name="**/*Test*.java" />...

Error executing ant :-bash: ant: command not found

java,linux,bash,ant
I am trying to deploy my application in a Linux box, I have a file called setAppPath.sh file as: #!/bin/sh APP_HOME=`pwd` ANT_HOME=$APP_HOME/lib/ant echo $ANT_HOME PATH=$ANT_HOME/bin:$APP_HOME/scripts/unix:$PATH echo $PATH chmod +x $ANT_HOME/bin/ant chmod +x $APP_HOME/scripts/unix/*.sh export APP_HOME ANT_HOME PATH When I try to execute ant command I get an error message as:...

Using ant.replace in gradle

replace,ant,gradle
I want to use ant's replace task to replace token in one of the files like this: version.txt version.number=${versionNumber} build.gradle task writeVersion { ant.replace { file 'version.txt' token 'versionNumber' value '1.0.0' } } but it is giving me following error :- A problem occurred evaluating root project '1.01-Exercise-RunYourFirstTask'. > replace...

Ant build should wait for a child process to complete

java,ant
Hi I am new to ant and I have written a target which spawns a child process . Here I want the ant to wait until the child process is completed. How can I do that ? Can anyone please help me <target name = "buildtarget" depends="load-props"> <property name="targetname" value="build"/>...

Invoke multiple build scripts from single build script ? build.xml

java,xml,ant,build.xml
I have 3 build scripts, each creates a jar file. build1.xml -> build1.jar build2.xml -> build2.jar build3.xml -> build3.jar How to call all these build scripts from a single build.xml ? Tried below script(build.xml), but it always calling only 1 script (build1.xml) and creates build1.jar and flow exit. Not processing...

Running an Ant target under certain conditions

ant
I have the following Ant targets in my project.xml: <target name="to.run.under.conditions"> </target> <target name="deploy1"> <antcall target="deploy2"/> </target> <target name="deploy2"> <antcall target="to.run.under.conditions"/> </target> <target name="another.target"> <antcall target="deploy1"/> </target> My intent is to be able to exclude the target to.run.under.conditions when running another.target. I am not very familiar with ANT and I...

Cannot compile Java adapter using adapter-builder task (ANT) in MFP v7

java,ant,mobilefirst,mobilefirst-adapters
We have been using the adapter-builder task (com.worklight.ant.builders.AdapterBuilderTask) to compile our MFP adapters for several weeks. We just started now adopting Java adapters in our MFP apps but we cannot compile them with the adapter-builder task. Looking at the compilation errors in the output, it seems the adapter-builder task does...

Worklight WAR ant configuration to include the Java files

ant,worklight
I'm using WL 6.2.0.1 and one of our projects contains a Java files inside the WL server directory. When I do the build for war file through eclipse I follow the following steps: 1- Right click on the project name > Build Project. 2- Right click on the project name...

How to import existing Ant build.xml into IntelliJ IDEA

java,ant,intellij-idea,build.xml
I have an existing project that uses an Ant build.xml file to maintain the location of dependency jars. In Eclipse it's very easy to import from an existing Ant file. I have searched online and looked through all of the "new project" options in IntelliJ but cannot figure out how...

How to import a variable value from txt file in ant?

ant,cmd
I am relatively new to Ant, I have written an ant build file that will open command prompt in windows 7 and pass an argument line. So how would I pass a variable in this argument line whose value it will get from a txt file in a certain folder?...

Ant script for svn folder is not working

svn,ant
I am new to svn, I want to delete the folder inside the svn tag repository. My ant script to do this as follows: <target name="commit_delete" depends="delete"> <svn javahl="false" svnkit="${svnkit}" username="${svnant.repository.user}" password="${svnant.repository.passwd}"> <commit message="conflicted file" dir="E:\SVN_NutansT\tags" /> </svn> </target> <target name="delete"> <svn> <delete> <fileset dir="E:\SVN_NutansT\tags\2015_05_07_11_28_29_pa_Deploy" includes="**/org.junit*/**" />...

How to convert alfresco ant based project in alfresco5 maven based?

maven,ant,alfresco,alfresco-share
I am using alfresco 4.1.3 having following project structure. I am using the ant script to build project. Now I want to convert this project into maven based alfresco5. I have configured alfresco5 using all-in-one archetype and I am able to run it successfully. My questions are: How can I...

Ant Test Compile Crashes

testing,ant,junit,build,compilation
I am trying to compile a class named TestsVorgabe wich represents a testsuite including five other tests. It works fine with normal JUnit testing, but when i try to compile it with ant i get an error: cannot find symbol Project structure like this: project/src => Classes project/test => TestClasses...

How to run java files that I have mentioned in my testng xml?

java,ant,testng
I have a testng.xml file and a build.xml file. I want to know how can we write code in build.xml file which can run all java files that I have mentioned in my testng.xml file?

prompt user for input in ant and take action based on input

ant
I would like to be able to prompt an user for input during the execution of ant. Pseudo code for what I am trying to do is: echo "Enter y or n:" read yorn if [ $yorn = 'y' ] then echo "$yorn" > /tmp/junk fi Here is what I...

how to use excludesfile/includesfile in ant zip task

java,ant,zip
I need to specify a list of specific files to exclud but when I try something like excludesfile="file1, file2" I get an error executing the task saying: C:\Users.....\Desktop\testProject\project.build.xml:49: Excludesfile C:\Users......\Desktop\testProject\file1, file2 not found. Here is my code: <target name="jar" depends="common.jar"> <zip destfile="${jar.build.dir}/some-jar.jar" basedir="${base.dir}" includes="src/**,gradle/**" excludesfile="file1,file2"> </zip> </target> ...

MobileFirst app build - failed creating temporary directory to build adapter

ant,mobilefirst
I have working command line build setup for my MobileFirst application. However today when I ran a build, I got following error: BUILD FAILED C:\...\build.xml:29: Failed creating temporary directory to build adapter What might be the cause of this error? I'm running the build via ant: ant build Relevant part...

Unable to see test result for python scripts on jenkins

python,ant,jenkins
I have written automation test scripts using pytest framework and I am trying to run the scripts using ant build on jenkins. Please help me see my test result: 1) I have done all the installations on jenkins (python 2.7, pytest, py, pip) 2) Here is the ant build.xml file...

javadoc Illegal package name

ant,gs-collections
I am trying to build this project https://github.com/goldmansachs/gs-collections . Built with: ant -buildfile build.xml However I get the following error: [javadoc] javadoc: error - Illegal package name: "/home/bionix/Desktop/gs-collections/collections-api/target/generated-sources/java/com/gs/collections/api/block/function/primitive/CharFunction.java.crc" [javadoc] javadoc: error - Illegal package name:...

Blackberry config.xml is different in Worklight build methodologies

eclipse,ant,blackberry,worklight
I'm building our BB10 environment in Worklight using two different ways. 1- Through Eclipse IDE: The config.xml in the native folder which has been generated after building the environment contains all the feature that we need in our project. <?xml version='1.0' encoding='utf-8'?> <widget id="MobileBanking" version="1.0.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" rim:backButton="exit"> <name>Mobile Bank</name>...

Ant debug and ant release failed

java,android,eclipse,ant,compilation
I am trying to generate apk on command line using ant. I am able to use ant clean but for ant debug and ant release command I am getting following error. BUILD FAILED C:\Android\sdk\tools\ant\build.xml:649: The following error occurred while executing this line: C:\Android\sdk\tools\ant\build.xml:694: Execute failed: java.io.IOException: Cannot run program "C:\Workspace\SampleApp\${aapt}":...

ant LinkageError without includeantruntime

java,ant,junit
How can I prevent the AntClassLoader and URLClassLoader from causing a linkage error? Due to an older project, junit and hamcrest.core are put into ANT_HOME and our build uses includeantruntime=true in order to run unit tests. I am now working on a project built with ant where I don't want...

Bundle java app for mac distribution

java,eclipse,osx,oracle,ant
I've been trying to create a .app for Mac using Oracle's appbundler. I created a sample javaFX code with just a button displayed on the scene. The following is my Main class. Main.java package app; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.stage.Stage; public class Main extends Application { private...

Groovy Attach multiple files with AntBuilder mail

java,ant,groovy,antbuilder
I've got the below code. My problem is I want to send zero (or more) files, and I'm not sure how to do it. Ant requires you to set a base directory for your fileset, but for this method I don't know what that would be. How can I add...

Ant exec command argument dealing with multiple files

java,ant,less,exec
I am using ant exec command to implement the less utility to view the source code of a bunch of .java files. (I know that there are other ways to do this like using concat) So the call ant view works if I specify only one file: <target name="view"> <exec...

how do you run ant

java,ant
I am trying to build a jar file using ant like this: CLASSPATH=/files/hadoop-core-1.0.4.jar CFLAGS=-m64 CXXFLAGS=-m64 ant compile-native tar I keep getting this error: Error: Could not find or load main class org.apache.tools.ant.launch.Launcher ant --execdebug show this: exec "/usr/java/jdk1.8.0_25/bin/java" -classpath "/usr/bin/build-classpath: error: JAVAVER_LIBDIR /usr/share/java-1.8.0 does not exist or is not a...

How to connect to Tomcat7 JMX over SSL using catalina-ant?

ant,tomcat7,jmx
I have configured Tomcat JMX over SSL (similar to this Getting JMX working under Tomcat 7 with SSL and a self-signed cert) Now I am trying to execute jmx:open or jmx:get according to the following documentation: https://tomcat.apache.org/tomcat-7.0-doc/monitoring.html Unfortunately, I cannot specify the trust store and therefore I get the following...

Cordova build fails, can't find ${appt}

android,cordova,ant
The command cordova build android fails with the following output BUILD FAILED F:\Programs\SDK\tools\ant\build.xml:597: The following error occurred while executing this line: F:\Programs\SDK\tools\ant\build.xml:649: The following error occurred while executing this line: F:\Programs\SDK\tools\ant\build.xml:694: Execute failed: java.io.IOException: Cannot run program "F:\code\asistenciaBT\platforms\android\CordovaLib\${aapt}" (in directory "F:\code\asistenciaBT\platforms\android\CordovaLib"): CreateProcess error=2, El sistema no puede...

Any way to write Ant Script to enter multiple input from directory and run them in parallel

ant,mobilefirst
I want to write a script which takes input from directory all the adapters and build the adapters in parallel. I just want a generic script which works with every mobile first code to build adapters. <target name="build-adapter"> <dirset id="check" dir="/Users/admin/Documents/workspace1/MyTime/adapters" includes="*"/> <property name="test" refid="check"/> <echo>${test}</echo> <parallel> <adapter-builder folder="/Users/admin/Documents/workspace1/MyTime/adapters/${test}"...

continuously watch files for changes

ant
I am new to Ant and I am trying to figure out how to create a target that would allow me to use ant to watch a set of files for changes and run specific ant commands when a change occurs. So far I have this <target name="watch"> <outofdate> <sourcefiles>...

Apache Ant - program output accompanied by “[java]” tags

java,ant
A stupid question, but I couldn't find an answer anywhere. Currently learning Apache Ant and I started by making a very basic build file and java project that prints a line of string to the console. This is what is outputted when I used the command ant compile jar run...

Generate JAXB episode file with Gradle anttask

ant,gradle,jaxb,build.gradle
I set up a gradle task to generate java classes from XSD files: ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.jaxb.asPath) ant.jaxbTargetDir = jaxbTargetDir ant.xjc(destdir: '${jaxbTargetDir}', package: 'com.example') { schema(dir:'/home/bruckwald/proj/schema/xsd', includes: '*.xsd') } How can I pass the argument -episode my.episode to the ant task so that the episode file will be...

what is the process of the running the java files that are present in testng xml using ANT

java,ant,testng
I want to know the process of running the java files that are mentioned in testng.xml using ANT. Do we have to compile those java files first and then run it? Or the testng ANT task takes care of compiling and running? I have gone through the testng ANT task...

ant build file terminating tag error

java,xml,ant,termination
I am trying to run an ant build file for a java jar. For some reason, whenever I try to run ant run, it comes back and says, "Element of type target must be terminated by the matching </target> tag" This seems strange because I see that I do have...

JRebel Eclipse External Jetty Deployment w/o Maven

eclipse,maven,ant,jrebel,jetty-9
New to JRebel here. Is there anyway to run JRebel deployment without Maven? I could run using Ant build.xml to deploy into the webapps folder of Jetty but then it has to be manually trigger. Any suggestions? ...

ANT: Build Failed: failed to create task or type testng:

selenium,ant,build
<project name="name" default="test" basedir="."> <!-- Define <testng> task --> <taskdef resource="testngtasks"> <classpath> <pathelement location="/lib/testng-6.8.5.jar"/> </classpath> </taskdef> <property name="testdir" location="test" /> <property name="srcdir" location="src" /> <property name="libdir" location="lib" /> <property name="full-compile" value="true" /> <path id="classpath.base"/> <path id="classpath.test"> <fileset...

How to create an executable jar file from terminal

java,ant
How does one properly build a java .jar file out of java source code. After some research, it seems the build tool ant is among those considered a best practice for configuring the manor in which the .java source files are built into .class files and ultimately stored in a...

Unexpected top level exception: bad class file magic, in Android

java,android,intellij-idea,ant
I am trying to compile my android program via command line, using ANT. And the code compiles fine. But when the target -dex is executed, I get the following error: [dex] input: /Users/aditya/Desktop/workspace/Java/Play/bin/classes [dex] input: /Library/Java/Android/tools/support/annotations.jar [dex] Using Pre-Dexed annotations-5bd0afe28d834ceff67df1063f0f145b.jar <- /Library/Java/Android/tools/support/annotations.jar [dex] Converting compiled files and external libraries into...

Running an executable from a different working directory using ant

ant
Is it possible to run an executable from ant using a working directory other than the one which contains the executable? This small ant project demonstrates what I'm trying to achieve. Folder structure ant test | build.xml | bin | | debug | | | program.exe | | release |...

Eclipse is saying “Missing builder” and there's no way to configure it

eclipse,java-ee,ant
I'm trying to configure my projects to build with jdk 1.6. The problem is that when I removed 1.7 from my computer, my projects show up as having "Missing builder (org.eclipse.vjet.eclipse.core.builder). And trying to build them shows "The specified JRE does not exist" There's no option to configure which JRE...

How to send a war file on to a Windows machine location through Ant build.xml file

java,windows,ant,jsch
I have setup an environment where all my process of svn checkout/updating, compiling, making war, creating required environment are done using the Ant build.xml. I am also willing to deploy the built war file through the Ant build.xml. I am successful in using the build.xml to deploy applications on to...

Eclipse Ant classpath configuration useless

java,eclipse,ant
A simple question for any Eclipse project using Ant. In the Ant configuration for my project's build.xml (Right click on build.xml > Run as... > Ant build...), in the Classpath tab, I add the JARs I need. When executing the build, during the javac task, the JARs' classes and packages...

compiling cassandra test cases failing

ant,build,cassandra
I am trying to build cassandra binaries from source and when I try to compile unit test cases, one of them fails. I am build cassandra-2.1.4 with Java 8. These are the commands I run: ant -Dfile.encoding="UTF-8" ant test ant artifacts Failure details: [junit] Testsuite: org.apache.cassandra.tools.SSTableExportTest [junit] Tests run: 8,...

Creating an ANT macro to combine two properties file

ant,properties-file,build.xml
Suppose that I have two properties file (say a.properties and b.properties) which contains key value pair. How to write ANT task to create a new properties file (say c.properties) which contains the key value pair of both these files(a and b). Please help.

Running parameterized Junit Test from Ant throws IllegalArgumentException

ant,junit
I'd like to run the JUnit tests in our project from the command line using an Ant target. Up until now we ran the tests manually from Eclipse without any issues using the embedded JUnit in Eclipse. After finally having figured out how the set the classpath I now get...

Ant junit on gentoo fails

java,ant,junit,gentoo,ant-junit
I'm trying to build JOGL on gentoo and have installed all ant packages I could find, yet the build keeps failing with: test.compile.javase.generic: [javac] Compiling 138 source files to /home/zubzub/git/jogl/build/test/build/classes [javac] /home/zubzub/git/jogl/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java:305: error: package org.apache.tools.ant.taskdefs.optional.junit does not exist [javac] org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] { [javac] ^ [javac]...

Any way to make Groovydoc remove (selected) package qualifiers as per Javadoc's 'noqualifier' option?

ant,groovy,javadoc,groovydoc
I've just started generating Groovydoc for a library I'm working on. However, the preponderance of java.lang and java.util and other common package prefixes in the method signatures is obscuring the real intent of the methods. I'd like to be able to generate the Groovydoc without these. As in the (made...

Build Solr with custom version string

ant,solr,solr4
I've modified a patch for Solr 4.10.4, I have it working, and I can successfully compile and package it. I now want to customize the version to indicate that it's not vanilla Solr. I've looked though the ant build configurations, but I haven't been able to find the actual version...

Compile NetBeans project from command line by using Ant

java,netbeans,ant
I have a NetBeans project I would like to compile from the command line. There are many other questions on StackOverflow about how to do so, but they explain how to compile the project using commands like javac src/*.java. I haven't changed my NetBeans project's build settings. By default, how...

How to pass parameters from Java FX Ant task to Inno Setup?

ant,javafx,inno-setup
I am new to JavaFX and only have some basic knowledge about Ant. At the moment I am learning how to use the FX Ant tasks to deploy an application. Edit: By using <fx:deploy nativeBundles="exe" ../> Ant automaticly uses Inno Setup to create a setup file with the .exe extension....

Ant base directory up one level

ant
In ant build, how to specify a directory which is one level up from base directory. I need to do this because I will be calling some libraries common to all projects.

Compile with ant classpath issue with JUnit

java,ant,junit,jar,compilation
I am having a compile issue with ant, junit.jar cannot be found here is my build file: <path id="lib"> <fileset dir="library"> <include name="*.jar" /> </fileset> </path> <target name="test"> <mkdir dir="tmp/reports" /> <mkdir dir="tmp/build" /> <javac srcdir="test" destdir="tmp/build" includeantruntime="false"> <classpath refid="lib" /> </javac> <echo message="Build done" /> <junit fork="yes" haltonfailure="yes"> <batchtest...

How to extract the first element from a : separated String in ANT

string,ant
I need to extract the tokens separated by ':' from the string ./src:./.apt_generated: and get the individual tokens as list elements. I tried using the concept in this example as below ( tried some variations using dirsep, filesep etc. ). None of those worked. How can I get the desired...

Via Windows command line, how can we compile a Netbeans C/C++ application?

c++,netbeans,command-line,ant,compilation
Let's take this simple C/C++ application Netbeans project folder. In Netbeans IDE, we just hit build button on the toolbar to build the application. I want to do that automatically via Windows command line, how can I do that? I did google, and found some related posts though not very...

how to call web services with ant build.xml [duplicate]

svn,ant
This question already has an answer here: How to call a web service from Ant script or from within Jenkins? 4 answers I am using ANT for svn purpose.Now I want to call my restful webservice inside build.xml and use it response for further process.Can anyone help me its...

Why Ant add an equal character in properties file

encoding,ant,properties-file
I have a some given properties file like this : firstvalue=1 secondvalue=hello I use this Ant script to change a value : <propertyfile file="A.properties"> <entry key="firstvalue" value="2" /> </propertyfile> After executing the script, the properties file is now : #Wed, 20 May 2015 11:42:46 +0200 = firstvalue=2 secondvalue=hello I understand...

Why won't maven-antrun-plugin run?

maven,ant,maven-3,maven-antrun-plugin
I'm having trouble getting the antrun plugin to run. I have this configuration in my pom: <project> ... <build> ... <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.4</version> <executions> <execution> <phase>compile</phase> <goals><goal>run</goal></goals> <configuration> <target> <echo message="Hello, maven"/> </target>...

How to “inherit” from a target in ant

ant
I have an target of the following form <target name="runTool" depends="build"> <java className="ToolMain" fork="true" clonevm="true" failonerror="true"> <arg......> <jvmarg.....> .... </target> I want to add an additional target for the debug path, which has all other args same as this one but an additional arg to listen on the debug port....

Heroku Deploy of Java app fails using Ant Buildpack

java,heroku,ant
I'm trying to deploy the following app to Heroku: https://github.com/raeffu/ch.bfh.bti7081.s2015.Blue/ I'm using the Ant Buildpack. After executing $ git push heroku master the build is successful and then this error message appears at the end of the log: remote: BUILD SUCCESSFUL [.....] remote: -----> Discovering process types remote: Procfile declares...

Jmeter remote Execution — Is there any way to provide global property from ant?

ant,jmeter,jmeter-plugins,jmeter-maven-plugin
In my Jmeter script I'm using property function i.e. ${__P(varName,2)} to specify variable value at run time. When Executing script from CMD -- I can specify property value using -JvarName (i.e. -JvarName=5) and for remote Execution I can specify value using -GvarName (i.e. -GvarName=5) from CMD. Now I'm trying to...

Adding jar file to add class in a java project using ant command line

java,android,ant,jar,import
I have looked for hours on the net but could not find an answer to the following question(s)... I have an android project that runs OK using "ant release" command line (for various reasons I cannot use Eclipse nor Android Studio, etc.) on MacOSX. I need to extend a 3rd-party...

Ant: deploy folders with files inside

ant,intellij-idea
I am using Ant deployment in IntelliJ, and got the following issue. In the configuration deploy.xml file there is the following snippet <fileset id = "folder_local" dir = "folder_server"> <include name = "*.*"/> </fileset> so that when I do deployment, it copies all the files from the root of folder_local...

JUnit 4.11 not showing parameter value but index

java,eclipse,ant,junit
We have a project with a number of JUnit testclasses that has been using the Eclipse internal JUnit implementation until recently. In order to run our tests from the ant build script we have changed the build path for our project to use an external junit-4.11.jar and the required hamcrest-core...

How to test for operating system in ant build

ant,build
It seems the only reliably provided property by ant is the "os.name" property. However this name has variants ;lie "Windows 8" "Windows 7" etc But for my purposes both are "Windows" - Is there a way to conditionally set a property based on a partial string match of another property...

How do you set a java.security.policy in Maven pom.xml (coming from Ant)?

java,maven,ant,pom.xml
In Maven, where would I set the security policy as shown in this Ant build.xml... <target name="runComputer" description="Run a computer"> <java classname="system.Computer" fork="true"> <jvmarg value="-Djava.security.policy=policy"/> </java> </target> ...if my pom.xml includes this profile: <profile> <id>manager</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId>...

ANT Conditions task with regex match in a file

regex,ant
I'm reading the ANT Conditions task and trying to figure out how to use it based on a string found in one file. I have an ANT build with series of replaceregexp targets that it runs on any .htm files in a directory. So I specify the fileset dir, then...

Ant places stacktraces in standard output

java,logging,ant,stderr
I am using Ant, together with tasks I have created myself. When those custom ant tasks fail, their output is redirected to stdout. I want them to be redirected to stderr. A simple full generic Ant example is : <project name="test" default="init" basedir="."> <!-- Initialise project parameters --> <target name="init">...

ant xmlbean task behavior differs from Oracle HotSpot to IBM J9

java,ant,jvm-hotspot,j9
I have ant xmlbean task that works fine under HotSpot 1.8 but fails under IBM J9 with exception IO Error java.nio.charset.UnmappableCharacterException: Input length = 1 How may I fix that? Here is my ant task: <target name="gen"> <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="cpth" /> <xmlbean destfile="./ttt.jar" classpathref="cpth"> <fileset dir="C:\projects\whatever" includes="1.xsd 2.xsd conf.xsdconfig"/>...

How do you determine within Ant whether verbose is enabled?

ant,verbosity
Within an ant build.xml, I want to influence a child process's verbose flag based on whether ant itself was run with verbose enabled. Is there a variable set to determine this? Or otherwise, can I parse the raw Ant command line somehow to check whether -v is passed?

iframe tag doesn't work in latest version of Ionic

android,angularjs,ant,ionic-framework,ionic
I followed this tutorial for the Ionic framework to learn how to build an app: https://thinkster.io/ionic-framework-tutorial/ and it worked great. Then I started adding features, like a page with an iframe tag in it, and it worked too in the android emulator. But when I went to build my own...

Ant / Ivy checking existing dependencies before contacting remote repository

java,ant,ivy
I want ant/ivy to check first if the dependencies are already downloaded, and only use ivy to resolve missing dependencies. In other words, I don't want ivy to contact remote repositories if all the dependencies have already been resolved and downloaded. How do I configure this behavior? This would be...

I need to fail the build when a package imports from another package within the same project. How can I do so cleanly?

java,ant
For a variety of reasons (regardless of whether or not this is a wise idea) we have a project with several packages (say one, two, three) that are similar in structure. There is one additional common package. I want the build to fail when something in each of those packages...

How to explain this ant build file?

android,ant
I create ant build.xml for my android project using android.bat. Now I found those code in build.xml: <!-- if sdk.dir was not set from one of the property file, then get it from the ANDROID_HOME env var. This must be done before we load project.properties since the proguard config can...

how do you download files via ant though proxy [duplicate]

java,maven,ant,proxy
This question already has an answer here: Ant GET task and proxy 1 answer I am using ant which uses an build.xml file. This is the command: java version : 1.8.0 ant version: 1.7.1 CLASSPATH=/app/hbase-0.94.27/lib/hadoop-core-1.0.4.jar CFLAGS=-m64 CXXFLAGS=-m64 ant compile-native tar it hangs here: Buildfile: build.xml ivy-download: [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar...

Cannot ant runtime in Apache nutch 2.3

java,apache,ant,nutch
I followed this tutorial https://wiki.apache.org/nutch/Nutch2Tutorial. When I tried to run ant runtime I was getting this message BUILD FAILED /usr/local/nutch/framework/apache-nutch-2.3/build.xml:113: The following error occurred while executing this line: /usr/local/nutch/framework/apache-nutch-2.3/src/plugin/build.xml:35: The following error occurred while executing this line: /usr/local/nutch/framework/apache-nutch-2.3/src/plugin/build-plugin.xml:117: Compile failed; see the compiler error output for details. This is on...

Netbeans build.xml to execute when using Ant

ant,build,execute,build.xml
I'm relatively new to using build files and Ant to compile and execute from a command line so i wanted to know how it would be possible to modify the build-impl.xml file auto generated from netbeans so that after it compiles it also executes the program. Currently when i type...

Copy subdirectories if they contain a specific file in Ant

xml,recursion,ant,condition
Really new to Ant and I have been trying to figure that out but could not... Let say I have a structure like that : Root |-data |-dir1 |-include.xml |-subdir1 |-file1 |-file2 |-include.xml |-subdir2 |--dir2 |-file1 |-include.xml |--dir3 |--dir4 |-file1 |-include.xml |--dir5 |-build.xml |-other files I'd like to copy the...

Triggering a Git fetch, reset using Jenkins

java,eclipse,git,ant,jenkins
I am in need of an urgent help and any guidance from anyone out there would be really appreciated. Please find below the use-case that I am trying to accomplish here: I have a Java package which is checked in Git (and code.amazon.com) and I have a Ant job to...

Error in running XSLT reports using ANT

java,eclipse,xslt,ant,selenium-ide
I have my Eclipse selenium project with few classes in it,I want to view the test reports in XSLT, my project has been complied and ran successfully through ANT, however when I try to run makexsltreports (either through Eclipse or through ANT command prompt am getting the below error: C:\Automation\Automation\build.xml:89:...

Moving a command to the background halfway through execution in Bash

osx,bash,shell,ant
I'm working on a bash script that starts multiple other shell scripts some of which terminate on their own, some of which run indefinitely until terminated. I'm looking for a way to move the execution of one of these subprocesses to the background only after a certain line of output...

Java - Check properties file at compile time

java,maven,ant,properties
I need some advices from you today. I am working on a project which uses a huge constants holding class. There are lots of public static final String CONST_NAME = "const_value"; I am getting those using MyConstClass.CONST_NAME but now I need to externalise them in order to configure the project....

(SOLVED) Java build path error in cocos2dx 3.6

java,ant,path,android-ndk,cocos2d-x
I migrated from cocos2dx 3.1.1 to 3.6 yesterday. And when I make new project and build in eclipse, I get the following error: could not open 'C:\Program Files (x86)\Java\jre7\lib\i386\jvm.cfg This isn't simple problem. I have quadraple checked environment variables. Although all of my environ variable is on E:\, build_native is...

ANT if else tasks approach [duplicate]

java,ant,build
This question already has an answer here: Use pure Ant to implement if else condition (check command line input) 2 answers I had a query regarding ANT if else tasks. After browsing lot of stuff, i understood that we dont have direct if else tasks in ant. My Requirement...

Is there a way for one ant script to check if another is already running?

ant,build-process
We have several automated build scripts, some of which are run automatically every 2 hours, and some of which are only ever run manually. If a build script is started manually while another is already running, it can cause...problems. Such as merging untested branches into the production branch. I'd like...

GnuPG for Java library ant build issue/bug

java,ant,cryptography,gnupg
I'm working GnuPG Java API to encrypt/decrypt files. Googled and found a Java Wrapper GnuPG for Java, Java wrapper for GPGME(GnuPG Made Easy,C language library). Official website also referring this as the Java wrapper. So followed the instructions, set up ant and tried to run ant clean release it is...

ant unzip task: Why does it not fail, if unzipping fails?

ant,groovy,unzip
I use the groovy AntBuilder in a custom written installer, eg. to unpack the installation package. One thing I cannot figure out, is how to detect, whether the unzip task failed, eg. I have the following code: ... AntBuilder antBuilder = new AntBuilder() antBuilder.mkdir(dir:installationPath) antBuilder.unzip(src:zipFileName, dest:installationPath,overwrite:"yes") ... If the destination...