Commit 183a2095 authored by Matt Benson's avatar Matt Benson Committed by Phillip Webb

Fixup sample Ant build

Fixes gh-3324
parent f8fdcc13
...@@ -2,19 +2,20 @@ ...@@ -2,19 +2,20 @@
<description> <description>
Sample ANT build script for a Spring Boot executable JAR project. Uses ivy for dependency management so run with Sample ANT build script for a Spring Boot executable JAR project. Uses ivy for dependency management so run with
'$ ant -lib ivy-2.2.jar' (substitute the location of your actual ivy jar). Run with '$ java -jar target/*.jar'. '$ ant -lib ivy-2.2.jar' (substitute the location of your actual ivy jar). Run with '$ java -jar target/*.jar'.
</description> </description>
<property name="spring-boot.version" value="1.2.5.BUILD-SNAPSHOT" /> <property name="spring-boot.version" value="1.2.5.BUILD-SNAPSHOT" />
<property name="start-class" value="org.springframework.boot.sample.actuator.SampleActuatorApplication" /> <property name="start-class" value="org.springframework.boot.sample.actuator.SampleActuatorApplication" />
<property name="lib.dir" location="${basedir}/lib" />
<target name="resolve" description="--> retrieve dependencies with ivy"> <target name="resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve pattern="lib/[conf]/[artifact]-[type]-[revision].[ext]" /> <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" />
</target> </target>
<target name="classpaths" depends="resolve"> <target name="classpaths" depends="resolve">
<path id="compile.classpath"> <path id="compile.classpath">
<fileset dir="lib/compile" includes="*.jar" /> <fileset dir="${lib.dir}/compile" includes="*.jar" />
</path> </path>
</target> </target>
...@@ -30,14 +31,19 @@ ...@@ -30,14 +31,19 @@
<delete dir="target/classes" /> <delete dir="target/classes" />
</target> </target>
<target name="clean-all" description="cleans all created files/dirs"
depends="clean">
<delete dir="${lib.dir}" />
</target>
<target name="build" depends="compile"> <target name="build" depends="compile">
<copy todir="target/classes/lib"> <copy todir="target/classes/lib">
<fileset dir="lib/runtime" /> <fileset dir="${lib.dir}/runtime" />
</copy> </copy>
<jar destfile="target/spring-boot-sample-actuator-${spring-boot.version}.jar" compress="false"> <jar destfile="target/spring-boot-sample-actuator-${spring-boot.version}.jar" compress="false">
<fileset dir="target/classes" /> <fileset dir="target/classes" />
<fileset dir="src/main/resources" /> <fileset dir="src/main/resources" />
<zipfileset src="lib/loader/spring-boot-loader-jar-${spring-boot.version}.jar" /> <zipfileset src="${lib.dir}/loader/spring-boot-loader-jar-${spring-boot.version}.jar" />
<manifest> <manifest>
<attribute name="Main-Class" value="org.springframework.boot.loader.JarLauncher" /> <attribute name="Main-Class" value="org.springframework.boot.loader.JarLauncher" />
<attribute name="Start-Class" value="${start-class}" /> <attribute name="Start-Class" value="${start-class}" />
...@@ -45,4 +51,4 @@ ...@@ -45,4 +51,4 @@
</jar> </jar>
</target> </target>
</project> </project>
\ No newline at end of file
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<conf name="runtime" extends="compile" description="everything needed to run this module" /> <conf name="runtime" extends="compile" description="everything needed to run this module" />
</configurations> </configurations>
<dependencies> <dependencies>
<dependency org="org.springframework.boot" name="spring-boot-loader" rev="1.0.0.BUILD-SNAPSHOT" conf="loader->default" /> <dependency org="org.springframework.boot" name="spring-boot-loader" rev="${spring-boot.version}" conf="loader->default" />
<dependency org="org.springframework.boot" name="spring-boot-starter-web" rev="1.0.0.BUILD-SNAPSHOT" conf="compile" /> <dependency org="org.springframework.boot" name="spring-boot-starter-web" rev="${spring-boot.version}" conf="compile" />
<dependency org="org.springframework.boot" name="spring-boot-starter-actuator" rev="1.0.0.BUILD-SNAPSHOT" conf="runtime" /> <dependency org="org.springframework.boot" name="spring-boot-starter-actuator" rev="${spring-boot.version}" conf="compile->compile;runtime->runtime" />
</dependencies> </dependencies>
</ivy-module> </ivy-module>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment