如果通过Maven管理依赖项,有没有办法编译,构建,运行测试并使用Ant创建runnable jar?
案例是服务器只有Ant。
这样的脚本: How do I run JUnit tests during my Ant build script while omitting test classes from my resulting jar?在接受的答案中。
如何指定库的位置?
答案 0 :(得分:0)
这里的一些文档:http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-build-an-executable-archive-with-ant。样本构建配置从那里:
<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>