简体   繁体   中英

Ant build of maven spring boot project

Is there any way to compile, build, run test and create runnable jar with Ant if the dependency is managed through Maven?

The case is that server has only Ant.

Script like this one: How do I run JUnit tests during my Ant build script while omitting test classes from my resulting jar? in the accepted answer.

How to specify where are the libraries located?

Some docs here: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-build-an-executable-archive-with-ant . The sample build config from there:

<target name="build" depends="compile">
    <copy todir="target/classes/lib">
        <fileset dir="lib/runtime" />
    </copy>
    <jar destfile="target/spring-boot-sample-actuator-${spring-boot.version}.jar" compress="false">
        <fileset dir="target/classes" />
        <fileset dir="src/main/resources" />
        <zipfileset src="lib/loader/spring-boot-loader-jar-${spring-boot.version}.jar" />
        <manifest>
            <attribute name="Main-Class" value="org.springframework.boot.loader.JarLauncher" />
            <attribute name="Start-Class" value="${start-class}" />
        </manifest>
    </jar>
</target>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM