Gradle War Plugin Change output WAR filename
By:Roy.LiuLast updated:2019-08-17
In Gradle, the WAR plugin will generate the final WAR file with the following pattern:
${baseName}-${appendix}-${version}-${classifier}.${extension} Example : hello. 1.0 .war |
To change the default WAR filename, update war.archiveName. For example :
build.gradle
project( ':web' ) { apply plugin: 'war' war { archiveName 'hello-gradle.war' dependencies { compile project( ':core' ) providedCompile 'javax.servlet:servlet-api:2.5' providedCompile 'org.apache.tomcat:tomcat-jsp-api:7.0.55' //... |
Build it…
$ gradle :web:war |
Output, a hello-gradle. war file will be generated in the following folder :
{project}\web\build\libs\hello-gradle.war |
References
From:一号门
RELATED ARTICLES
- Gradle How to skip unit test
- Gradle bootstrap class path not set in conjunction with -source 1.5
- Gradle Create a Jar file with dependencies
- Gradle Spring 4 MVC Hello World Example
- Ant Spring MVC and WAR file Example
- Gradle Application Plugin APP_HOME in applicationDefaultJvmArgs
- Gradle Create Java project structure automatically
- Gradle – Spring 4 MVC Hello World Example Annotation
- Gradle eclipse plugin unable to attach source code
- Maven webxml attribute is required
- Gradle JaCoCo Incompatible version 1006
- How to use Gradle Wrapper
- Jenkins Could not find GradleWrapperMain
- Gradle Exclude commons-logging from Spring
- Gradle Display test results in Console
- Gradle How to continue build if test is failed
- Gradle How to exclude some tests
- Gradle and JUnit example
- Spring Boot Which main class to start
- Spring Boot Deploy WAR file to Tomcat
COMMENTS