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

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)

Related

Spring ws cxf-codegen-plugin not parse wsdl

I'm studying soap. Everything works fine with test cases, but when I move on to calling real services, problems begin that I cannot solve. I tried different plugins for generating code from wsdl but it gives errors everywhere. The service works when I pull it through the SOAP UI - I checked, everything is fine, the requests are successful. What am I doing wrong?
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 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.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>users.bugred.ru-soap</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<maven-jaxb2-plugin.version>0.14.0</maven-jaxb2-plugin.version>
<cxf.version>2.2.3</cxf.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<!-- Jetty is needed if you're are not using the CXFServlet -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.2.3</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<!-- <wsdl>${basedir}/src/main/resources/wsdl/user.wsdl</wsdl>-->
<wsdl>http://users.bugred.ru/tasks/soap/WrapperSoapServer.php?wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
console output from maven
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.270 s
[INFO] Finished at: 2022-03-23T15:21:24+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.2.3:wsdl2java (generate-sources) on project demo:
[ERROR] Summary: Failures: 3, Warnings: 0
[ERROR]
[ERROR] <<< ERROR!
[ERROR] Part <fullSimilarity> in Message <{http://foo.bar/wrappersoapserver}MagicSearchRequest> referenced Type <{http://www.w3.org/2001/XMLSchema}bool> can not be found in the schemas
[ERROR] Part <include> in Message <{http://foo.bar/wrappersoapserver}MagicSearchRequest> referenced Type <{http://www.w3.org/2001/XMLSchema}mixed> can not be found in the schemas
[ERROR] Part <result> in Message <{http://foo.bar/wrappersoapserver}doLoginResponse> referenced Type <{http://www.w3.org/2001/XMLSchema}bool> can not be found in the schemas
[ERROR]
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

in STS, referring other my own simple maven project is not working, what I am missing?

I am having a very simple problem, I have one spring boot starter project having only one class & I am referring it in another spring boot starter project, but getting error as :
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.590 s
[INFO] Finished at: 2021-02-13T10:25:21-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project demo1: Compilation failure: Compilation failure:
[ERROR] /Users/kedarmoghe/Documents/workspaces/travel/demo1/src/main/java/com/example1/demo/AddressProcessor.java:[3,24] package com.example.demo does not exist
[ERROR] /Users/kedarmoghe/Documents/workspaces/travel/demo1/src/main/java/com/example1/demo/AddressProcessor.java:[7,9] cannot find symbol
[ERROR] symbol: class Address
[ERROR] location: class com.example1.demo.AddressProcessor
[ERROR] /Users/kedarmoghe/Documents/workspaces/travel/demo1/src/main/java/com/example1/demo/AddressProcessor.java:[7,31] cannot find symbol
My pom.xml from project 1 is :
enter code here
<?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.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</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-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
enter code here
My pom.xml in project-2 is :
enter code here
<?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.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example1</groupId>
<artifactId>demo1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo1</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</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-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
enter code here
In my STS I am not able to compile, what step I am missing ?
Thanks.
Projects that are packaged via the Spring Boot Maven Plugin are not naturally fit to be used as dependencies.
You can follow any of these references to edit project1's pom.xml as necessary to deploy an artifact JAR that can actually be used as a dependency, and then import that in project2:
https://www.baeldung.com/spring-boot-dependency
https://medium.com/xebia-france/import-spring-boot-application-as-a-maven-dependency-a25e03e5c3a

Yet another problem with JAXB on JDK-11. Now with tycho-compiler plugin

I decided to migrate our legacy project from jdk7 to jdk11 and can't resolve problem with jaxb.
We have a multi-module maven project.
Here is a part of the 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.XXX.core.build</groupId>
<artifactId>parent</artifactId>
<version>2.1.2</version>
<packaging>pom</packaging>
<name>Core Build</name>
<prerequisites>
<maven>3.6</maven>
</prerequisites>
<modules>
<!-- <module>./targetdefs</module> -->
<module>../com.XXX.core</module>
....more modules
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk-version>11</jdk-version>
<!-- Plugins tycho version -->
<tycho.version>1.7.0</tycho.version>
<javax.activation.version>1.2.0</javax.activation.version>
<jaxb.api.version>2.3.0</jaxb.api.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- API -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
<!--<scope>compile</scope>-->
</dependency>
<!--Runtime-->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.3</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<testSourceDirectory>${basedir}/src</testSourceDirectory>
<plugins>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<source>${jdk-version}</source>
<target>${jdk-version}</target>
</configuration>
</plugin>
</build>
</project>
And here is the 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.XXX.core.build</groupId>
<artifactId>parent</artifactId>
<version>2.1.2</version>
<relativePath>../com.XXX.core.build/pom.xml</relativePath>
</parent>
<artifactId>com.XXX.core</artifactId>
<packaging>eclipse-plugin</packaging>
<name>Core</name>
<dependencies>
<!-- API -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
<!--<scope>compile</scope>-->
</dependency>
<!--Runtime-->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.3</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>${basedir}</directory>
<filtering>true</filtering>
<includes>
<include>**/version.properties</include>
</includes>
</resource>
</resources>
</build>
</project>
But after trying to execute mvm clean install on child pom I'm getting
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.7.0:compile (default-compile) on project com.XXX.core: Compilation failure: Compilation failure:
[ERROR] PATH\core\util\stax\StaxIterator.java:[17]
[ERROR] import javax.xml.bind.JAXBContext;
[ERROR] ^^^^^^^^^^^^^^
[ERROR] The import javax.xml.bind cannot be resolved
Although Netbeans added jakarta.xml.bind-api and jaxb-impl as libraries and there are no any error in file StaxIterator.java
I followed this post How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9
How could I resolve problem in such situation - I tried all the possibility from StackOverflow :(
The problem was SOLVED
There is no need to add dependencies to maven at all.
The root of the issue (in my case) was in file META-INF/MANIFEST.MF
I've just added javax.xml.bind to the "Import-Package:" section
...
Import-Package: javax.persistence,
javax.xml.bind,
org.apache.commons.beanutils,
org.osgi.framework;version="1.6.0",
org.osgi.service.event;version="1.3.0",
org.slf4j;version="1.7.30"

Spring Build Failure

Im trying mvn clean install but im getting the following error
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ApplicationTests.initializationError ยป IllegalState Unable to find a #SpringBo...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:32 min
[INFO] Finished at: 2018-05-26T22:55:46-03:00
[INFO] Final Memory: 36M/146M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project 7technology-WebApp: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\myuser\Documents\workspace-sts-3.9.2.RELEASE\myapp-WebApp\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I tried with mvn clean install -U but i get the same error, also mvn dependency::tree didn't show anything wrong.
This is 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>com.webbapp</groupId>
<artifactId>myapp-WebApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>7technology-WebApp</name>
<description>myapp</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.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>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sourceforge.nekohtml/nekohtml -->
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf-spring5 -->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</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-mail</artifactId>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<mainClass>${start-class}</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.myapp.webapp.Application</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I tried with most answers from this question but i keep getting the same error. What am i missing? I dont want to do this with the IDE, because if CMD show an error it's probably because something is causing this problem.
Thanks in advance.
There are test failures
The error suggest that some of your test cases are failure.
So either you have to correct your test/code or skip the tests:
mvn clean install -DskipTests
Or skip the test build entirely
mvn clean install -Dmaven.test.skip=true
mvn clean install -Dmaven.test.skip=true
Write this line in the built-in terminal which is on the bottom of your IDE workspace(IntelliJ).

Spring boot application - Tomcat deployment

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

Resources