ant

Optional Ant arg

心已入冬 提交于 2019-12-21 05:08:14
问题 I would like to have an ant arg value optionally included without having to make 2 targets which would be basically the same except for the extra arg. For example: <target name="A" depends="C">...</target> <target name="B" depends="C">...</target> <target name="C"> <java fork="true" ...> <jvmarg .../> <arg .../> <arg .../> ... # now, if the dependency is from A, no more args # if from B <arg value="xxx"/> </java> </target> 回答1: Rather than depend ing on task C, you could use the Antcall task

Embed thirdparty JAR using BND

南楼画角 提交于 2019-12-21 04:32:10
问题 I have an OSGi bundle that is built using ANT and the classic BND tool. My bundle uses a library (JAR) internally, which is not available as a bundle within my OSGi container (Apache Felix). So, I am trying to embed it within my bundle , for access at runtime. How can I embed such a library/JAR using ANT+BND? (Note : I cannot use MAVEN, using which this could have been a lot easier) 回答1: You need two instructions in your bnd descriptor. First use Include-Resource to include the target JAR

Stopping a parallel java task with ant

我只是一个虾纸丫 提交于 2019-12-21 04:00:16
问题 I am developing two java programs that run in separate VM's that have a typical server/client relationship. Using ant's parallel/sequential tasks I've been able to get ant to run the server and then the client. I would now like it so that when the client process has stopped, ant kills the server. I've seen this done with custom ant tasks for specific server applications (like TomCat), does any method exist for doing this with generic java processes? 回答1: Since you are developing the server

build PHP with ant scripts

丶灬走出姿态 提交于 2019-12-21 03:49:24
问题 I was just wondering how I use Ant to build my web applications that I have written in PHP? I've googled around a bit and I have seen that it is possible but there are not any examples of the basic idea or any advanced use for them. Can any of you help me out? Thanks! 回答1: While Ant itself is written in java, you can use it to build any kind of applications you want. Here's a basic tutorial and a full manual. Beyond that, you need to clarify what is it you want to do to get a more precise

How to set Ant properties based on variables in Eclipse?

无人久伴 提交于 2019-12-21 03:45:48
问题 I have a common problem and there are probably countless ways to solve it. I'm looking for an elegant, simple solution to this typical scenario: I have a project in Eclipse with an Ant build file (build.xml) the build file uses a property file (build.properties). In that property file, I want to set a property that points to the root directory of the eclipse project such as: project.root = /path/to/eclipse/workspace/projectName or preferably: project.root = ${path.to.eclipse.workspace}

ant: warning: unmappable character for encoding UTF8

老子叫甜甜 提交于 2019-12-21 03:39:58
问题 I have seen numerous of questions like mine but they don't answer my question because I'm using ant and I'm not using eclipse. I run this code: ant clean dist and it tells me numerous times that warning: unmappable character for encoding UTF8 . I see on the Java command that there is a -encoding option, but that doesn't help me cuz I'm using the ant. I'm on Linux and I'm trying to run the developer version of Sentrick; I haven't made no modifications to anything, I just downloaded it and

Schema export with hibernate annotations

与世无争的帅哥 提交于 2019-12-21 03:38:12
问题 I'm using hibernate annotations and i want to export my database schema. Similar to the schemaexporttask with hbm xml files. 回答1: Indeed, the original Hibernate Core SchemaExportTask can only handle Hibernate XML mapping files, not annotations. What you need is the HibernateToolTask that comes with Hibernate Tools. Here is an Usage example adapted from Java Persistence With Hibernate: <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project

Is there a way to generate ant file local.properties without overwriting build.xml?

做~自己de王妃 提交于 2019-12-21 03:24:09
问题 I've generated ant build.xml for my android project, using android update project --name <project_name> --target <target_ID> --path path/to/your/project/ (according to http://developer.android.com/guide/developing/other-ide.html) and then modified my build.xml (some custom code is there). So my build.xml is in the VCS. But in order to perform a build I need local.properties file, which is also generated by android update project and so build.xml gets overwritten. local.properties is not to be

How to recompile with -Xlint:unchecked in Ant build task?

两盒软妹~` 提交于 2019-12-21 03:22:11
问题 When I run the "compile" target of my Ant "build.xml" file, then I get the following message: Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. My compile target is the following: <target name="compile"> <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" debuglevel="lines,source" includeantruntime="false"> <classpath refid="class.path" /> </javac> <javac srcdir="${test.dir}" destdir="${classes.dir}" debug="true"

How to define suppressions-definitions for checkstyle, that work with both ant and eclipse

寵の児 提交于 2019-12-21 01:19:12
问题 I use in a project checkstyle and I have defined a SuppressionFilter in my checkstyle-configuration. I use Apache ant to make automatic builds via Continuous Integration. My problems comes from the following situation: I don't want to fill to much files into the project-basedir, so the checkstyle.xml and the suppressions.xml are both in a subdirectory named conf (for configuration for build). Now Ant and Eclipse work differently for finding the suppressions.xml. Ant use the project-basedir as