Reputation: 19
following a DevOps Course using Jenkins - Maven, steps:
what can i do so Package will be with .war file not .jar file. is there a Configuration i can use. so beginner with Java. grateful with any tips.
Tried to change many pom.xml files. Tried to change configs into pom files. Not much still Beginner for Java.
Upvotes: 0
Views: 605
Reputation: 494
If you want to build a WAR you need two things:
<packaging>war</packaging>
in your pom.xml. If nothing has been specified, Maven assumes the packaging type is a jar.<project>
...
<groupId>com.example.projects</groupId>
<artifactId>documentedproject</artifactId>
<packaging>war</packaging>
|-- pom.xml
`-- src
`-- main
|-- java
| `-- com
| `-- example
| `-- projects
| `-- SampleAction.java
|-- resources
| `-- images
| `-- sampleimage.jpg
`-- webapp
|-- WEB-INF
| `-- web.xml
|-- index.jsp
`-- jsp
`-- websource.jsp
See https://maven.apache.org/plugins/maven-war-plugin/usage.html for more info.
Upvotes: 1