Environment: macOS, Spring Tools Right-click on the Package Explorer project name.
Run as ⇨ Run Configuration Right click on Gradle Project. Click the Gradle Tasks tab. Write build in the Gradle Tasks: field.
Specify the root folder of the project in the Working Directory field. Click Run at the bottom right.
Then
Project root / build / libs
The project name.jar is created in.
(Trying below) Upload to server Upload to any of the above folders.
terminal
java -jar test.jar
When executed with, tomcat built in the jar starts up. Control + c to stop the server But in my case, when I ran it, the app started up and seemed to work, and when I accessed the page, there was no response.
Change the menu when creating a new project or the place where jar is specified in build.gradle to war. in build.gradle
build.gradle
apply plugin:'war'
war {
enabled = true
archiveName 'sample.war'
}
Add Refresh gradle and open configuration with the same procedure as for jar
Write war in the Gradle Tasks: column. Then in the same way
There is a war file in the project root / build / libs.
Recommended Posts