Ant – how to get all files’ name in a specific folder

You’re on the right track, use manifestclasspath task. The jarfile attribute is used to create relative links to the jars contained in the fileset. <manifestclasspath property=”jar.classpath” jarfile=”${client_work_dir}/HelloWorld.jar”> <classpath> <fileset name=”” dir=”${client_work_dir}/lib” includes=”*.jar”/> </classpath> </manifestclasspath> <jar jarfile=”${client_deploy_dir}/HelloWorld.jar” basedir=”${client_work_dir}/compiled”> <manifest> <attribute name=”Main-Class” value=”HelloWorld.Main”/> <attribute name=”Class-Path” value=””${jar.classpath}”/> </manifest> </jar>

integrating JaCoCo in sonar using Ant

The following is an ANT build that is configured to run a junit unit test and use jacoco for code coverage reporting. The results are uploaded to Sonar and finally ivy is used to download 3rd party jars and manage classpaths. Example ├── ├── build.xml ├── ivy.xml └── src ├── main │   └── java … Read more

Make ant quiet without the -q flag?

One option might be to set the logging level from within the target. You can access loggers by means of a short script task. Something like: <target … > <script language=”javascript”> var logger = project.getBuildListeners( ).firstElement( ); logger.setMessageOutputLevel( 0 ); </script> … </target> I’m not familiar with how Eclipse calls Ant, but it might be … Read more

Generate manifest class-path from in Ant

<path id=”build.classpath”> <fileset dir=”${basedir}”> <include name=”lib/*.jar”/> </fileset> </path> <pathconvert property=”manifest.classpath” pathsep=” “> <path refid=”build.classpath”/> <mapper> <chainedmapper> <flattenmapper/> <globmapper from=”*.jar” to=”lib/*.jar”/> </chainedmapper> </mapper> </pathconvert> <target depends=”compile” name=”buildjar”> <jar jarfile=”${basedir}/${test.jar}”> <fileset dir=”${build}” /> <manifest> <attribute name=”Main-Class” value=”com.mycompany.TestMain”/> <attribute name=”Class-Path” value=”${manifest.classpath}”/> </manifest> </jar> </target> For further information check out this article.

Ivy, what is the master configuration and why is it not pulling jvyaml?

I would suggest restructuring your configurations as follows: <ivy-module version=”2.0″> <info organisation=”com.myspotontheweb” module=”demo”/> <configurations> <conf name=”compile” description=”Libraries needed only for compilation” /> <conf name=”runtime” description=”Libraries only needed at runtime” extends=”compile” /> <conf name=”test” description=”Libraries only needed for testing” extends=”runtime” /> </configurations> <dependencies> <dependency org=”” name=”jvyaml” rev=”0.2.1″ conf=”runtime->default” /> <dependency org=”org.apache.solr” name=”solr-core” rev=”3.6.0″ conf=”runtime->default” /> </dependencies> … Read more

Ant to Maven – multiple build targets

You could do this with profiles… If you really wanted to use two separate profiles and customize the JAR plugin to include and exclude patterns of class and package names, you could easily do this by putting something like this in your POM: <profiles> <profile> <id>everything</id> <build> <plugins> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <classifier>everything</classifier> <includes> <include>**/*</include> </includes> … Read more

How do I use Nant/Ant naming patterns?

The rules are: a single star (*) matches zero or more characters within a path name a double star (**) matches zero or more characters across directory levels a question mark (?) matches exactly one character within a path name Another way to think about it is double star (**) matches slash (/) but single … Read more

comparing databases and generating sql script using liquibase

Obtaining the SQL statements, representing the diff between two databases, is a two step operation: Generate the XML “diff” changelog Generate SQL statements Example This example requires a file (simplifies the command-line parameters): classpath=/path/to/jdbc/jdbc.jar driver=org.Driver url=jdbc:db_url1 username=user1 password=pass1 referenceUrl=jdbc:db_url2 referenceUsername=user2 referencePassword=pass2 changeLogFile=diff.xml Now run the following commands to create the SQL statements: liquibase diffChangeLog … 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