Comments (9)
You should be able to set the WAR file via the following:
tasks.withType(TomcatRunWar) {
webApp = <your-war-file>
}
from gradle-tomcat-plugin.
Adding the above throws the following error
A problem occurred evaluating root project 'iC'.
Could not find method withType() for arguments [task ':tomcatRunWar', build_8a9r4tsfqjq9meq9akmu6803e$_run_closure28@11e80ef] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
I have it written as so
tasks.withType(tomcatRunWar){
dependsOn 'build_notest'
webApp = 'build/dist/iC.war'
}
from gradle-tomcat-plugin.
So you can either configure all tasks of type TomcatRunWar
(capital T):
tasks.withType(TomcatRunWar) {
dependsOn 'build_notest'
webApp = 'build/dist/iC.war'
}
Or you can configure just the task instance (if it does exist):
tomcatRunWar {
dependsOn 'build_notest'
webApp = 'build/dist/iC.war'
}
For more general information on configuring tasks, I'd suggest you ask on the Gradle forum. That's not really specific to this plugin.
from gradle-tomcat-plugin.
I'm sorry, I am a little confused with your answer. Above you said it would work and then you said it wouldn't? Could you please clarify? Thank you
from gradle-tomcat-plugin.
I think I misread your answer. You stated that it doesn't work for you because of error x. I thought you had said that it did work. Sorry, no coffee yet.
I removed the first sentence in my answer. It should make more sense now.
from gradle-tomcat-plugin.
I am with you on that. Changing the code to
tomcatRunWar {
dependsOn 'build_notest'
webApp = 'build/dist/iC.war'
}
Throws the following error
A problem occurred evaluating root project 'iC'.
Cannot cast object 'build/dist/iC.war' with class 'java.lang.String' to class 'java.io.File'
The other method throws the previous error I listed.
Thanks for the help
from gradle-tomcat-plugin.
The field webApp
is of type java.io.File
so you'll have to assign the right type (see the Javadocs of the task type).
It would have to look as such:
tomcatRunWar {
dependsOn 'build_notest'
webApp = file('build/dist/iC.war')
}
from gradle-tomcat-plugin.
That did the trick. Thank you for your help
from gradle-tomcat-plugin.
Sure thing.
from gradle-tomcat-plugin.
Related Issues (20)
- Daemon does not stop HOT 4
- Gradle Daemon - Caused by: java.lang.Error: factory already defined HOT 2
- Can I tell `TomcatRun` where is the exploded web directory? HOT 1
- Documentation - add example to compile translated jsps HOT 1
- Setting default jsp package name from org.apache.jsp to your choice HOT 2
- Acessing environment variables with the plugin HOT 1
- Gradle 6.2.2 shows deprecation warning regarding jasperAttributes HOT 3
- IllegalArgumentException: The AJP Connector is configured with secretRequired="true" but the secret attribute is either null or "". HOT 7
- How to run the Tomcat server at http://localhost:8080 instead of http://localhost:8080/ProjectName? HOT 2
- Skip Jar Scanning for Annotations HOT 1
- tomcatRun fails with Gradle 7.0 due to @Internal annotation on private getter HOT 11
- 2.6 Release HOT 3
- How to configure environment variables when calling tomcatRun? HOT 1
- Tomcat 10 support
- HTTP2 support
- does this can do like maven tomcat plugin which can build jar not war HOT 1
- Remove usage of WarPluginConvention
- Getting groovy.lang.MissingMethodException after upgrading to tomcat plugin 2.7.0, was using 2.5 before HOT 1
- The AJP Connector is configured with secretRequired="true"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-tomcat-plugin.