ant

Using ant, find files matching a regular expression and search if a substring in present in the file

瘦欲@ 提交于 2019-12-12 21:15:40
问题 I have a directory containing 2 files: abc_2010-14-12.log abcdef.log I want to search for a substring in the 1st file. But i dont know the exact file name as it has timestamp appended to it. I think i will have to use regular expression in the file name. 回答1: First you must identify the file. You may be able to do that using a normal fileset include: <fileset dir="." id="the.file" includes="abc_????-??-??.log" /> If that might give you a false positive on something like 'abc_XXXX-YY-ZZ.log',

How can I include the Ivy dependency and none of its dependencies?

给你一囗甜甜゛ 提交于 2019-12-12 21:07:14
问题 I have spent the last few weeks in off-time trying to get Ivy going with Ant. I have it set up mostly but I've run into a road-block with depenencies. Because I was using Ant I had a /lib folder with the 32 jar files that my app used, some in-house, some proprietary (I've added both of these types to our Nexus) and some Open Source. Then I added 32 dependency lines to my Ivy.xml file. When I run, I get it trying to pull down LOTS of dependencies of those files from Nexus but I know I don't

Java compiler under Eclipse/Ant defaults to %JAVA_HOME%?

社会主义新天地 提交于 2019-12-12 21:04:49
问题 I recently encountered a build environment behavior that I need to better understand: Overview of my freshly installed workstation: Installed jdk1. 6 .0_45, then jdk1. 7 .0_80, then jdk1. 8 .0_131. %JAVA_HOME% is set to C:\Program Files\Java\jdk1.8.0_131\ Installed Eclipse Kepler (4.3.2) I then manually (by way of unzipping) added to C:\Program Files\Java the following: jdk1. 7 .0_45, jre1. 7 .0_76, jre1. 7 .0_79. Checked out a legacy Ant-based project, designed to run under JRE7 only. My

How do I control which tests to run in testng from ant?

流过昼夜 提交于 2019-12-12 20:56:22
问题 In build.xml: the testng target has attributes like "testname" and "suitename". But these do not seem to activate or deactivate the corresponding tests or suites within the testng.xml file Is this the right way to use these? How can I control which tests or suites are run from within build.xml that references testng.xml? Thanks. 回答1: I found this post to solve a similar problem: http://www.nullin.com/2009/12/23/running-single-test-or-class-using-testng-and-ant/ As long as you can fit

Publish a Maven artifact to a local Ivy repository, recursively with its dependencies

心已入冬 提交于 2019-12-12 20:26:50
问题 I have to mirror a set of dependencies to my company-local Ivy repository. I currently need to publish Hibernate Spatial 4.0-M1 . From my Eclipse project, I can only resolve Ivy dependencies if I enable remote repository <ibiblio name="hibernate-spatial" m2compatible="true" root="http://www.hibernatespatial.org/repository"/> (and exclude a few dependencies from dependencies.xml ), which other developers don't have as they retrieve only from LAN. So I ended up putting the JAR into the publish

how to use ant-contrib tasks in eclipse auto content assist

落爺英雄遲暮 提交于 2019-12-12 20:25:05
问题 I have Eclipse Ganymede and would like to use the auto content assist feature for ant . I have the ant-contrib-1.0b3.jar with me. What configuration is required in eclipse to use auto content assist which can include tasks for ant-contrib as well? When I use the following the ant can recognize tasks for ant-contrib but content assist doesn't work? <!-- Define classpath for ant-contrib tasks --> <path id="ant.contrib.classpath"> <fileset dir="/path/to/lib/"> <include name="ant-contrib-1.0b3

Configuration of build.xml file for Sonar modules with Ant

醉酒当歌 提交于 2019-12-12 20:24:48
问题 I am setting up a Sonar project (using the delphi plugin), for simplicity sake assume there are two modules I want to report on. Each module is in it's own sub-folder and each has it's own build.xml file. At this point I can successfully run the sonar tasks and generate reports for each module as an independent project. My problem is with configuring the "master" build.xml file. The module build.xml file looks like this: <?xml version="1.0"?> <project name = "CRM" default = "sonar" basedir =

Ant objects and references: what is the scope of a reference's ID?

久未见 提交于 2019-12-12 20:14:45
问题 Seems odd that there is no documentation about it (at least no documentation that I'm aware of; and I'll be happy to stand corrected). When I do this: <fileset id="my.fs" dir="..."/> What is the scope of the ID my.fs ? The entire Ant execution cycle? The current target (and any target that depends on the current target)? And, lastly, what happens if multiple threads (spawned using the parallel task) attempt to define filesets with the same ID? 回答1: References are visible across the project in

How do I create a new Java project, without existing source files, with the ability to manually edit the Ant script using NetBeans

蓝咒 提交于 2019-12-12 19:56:12
问题 It seems like it's a fairly common thing to do. I want to create a new Java application that does not have any existing source files, but be able to edit the Ant scripts. 回答1: You should be able to edit any Ant file that Netbeans generates as part of a new project. They're stored in the project folder (the one that contains the nbproject directory) as build.xml, which in turn references build-impl.xml. The idea is that you can edit build.xml in order to override the Ant targets in build-impl

Ant Download a Jar at Build

我怕爱的太早我们不能终老 提交于 2019-12-12 19:29:33
问题 I'm trying to integrate forbiddenapis check into my project. I've defined that: <target name="forbidden-checks" depends="clean, runtime, test"> <ivy:cachepath organisation="de.thetaphi" module="forbiddenapis" revision="2.2" inline="true" pathid="classpath"/> <taskdef uri="antlib:de.thetaphi.forbiddenapis" classpathref="classpath"/> <forbiddenapis classpathref="all-lib-classpath" dir="${build.dir}" targetVersion="${javac.version}"> <bundledsignatures name="jdk-unsafe"/> <bundledsignatures name