DevServer expecting .WAR when I upload the application of .EAR format - java

This application was built 15 years ago, I guess. The client has sought an upgrade/modification of this app, which I am not aware of.
I have built some POM.xml scripts. When I tried to upload it in development server, it was expecting a .WAR file inside the .EAR that I had uploaded.
Here is my pom.xml script. Please suggest some modifications.
<groupId>itaras</groupId>
<artifactId>itaras</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>ear</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>1.0</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<finalName>MyEarFile</finalName>
<version>5</version>
<generatedDescriptorLocation>$D:/itaras/ITARAS_Branch_3Aug2017/itaras/WebContent</generatedDescriptorLocation>
<modules>
<webModule>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<uri>appITARAS.war</uri>
<bundleFileName>appITARAS.war</bundleFileName>
<contextRoot>/ITARAS</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>

You need a parent pom like this :
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>itaras</groupId>
<artifactId>itaras</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>itaras-ear</module>
<module>itaras-war</module>
</modules>
</project>
Then you will have a war project which is a child/module of the parent. This will be your existing project like:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>itaras</groupId>
<artifactId>itaras</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>itaras-war</artifactId>
<packaging>war</packaging>
.....
Then you will have an ear project which will include the war project as a dependency, something like:
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>itaras</groupId>
<artifactId>itaras</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>itaras-ear</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>itaras</groupId>
<artifactId>itaras-war</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

Related

maven wildfly deploy could not resolve dependencies

I have a maven project with two modules : core and webapp.
The webapp module is a war file to be deployed to wildfly. It has a dependency to the core module.
I can run mvn clean package in the parent directory of my modules. I am able to deploy de war file manually to wildfly and it works. Unfortunately if I run mvn wildfly:deploy in the webapp directory I get :
Failed to execute goal on project webapp: Could not resolve dependencies for project gbt:webapp:war:1.0-SNAPSHOT: Could not find artifact gbt:core:jar:1.0-SNAPSHOT
What shall I do to deploy the war file with the wildfly plugin ?
parent pom
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gbt</groupId>
<artifactId>unite_compte</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<version.server.bom>25.0.1.Final</version.server.bom>
<version.microprofile.bom>25.0.1.Final</version.microprofile.bom>
<jakartaee.version>8.0.0</jakartaee.version>
<version.wildfly.maven.plugin>2.1.0.Final</version.wildfly.maven.plugin>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
<dependencyManagement>
<dependencies>
<!-- importing the jakartaee8-with-tools BOM adds specs and other useful artifacts as managed dependencies -->
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>wildfly-jakartaee8-with-tools</artifactId>
<version>${version.server.bom}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>${jakartaee.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<module>core</module>
<module>webapp</module>
</modules>
</project>
webapp pom :
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>gbt</groupId>
<artifactId>unite_compte</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>gbt</groupId>
<artifactId>webapp</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>gbt</groupId>
<artifactId>core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<!--finalName>${project.artifactId}</finalName-->
<finalName>unite_compte</finalName>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
core pom
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>gbt</groupId>
<artifactId>unite_compte</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>gbt</groupId>
<artifactId>core</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>
You need to run mvn install, or the artifact for the core module is built but never installed into the local repository and cannot be resolved when building the webapp module.

install Maven plugin before it is executed

I have one. Parent-module and two Child. One of the child is a plugin I wrote for sending mail to email(mail parameters, themes, text are set in pom.xml), which should be sent during the compilation phase of the parent-module. The second child is just a class with "Hello World".
My question. How do I do in the parent module: install maven plugin before the compilation phase?
p.s. I can not correctly form a question, because a huge request to clarify the nuances in the comments or add the missing information.
upd:
this is child-plugin
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>maven-parent</artifactId>
<groupId>com.live.hello</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>maven-plugin</packaging>
<artifactId>child-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.6.3</version>
</dependency>
</dependencies>
</project>
this is child-app
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>maven-parent</artifactId>
<groupId>com.live.hello</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>child-app</artifactId>
</project>
and parent
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.live.hello</groupId>
<artifactId>maven-parent</artifactId>
<version>1.0.0</version>
<modules>
<module>child-plugin</module>
<module>child-app</module>
</modules>
<packaging>pom</packaging>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.live.hello</groupId>
<artifactId>test1-send</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>my-exe-plugin</id>
<phase>compile</phase>
<goals>
<goal>sendEmail</goal>
</goals>
<configuration>
<loginSeander>my.test#gmail.com</loginSeander>
<passwordSender>11111111</passwordSender>
<mailRecipient>mymail#gmail.com</mailRecipient>
<subject>My first messege</subject>
<text>Hello!</text>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Maven - Put Dependency Into Other Dependency with Maven Assembly Plugin

I have a Maven POM project test-module3 with two dependencies: Dependency test-module1 and dependency test-module2.
Dependency test-module2 has also test-module1 as dependency with scope set to compile, but it does not have the Maven Shade Plugin or the Maven Assembly Plugin configured.
Now I want to build dependency test-module2 using test-module3. So I configure the Maven Assemby Plugin. That works great. But dependency test-module1 is missing in dependency test-module2.
How can I configure the Maven Assemby Plugin or any other plugin of test-module3 so, that it shades test-module1 into test-module2?
Here are my POMs:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>test</groupId>
<artifactId>test-project</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>test-distribution</artifactId>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>test</groupId>
<version>${project.version}</version>
<artifactId>test-module1</artifactId>
</dependency>
<dependency>
<groupId>test</groupId>
<version>${project.version}</version>
<artifactId>test-module2</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
distribution.xml:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>distribution</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
</dependencySet>
</dependencySets>
</assembly>
POM of test-module1:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>test</groupId>
<artifactId>test-project</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>test-module1</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
POM of test-module2:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>test</groupId>
<artifactId>test-project</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>test-module2</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>test</groupId>
<artifactId>test-module1</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
My goal is to put test-module1 in the ZIP folder and test-module2 in the ZIP folder, but test-module2 should also contain test-module1.

My Maven Module isn't generating a JAR

I have the following hierarchy:
my-app
\__ pom.xml
\__ jar-module
\__ pom.xml
\__ webapp-module
\__ pom.xml
\__ core-module
\__ pom.xml
Where core-module acts as a library providing common code for webapp-module and jar-module.
webapp-module works just fine, it's generating a war as expected and the code from core-module is being used.
The problem is with jar-module. I have no idea why, but jar-module isn't outputting a jar, even when I select to run (in IntelliJ IDEA) a simple main with a println() it does run, but there's no jar on the target folder.
How can I solve this and make the jar-module output a jar?
I am not very experienced with Maven, my goal is to be able to use the same Jersey code on a local Glassfish and in a jar to be deployed at AWS Lambda Serverless Java Container so I can easily test it locally before deployment.
I would appreciate any corrections on my hierarchy and on pom errors as well.
my-app pom.xml has a packaging of pom, but core-module and jar-module have a packaging of jar and webapp-module has a packaging of war.
here are the POMs:
my-app POM:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.myapp</groupId>
<artifactId>myapp</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>core-module</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
core-module POM:
(I also tried it with <packaging>pom</packaging> and no jar skip properties, it didn't work)
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>myapp</artifactId>
<groupId>com.example.myapp</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>webservice-core</artifactId>
<packaging>jar</packaging>
<modules>
<module>../jar-module</module>
<module>../webapp-module</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.deploy.skip>true</maven.deploy.skip>
<jar.skipIfEmpty>true</jar.skipIfEmpty>
<maven.install.skip>true</maven.install.skip>
<javax-ws-rs-version.version>2.1</javax-ws-rs-version.version>
<jersey.version>2.26</jersey.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${javax-ws-rs-version.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
</dependency>
</dependencies>
</project>
webapp-module POM:
<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>
<parent>
<artifactId>core-module</artifactId>
<groupId>com.example.myapp</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>webapp-module</artifactId>
<packaging>war</packaging>
<name>webapp Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jersey.version>2.26</jersey.version>
</properties>
<dependencies>
<dependency>
<artifactId>core-module</artifactId>
<groupId>com.example.myapp</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>webapp</finalName>
</build>
</project>
jar-module POM:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>core-module</artifactId>
<groupId>com.example.myapp</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>jar-module</artifactId>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jersey.version>2.26</jersey.version>
<maven-shade-plugin.version>3.1.0</maven-shade-plugin.version>
</properties>
<dependencies>
<dependency>
<artifactId>core-module</artifactId>
<groupId>com.example.myapp</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.amazonaws.serverless</groupId>
<artifactId>aws-serverless-java-container-jersey</artifactId>
<version>0.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
<configuration> <createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
my-app is your parent module and rest are child so provide a dependencies order in parent project pom so that when you build the project ,maven will provide the dependencies as you provided in parent module.
<modules>
<module>core-module</module>
</modules>
Provide the proper ordering like parent and child modules to understand the maven for building.
my-app
<modules>
<module>core-module</module>
<module>jar-module</module>
<module>web-module</module>
</modules>
core-module
no <modules>
This is a clean hierarchy, mirrored by the directory hierarchy.
There is a difference between modules and there container and the parent relation, and other subtleties. So maybe this helps.

Spring boot JSP configuration not working

I followed the sample Git setup here: https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-web-jsp.
When I load the home page it displays resource could not be found. Even when I've cross-checked my configuration and the only difference between the two projects is that one is multi-module, while the other is single module.
And it worked, but for my multi-module maven project the same configuration seems to not be working... is there any explanation to this? I'm also kind of new to maven so I'm assuming it has something to do with the way I have my maven setup configured. The link to my GitHub repo is: https://github.com/diljotr/storm.net.
Relevant links to look at are:
https://github.com/diljotr/storm.net/blob/master/storm.net.app/src/main/java/storm/net/Application.java
https://github.com/diljotr/storm.net/blob/master/storm.net.web/src/main/java/storm/net/controller/HomeController.java
https://github.com/diljotr/storm.net/blob/master/storm.net.web/src/main/java/storm/net/WebApplication.java
Setup outlined below
Parent POM:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>storm.net</groupId>
<artifactId>storm.net</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.0.1.RELEASE</version>
</parent>
<modules>
<module>storm.net.api</module>
<module>storm.net.core</module>
<module>storm.net.web</module>
<module>storm.net.app</module>
</modules>
<properties>
<spring.version>4.0.3.RELEASE</spring.version>
<tomcat.version>7.0.53</tomcat.version>
<!-- Spring Boot build configuration -->
<java.version>1.7</java.version>
<start-class>storm.net.Application</start-class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</plugin>
</plugins>
</build>
</project>
Web Child POM:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>storm.net</artifactId>
<groupId>storm.net</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>storm.net.web</artifactId>
<dependencies>
<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>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/webapp</directory>
</resource>
</resources>
</build>
</project>
App POM that wraps the entire library together
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>storm.net</artifactId>
<groupId>storm.net</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>storm.net.app</artifactId>
<dependencies>
<dependency>
<groupId>storm.net</groupId>
<artifactId>storm.net.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>storm.net</groupId>
<artifactId>storm.net.web</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Follow below Configuration :
In Intellij:
Go to Run Menu -> Edit Configuration -> Working directory: $MODULE_WORKING_DIR$
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp

Categories

Resources