Spring boot application - Tomcat deployment - maven

I'm having problems deploying my spring boot application to tomcat, although works well from my IDE.
I followed the instructions from https://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html
But as a result I got a war package containing only framework libs and web classes, nothing from my core module.
I'm not sure if my pom files are correct.
Structure of my project look like that:
portal
-web
-src
pom1.xml
-core
-src
pom2.xml
pom0.xml
project pom (pom0.xml):
<modules>
<module>core</module>
<module>web</module>
<module>tests</module>
</modules>
<packaging>pom</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
web module pom (pom1.xml):
<parent>
<artifactId>portal</artifactId>
<groupId>com.portal</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>web</artifactId>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>com.portal</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
core module pom (pom2.xml)
<parent>
<artifactId>portal</artifactId>
<groupId>com.portal</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>core</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.custom.api</groupId>
<artifactId>common-utils</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
UPDATE1
More detailed structure:
-web
-com.portal.web
-controller
IncidentController
ComputerController
...
-core
-com.portal.core
-domain
Incident
Computer
...
mvn clear package gives that error:
[INFO] portal ............................................. SUCCESS [ 0.700 s]
[INFO] core ............................................... SUCCESS [ 2.478 s]
[INFO] web ................................................ FAILURE [ 0.458 s]
[INFO] tests .............................................. SKIPPED
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project web: Compilation failure: Compilation failure:
[ERROR] /.../portal/web/src/main/java/com/portal/web/controller/IncidentController.java:[4,37] package com.portal.core.domain does not exist
[ERROR] /.../portal/web/src/main/java/com/portal/web/controller/IncidentController.java:[5,38] package com.portal.core.service does not exist
[ERROR] /.../portal/web/src/main/java/com/portal/web/controller/IncidentController.java:[18,19] cannot find symbol
[ERROR] symbol: class IIncidentService
[ERROR] location: class com.portal.web.controller.IncidentController
...

Add the "web module" to the modules section of the parent "portal module":
<modules>
<module>core</module>
<module>api</module>
<module>tests</module>
<module>web</module>
</modules>
Run mvn clean packagein the folder of the parent "portal module".

The solution for multi module project is to configure Boot's repackaging to apply a classifier to the jar:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Full description of the problem is here

Related

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test (default-test) on project

I have just created a Spring Boot Maven Application with Kotlin and MongoDB in IntelliJ. The Maven command build mvn clean install fails to run maven-surefire-plugin tests and generates error SurefireBooterForkException:
Error while executing forked tests.Error while executing process.Cannot run program "/bin/sh": error=2, No such file or directoryorg.apache.maven.surefire.shade.common.org.apache.maven.shared.utils.cli.CommandLineException: Error while executing process.
My pom.xml file:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.project</groupId>
<artifactId>project-backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>project-backend</name>
<description>Backend for project</description>
<properties>
<java.version>11</java.version>
<kotlin.version>1.6.10</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${project.parent.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
</args>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
I have tried the following:
mvn clean install -U or right-click on "project" Go to "Maven" >> "Update"
Enabling the system classloader in maven-surefire-plugin
I'm new to Spring Boot, Maven and IntelliJ.
UPDATE:
I added the following to maven-surefire-plugin:
<configuration>
<forkCount>0</forkCount>
</configuration>
Then the Maven build is successful. Why is this working??
Probably it's just a bug, as said here.
As documentation says
The parameter forkCount defines the maximum number of JVM processes that maven-surefire-plugin will spawn concurrently to execute the tests.
So, to resolve the issue, try to choose another JDK or downgrade your JDK or use the solution you specified.

how to deploy spring boot app with external jar and jar packaging

My application is running on localhost successfully ,but When I deploy my application on AWS server ,it is unable to run online. I have an external JAR of paytm-checksum-2.0 . What should I do for deployment of my Spring Boot application with external JAR?
I have converted into my application to one jar file but I am unable to deploy it...
File pom.xml is
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>Spring-payment-integration</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Spring-payment-integration</name>
<description>Payment integration with paytm</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I do not see see this custom jar in your pom.xml, you might have added it to your IDE configurations(or any other method which only works locally) so although it might work locally on remote this jar won't be present and you won't be able to reference it.
From what I see this is the official jar: https://github.com/Paytm-Payments/Paytm_Web_Sample_Kit_Java/tree/master/Java%20Kit%201.8
However, it does not seem to be there on the paytm artifacts hosted on maven: https://mvnrepository.com/artifact/com.paytm. So you have 2 options now:
Add the jar to a nexus repo, or to a public repo(like maven) and reference it from there, this is quite complicated(https://www.baeldung.com/install-local-jar-with-maven/)
You can package this custom jar with your springboot jar.
a. Add it to your project location.<file>${basedir}/dependencies/PaytmChecksum.jar</file>
b. Now add this to your pom
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>install-Transformation lib</id>
<phase>clean</phase>
<configuration>
<file>${basedir}/dependencies/PaytmChecksum.jar</file>
<repositoryLayout>default</repositoryLayout>
<groupId>org.paytm</groupId>
<artifactId>paytmchecksum</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
c. Clean the project mvn clean
d. Now reference the file using
<dependency>
<groupId>org.paytm</groupId>
<artifactId>paytmchecksum</artifactId>
<version>1.0</version>
</dependency>
e. build it using mvn clean install
The packaged jar will now contain your Paytm jar.

Error in the pom.xml generated by Spring Initializr

I'm using Spring Tool Suite, and I want to make a REST API with Kotlin, Spring and Maven, but my pom.xml has an error after create the project via Spring Initializr. My "parent" tag raise an error, but I guess the problem come from the kotlin-maven-plugin. I can't figure what's wrong with this pom.xml. If someone could help me fixing this, I'll be grateful!
Here's my pom.xml:
<?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>fr.asi</groupId>
<artifactId>api_kotlin_test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>api_kotlin_test</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<kotlin.version>1.2.51</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
</args>
<compilerPlugins>
<plugin>spring</plugin>
<plugin>jpa</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-noarg</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
And I have this error:
Project configurator "org.jetbrains.kotlin.maven.projectConfigurator" required by plugin execution "org.jetbrains.kotlin:kotlin-maven-plugin:1.2.51:test-compile (execution: test-compile, phase: test-compile)" is not available. To enable full functionality, install the project configurator and run Maven->Update Project Configuration.
I add a property in the pom.xml as below:
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
After adding this property, just save your pom.xml and update your project. The error should be resolved.
Below is a snippet from the pom.xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.in28minutes.learning.jpa</groupId>
<artifactId>jpa-in-10-steps</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>jpa-in-10-steps</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
I removed the error by adding a "plugingManagement" tag to enclose the "plugins" tags like following:
<pluginManagement>
<plugins>
.......
</plugins>
</pluginManagement>
Note: This changing just removed the error, but I'm still unable to run the code (the "Run as Kotlin Application" option in Eclipse doesn't exist in my case.) I'm not sure if those errors are related, but I can't confirm they're not.
Edit: I just avoid this issue by switching my IDE to IntelliJ IDEA, it seems that the Kotlin plugin of Eclipse is not perfect for now... All is fine now, and the "pluginManagement" tag is useless now.

Failed to collect dependencies error at org.springframework.boot during Maven Build

Source of project:- Microservices with Spring, Angular and Kafka
System info: Windows 10 machine with Eclipse IDE.
I am trying to build backend-service folder. I am getting error for Maven given as shown below.
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:14 min
[INFO] Finished at: 2018-06-19T18:22:40+05:30
[INFO] Final Memory: 17M/489M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project backend-service: Could not resolve dependencies for project poc.microsvc-angular:backend-service:jar:0.1.0: Failed to collect dependencies at org.springframework.boot:spring-boot-starter-data-jpa:jar:1.3.5.RELEASE -> org.hibernate:hibernate-entitymanager:jar:4.3.11.Final: Failed to read artifact descriptor for org.hibernate:hibernate-entitymanager:jar:4.3.11.Final: Could not transfer artifact org.hibernate:hibernate-entitymanager:pom:4.3.11.Final from/to public (https://globalrepository.mclocal.int/artifactory/public): connect timed out -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>poc.microsvc-angular</groupId>
<artifactId>backend-service</artifactId>
<version>0.1.0</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath />
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<docker.plugin.version>0.3.258</docker.plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<!-- Setup Spring Data JPA Repository support -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
<dependency>
<groupId>poc.microsvc-angular</groupId>
<artifactId>microservice-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.10</version>
<configuration>
<imageName>microsvc-angular/${project.name}</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<skipDockerBuild>false</skipDockerBuild>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
What is the problem?
Is it server problem or dependency hierarchy problem?
Or is it a corrupt jar ?(I tried deleting, still does not work)

error during build EAR file in Maven

I'm facing the followinf issue :
Failed to execute goal
org.apache.maven.plugins:maven-ear-plugin:2.7:generate-application-xml
(default-generate-application-xml) on project UserAdminEAR:
Artifact[war:com.syril.administration:UserAdmin] is not a dependency
of the project. -> [Help 1]
what is the solution for this kind of error?
my pom.xml is
<modelVersion>4.0.0</modelVersion>
<groupId>UserAdminEAR</groupId>
<artifactId>UserAdminEAR</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>UserAdmin</name>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>com.syril.dao</groupId>
<artifactId>dataAccess</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.syril.service</groupId>
<artifactId>UserAdminService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.7</version>
<configuration>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<jarModule></jarModule>
<javaModule>
<groupId>com.syril.dao</groupId>
<artifactId>dataAccess</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</javaModule>
<webModule>
<groupId>com.syril.service</groupId>
<artifactId>UserAdminSL</artifactId>
<contextRoot>/UserAdminSL</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
You will have to add the war as a dependency to the project too, not only in the plugin configuration.
<project ...>
<modelVersion>4.0.0</modelVersion>
<groupId>com.syril.administration</groupId>
<artifactId>UserAdminEAR</artifactId>
<version>YOUR_VERSION_HERE</version>
<packaging>ear</packaging>
<dependencies>
<!-- some other dependencies here -->
...
<!-- Here is the dependency to the war that is referenced in the ear plugin -->
<dependency>
<groupId>com.syril.administration</groupId>
<artifactId>UserAdmin</artifactId>
<version>YOUR_VERSION_HERE</version>
<type>war</type>
</dependency>
</dependencies>
...
</project>
Edit
The <webModule/> artifact is not in your <dependencies/> list. That is what I was suggesting.
Add the following:
<dependency>
<groupId>com.syril.service</groupId>
<artifactId>UserAdminSL</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
</dependency>
OR
Change the <webModule/>:
<webModule>
<groupId>com.syril.service</groupId>
<artifactId>UserAdminService</artifactId>
<contextRoot>/UserAdminSL</contextRoot>
</webModule>
That is of course if UserAdminService is the same as UserAdminSL which I think.

Resources