gradle war: how to build jar, not classes

徘徊边缘 提交于 2019-12-24 11:44:42

问题


Gradle war plugin: how to build a jar and add it to war?

projectRoot/
        src/main/java
        src/main/resources
        src/main/webapp
  1. build a jar (foo.jar) from the java source code and resources.
  2. add the jar under the WEB-INF/lib of the war.

    WEB-INF/lib/foo.jar

The war task will not build a jar by default, and add all java classes and resources under WEB-INF/classes.

UPDATE

The War plugin extends the Java plugin to add support for assembling web
application WAR files. It disables the default JAR archive generation of the 
Java plugin and adds a default WAR archive task.

There is a way to enable the Jar generation and let task war depends on task jar?

来源:https://stackoverflow.com/questions/44748067/gradle-war-how-to-build-jar-not-classes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!