ant

How to check if a property exists?

荒凉一梦 提交于 2020-01-22 13:18:06
问题 How do I check the existence of a property using Ant? I am open to the use of ant-contrib , if Ant doesn't provide a similar thing. Also, ant-contrib has an assert task, which provides exists , but the assertion is not what I need here since I would prefer a boolean return value. 回答1: You can use the Condition task with an isset condition. <project default="test"> <property name="a" value="a"/> <target name="test"> <condition property="a.set" else="false"> <isset property="a"/> </condition>

Quotes appearing on CSV after concatnate fields using Groovy

假装没事ソ 提交于 2020-01-21 19:12:42
问题 I'm using groovy to concatenate two fields in CSV It's working ok except that the concatenated field is appearing with quotes. Is there any way to resolve this? ant.mkdir(dir:"target") new File("target/UpsertCheckDeals.csv").withWriter { new File("C:/Users/alon/Documents/CheckDealReadyForConcat.csv").splitEachLine(",") {Customer__c,Name__c,Deal__c,Check_Count__c -> it.println "${Customer__c},${Deal__c},${Deal_Source__c},${Salesperson_Name__c},${Customer__c}-${Deal__c}" 回答1: CSV is a more

JDBC COPY with ant

随声附和 提交于 2020-01-21 18:54:46
问题 I have a project with Spring, Hibernate and PostgreSQL and have to use ANT to create schema with data: <sql driver="org.postgresql.Driver" classpath="src/main/webapp/WEB-INF/lib/postgresql-9.1-901.jdbc4.jar" url="jdbc:postgresql://localhost:5433/postgres" userid="postgres" password="pw123" autocommit="true" src="src/main/sql/dbbackup.sql"> </sql> but I get this error: C:\Users\<user>\<workspace>\<Project>\antdb.xml:22: org.postgresql.util.PSQLException: ERROR: COPY from stdin failed: The JDBC

JDBC COPY with ant

我只是一个虾纸丫 提交于 2020-01-21 18:54:30
问题 I have a project with Spring, Hibernate and PostgreSQL and have to use ANT to create schema with data: <sql driver="org.postgresql.Driver" classpath="src/main/webapp/WEB-INF/lib/postgresql-9.1-901.jdbc4.jar" url="jdbc:postgresql://localhost:5433/postgres" userid="postgres" password="pw123" autocommit="true" src="src/main/sql/dbbackup.sql"> </sql> but I get this error: C:\Users\<user>\<workspace>\<Project>\antdb.xml:22: org.postgresql.util.PSQLException: ERROR: COPY from stdin failed: The JDBC

ant: failed to create task or type

风格不统一 提交于 2020-01-21 04:07:12
问题 (Yes, I've read and played around based on answers to similar questions in this forum and in many others such as JavaRanch--to no avail yet.) I've created a custom ant task according to Apache doc. Running ant, I get: BUILD FAILED /home/russ/blackpearl/fun/build.xml:121: Problem: failed to create task or type sqlscriptpreprocessor Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any <presetdef>/<macrodef

Archiving artifacts not in the workspace when build fails

旧城冷巷雨未停 提交于 2020-01-20 08:42:27
问题 When an ANT build step fails in my build I'd like to archive the logs in order to determine the problem. The relevant logs, however, are not located in the workspace, so I have to use a full path to them. The standard artifact archiving feature does not work well with full paths, so first I have to copy the logs into the workspace within some build step so that I can later archive them. I do not want to incorporate the copying code into the original ANT script (it does not really belong there

Cordova Please Install Android target 19

若如初见. 提交于 2020-01-20 08:07:11
问题 I am using Cordova-3.3.0, and when trying to create a project for Android I am getting this following error - Error: Please install Android target 19 (the Android newest SDK). I have the latest android installed along with the Android 18 and 17. And even if I use Cordova-3.2.0 I get the same result Android target 18 not found . Please can anyone suggest what might be the problem? I am using the following along with cordova - ant version 1.9.2 java 1.7.0_45 回答1: Have you correctly set android

Ivy: how do I remove transitive dependencies?

非 Y 不嫁゛ 提交于 2020-01-19 20:29:22
问题 I'm using Ivy to manage the dependencies on my project. So far, I've specified a dependency on Hibernate and servlet-api. However, the hibernate jar itself has a lot of dependencies that aren't really needed, such as jaas and jacc. This becomes a show-stopper because jaas and jaac are Sun libraries and therefore their licenses forbid to place them in the Maven repos, so Ivy can't find them there. How do I make Ivy download Hibernate but not these two ? As a bonus, if I actually needed those

Ivy: how do I remove transitive dependencies?

老子叫甜甜 提交于 2020-01-19 20:28:58
问题 I'm using Ivy to manage the dependencies on my project. So far, I've specified a dependency on Hibernate and servlet-api. However, the hibernate jar itself has a lot of dependencies that aren't really needed, such as jaas and jacc. This becomes a show-stopper because jaas and jaac are Sun libraries and therefore their licenses forbid to place them in the Maven repos, so Ivy can't find them there. How do I make Ivy download Hibernate but not these two ? As a bonus, if I actually needed those

MAVEN和ANT的区别

半腔热情 提交于 2020-01-19 12:17:20
一.Maven简介 Maven是基于 项目对象模型(POM) ,可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理工具。 目前,绝大多数开发人员都把 Ant 当作 Java 编程项目的标准构建工具。遗憾的是,Ant 的项目管理工具(作为 make的替代工具)不能满足绝大多数开发人员的需要。通过检查 Ant 构建文件,很难发现项目的相关性信息和其它信息(如开发人员/拥有者、版本或站点主页)。 Maven 除了以程序构建能力为特色之外,还提供 Ant 所缺少的高级项目管理工具。由于 Maven 的缺省构建规则有较高的可重用性,所以常常用两三行 Maven 构建脚本就可以构建简单的项目,而使用 Ant 则需要十几行。事实上,由于 Maven 的面向项目的方法,许多 Apache Jakarta 项目现在使用 Maven,而且公司项目采用 Maven 的比例在持续增长。 Maven这个单词来自于意第绪语,意为知识的积累,最早在Jakata Turbine项目中它开始被用来试图简化构建过程。当时有很多项目,它们的Ant build文件仅有细微的差别,而JAR文件都由CVS来维护。于是Maven创始者开始了Maven这个项目,该项目的清晰定义包括,一种很方便的发布项目信息的方式,以及一种在多个项目中共享JAR的方式. 二.Maven常用命令 mvn archetype