I'm using IntelliJ-IDEA Community Edition to generate a war file from a Maven-Project.
When it comes to generate this war file I can't find the war option among the artifacts.
I've tried to:
1) go to File>Project Structure>Artifacts>Type, but WAR is not mentioned;
2) right click on Project Module > add Framework Support, but Web Application is not mentioned (I only have Groovy, Kotlin(Java), Kotlin (JavaScript).
This is my pom.xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mawashi.alex.firstapp</groupId>
<artifactId>firstapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>firstapp</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.7.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--automatic configuration for web applications-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>1.4.1.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugins</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestone</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestone</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
<pluginRepository>
<id>jetty</id>
<url>http://mvnrepository.com/artifact/org.eclipse.jetty</url>
</pluginRepository>
</pluginRepositories>
</project>
How can I move forward?
Click Artifacts to open the Artifacts page. Do one of the following: To use a pre-defined exploded directory artifact, select the <module name>war:exploded artifact from the list on the left-hand pane. If necessary, change the name and output directory of the artifact in the corresponding fields on the right-hand pane.
Build a WAR artifact After IntelliJ IDEA creates the new project, build a WAR artifact to deploy to the application server. From the main menu, select Build | Build Artifacts. In the Build Artifact dialog, select to build the DockerJavaWebApp:war artifact.
With IntelliJ IDEA, you can have the basic application structure automatically set up according to the required standard and get extensive coding assistance at all the stages of Web application development.
The location for WAR files is the webapps directory within your Tomcat installation directory.
You are looking in the correct place (File>Project Structure>Artifacts), but this is not a feature of IntelliJ IDEA Community Edition.
Here's what Artifacts looks like in Ultimate Edition:
Whereas — when I open the same project using Community Edition:
You are going to have to use Maven package directly:
This will output an artefact to your target
folder.
Try this:
Hope this is the solution you were looking for!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With