ant

run a jar file (generated by ant) in command line

喜欢而已 提交于 2019-12-23 02:41:50
问题 I have a build.xml file that works fine. The problem is that the generated jar file, and I need to run it without 'ant run' How can I run the jar file? running with java -jar Main.jar main.Main gives me: Exception in thread "main" java.lang.NoClassDefFoundError: org/neo4j/graphdb/GraphDatabaseService This is how I'm creating the jar file (build.xml): <target name="jar" depends="compile"> <mkdir dir="${jar.dir}"/> <jar destfile= "${jar.dir}/${ant.project.name}.jar" basedir="${build.dir}">

Generating a faulty report when running JMeter 3.0 test with Ant

眉间皱痕 提交于 2019-12-23 02:32:13
问题 I have been at it for days. Basically I want to create a HTML report from JMeter test file, using Ant. I am using Linux Ubuntu 16.04.1. Here is my build.xml : <project name="performance-tests" default="run-performance-tests" basedir="."> <property name="testpath" value="${user.dir}"/> <poperty name="jmeter.home" value="/home/richard/Asjad/apache-jmeter-3.0"/> <!-- Name of test (without .jmx) --> <property name="test" value="Test"/> <path id="jmeter.path"> <fileset dir="${basedir}" includes="/

ant - uptodate task : regenerate only outdated files

和自甴很熟 提交于 2019-12-23 02:18:32
问题 I'm new to ant and rather used to Makefiles. In a project, the i18n language modules named Message_zh.class etc are built unconditionally from zh.po etc with every compile, although they already exist, which wastes much time. I figured these are the relevant parts of build.xml: <target id="msgfmt" name="msgfmt"> <mkdir dir="po/classes" /> <propertyregex property="filename" input="${file}" regexp="[.]*/po/([^\.]*)\.po" select="\1" casesensitive="false" /> <exec dir="." executable="msgfmt">

ANT Android project to Android Studio

梦想的初衷 提交于 2019-12-23 00:52:43
问题 I have a fully working Android application based on ANT build tools. It is used with Eclipse but I have to make it work with Android Studio as well. I managed to export the project with ADT Gradle Export Tool and the application itself works great. However, I can't get the test project to work. Here's build.gradle generated by Eclipse ADT plugin. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.8.+' } } apply plugin: 'android'

xmlproperty and retrieving property value of xml element if specific attribute is present/set

梦想的初衷 提交于 2019-12-22 18:24:23
问题 My Xml looks like: <root> <foo location="bar"/> <foo location="in" flag="123"/> <foo location="pak"/> <foo location="us" flag="256"/> <foo location="blah"/> </root> For foo xml element flag is optional attribute. And when I say: <xmlproperty file="${base.dir}/build/my.xml" keeproot="false"/> <echo message="foo(location) : ${foo(location)}"/> prints all locations : foo(location) : bar,in,pak,us,blah Is there a way to get locations only if flag is set to some value? 回答1: Is there a way to get

Deploy webapp to Tomcat after Maven build on Jenkins

别说谁变了你拦得住时间么 提交于 2019-12-22 18:12:06
问题 i'm trying to copy the webapp.war to the tomcat's webapp folder after the maven build on the jenkins has finished. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions> <execution> <id>copy-webapp-to-tomcat</id> <phase>install</phase> <goals> <goal>run</goal> </goals> <configuration> <target name="Deploying webapp to Tomcat."> <copy todir="${tomcat.webapps.dir}" force="true"> <fileset dir="${project.build

ant passing all parameters to a java task

牧云@^-^@ 提交于 2019-12-22 18:06:16
问题 Is there a way to pass all ant command-line parameters as properties to a java task ? For example : ant -Dprop1=value1 -Dprop2=value2 ... -file build.xml myTarget <target name="myTarget"> <java classname="MyClass"> <sysproperty ... all properties> </java> </target> So the started jvm will have all properties passed from the ant command-line. Thanks 回答1: Try this: <java ...> <syspropertyset> <propertyref regex=".*"/> </syspropertyset> </java> 来源: https://stackoverflow.com/questions/8659403/ant

How to transform property into multiple arguments to <exec> task

瘦欲@ 提交于 2019-12-22 18:01:57
问题 I have a property that contains multiple values, and I want to execute a command with a separate "-j" argument for each value in the property. E.g. <property name="arguments" value="foo bar hello world"/> Should execute: mycommand -j foo -j bar -j hello -j world I'm using Ant 1.7.1, so I can't use the "prefix" attribute (Ant 1.8) on the <arg> element of an <exec> task. One workaround is to insert the "-j" directly into the property by hand and then use the "line" attribute of <arg> :

Performing Simple Calculations with Native Ant Tasks

浪子不回头ぞ 提交于 2019-12-22 17:28:10
问题 Using only native ANT tasks, how can I create a custom ANT task to do the following: Calculate the the number of days since January 1, 2000 local time and store it in a property. Calculate the number of seconds since midnight local time, divided by 2 and store it in a property. The above property values will then be appended to others and written to a file. 回答1: ANT is not a general purpose programming language, so you need to write a custom task or alternatively use something like the groovy

how to get ivy:cachepath location without checking if dependencies downloaded

你。 提交于 2019-12-22 13:58:25
问题 I have a task in my build.xml : <target name="init" depends="init-ivy"> ... <ivy:cachepath inline="true" module="jersey-container-servlet" organisation="org.glassfish.jersey.containers" pathid="jersey.classpath" revision="2.23.2" /> ... </target> This task downloads ivy if necessary ( init-ivy does that actually) and then invokes ivy to download dependencies. It sets jersey.classpath as the result. Right now my build task depends on the init task. So every time I build, it checks if