What is the best way to avoid maven-jar?

In Maven 3.0.x (I tried 3.0.2) you can disable maven-jar-plugin by binding the default-jar execution to a nonexistent phase, as @bmargulies suggested. Unfortunately that doesn’t work in 2.2.1, but you can prevent it from interfering with your own jar by setting an alternative <finalName> and <classifier> for the default-jar execution; it will still create a … Read more

Ant path style patterns

Ant-style path patterns matching in spring-framework: The mapping matches URLs using the following rules: ? matches one character * matches zero or more characters ** matches zero or more ‘directories’ in a path {spring:[a-z]+} matches the regexp [a-z]+ as a path variable named “spring” Some examples: com/t?st.jsp – matches com/test.jsp but also com/tast.jsp or com/txst.jsp … Read more

Cannot find Main Class in File Compiled With Ant

Looks like your runtime classpath is missing the jar containing the class org.supercsv.io.ICsvBeanReader. The gotcha is that you cannot set the classpath from the command-line when calling an executable jar. You have to set it within the manifest as follows: <target name=”dist” depends=”compile” description=”Generates distributable”> <!– creates the distribution directory –> <mkdir dir=”${dist}/lib” /> <!– … Read more

good ivy tutorial for local repository? [closed]

Creating a local ivy repository is straight forward, maven is not required. Here’s an example of publishing some text files using ivy as a standalone program. I have 3 files I want to publish: src/English.txt src/Spanish.txt src/Irish.txt The ivy file src/ivy.xml details the name of the module and a list of the artifacts being published. … Read more

Replacing characters in Ant property

Here is the solution without scripting and no external jars like ant-conrib: The trick is to use ANT’s resources: There is one resource type called “propertyresource” which is like a source file, but provides an stream from the string value of this resource. So you can load it and use it in any task like … Read more

Class not found with Ant, Ivy and JUnit – error in build.xml?

Example Project contains the following files: ├── build.xml ├── ivy.xml └── src ├── main │   ├── java │   │   └── org │   │   └── demo │   │   └── App.java │   └── resources │   └── log4j.properties └── test └── java └── org └── demo └── AppTest.java Build runs as follows: $ ant Buildfile: /home/mark/Files/Dev/ivy/demo/build.xml resolve: [ivy:resolve] … Read more

Ant: How to execute a command for each file in directory?

Use the <apply> task. It executes a command once for each file. Specify the files by means of filesets or any other resource. <apply> is built-in; no additional dependency needed; no custom task implementation needed. It’s also possible to run the command only once, appending all files as arguments in one go. Use the parallel … Read more

Error installing Ant: ANT_HOME is set incorrectly

It sounds like you have it setup right. What happens if you try something like this, which worked for me: C:\>set ANT_HOME=C:\apache-ant-1.8.1 C:\>set JAVA_HOME=C:\jdk1.6.0_24 C:\>set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin C:\>ant -version Apache Ant version 1.8.1 compiled on April 30 2010 This also worked for me by setting up environment variables, like so: