I get follow error, when I try to use Maven in project:
E:\path\to\project>mvn clean install
---------------------------------------------------
constituent[0]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../conf/logging/
constituent[1]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/animal-sniffer-annotations-1.14.jar
constituent[2]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/aopalliance-1.0.jar
constituent[3]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/cdi-api-1.0.jar
constituent[4]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/checker-compat-qual-2.0.0.jar
constituent[5]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/commons-cli-1.4.jar
constituent[6]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/commons-io-2.5.jar
constituent[7]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/commons-lang3-3.8.1.jar
constituent[8]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/error_prone_annotations-2.1.3.jar
constituent[9]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/guava-25.1-android.jar
constituent[10]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/guice-4.2.1-no_aop.jar
constituent[11]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/j2objc-annotations-1.1.jar
constituent[12]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/jansi-1.17.1.jar
constituent[13]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/javax.inject-1.jar
constituent[14]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/jcl-over-slf4j-1.7.25.jar
constituent[15]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/jsr250-api-1.0.jar
constituent[16]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/jsr305-3.0.2.jar
constituent[17]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-artifact-3.6.0.jar
constituent[18]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-builder-support-3.6.0.jar
constituent[19]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-compat-3.6.0.jar
constituent[20]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-core-3.6.0.jar
constituent[21]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-embedder-3.6.0.jar
constituent[22]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-model-3.6.0.jar
constituent[23]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-model-builder-3.6.0.jar
constituent[24]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-plugin-api-3.6.0.jar
constituent[25]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-repository-metadata-3.6.0.jar
constituent[26]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-api-1.3.1.jar
constituent[27]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-connector-basic-1.3.1.jar
constituent[28]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-impl-1.3.1.jar
constituent[29]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-provider-3.6.0.jar
constituent[30]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-spi-1.3.1.jar
constituent[31]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-transport-wagon-1.3.1.jar
constituent[32]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-util-1.3.1.jar
constituent[33]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-settings-3.6.0.jar
constituent[34]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-settings-builder-3.6.0.jar
constituent[35]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-shared-utils-3.2.1.jar
constituent[36]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-slf4j-provider-3.6.0.jar
constituent[37]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/org.eclipse.sisu.inject-0.3.3.jar
constituent[38]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/org.eclipse.sisu.plexus-0.3.3.jar
constituent[39]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-cipher-1.7.jar
constituent[40]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-component-annotations-1.7.1.jar
constituent[41]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-interpolation-1.25.jar
constituent[42]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-sec-dispatcher-1.4.jar
constituent[43]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-utils-3.1.0.jar
constituent[44]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/slf4j-api-1.7.25.jar
constituent[45]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/wagon-file-3.2.0.jar
constituent[46]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/wagon-http-3.2.0-shaded.jar
constituent[47]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/wagon-provider-api-3.2.0.jar
---------------------------------------------------
Exception in thread "main" java.lang.StackOverflowError
at java.io.InputStream.<init>(InputStream.java:45)
at java.io.FileInputStream.<init>(FileInputStream.java:123)
at org.sonatype.plexus.components.sec.dispatcher.SecUtil.toStream(SecUtil.java:100)
at org.sonatype.plexus.components.sec.dispatcher.SecUtil.read(SecUtil.java:56)
I've tested Maven 3.6.0 and 3.3.9. It's not project-dependent; every Maven project gives the same exception.
The project has a parent POM with two modules, an Angular project and a Spring Boot project.
pom.xml - Root
<?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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>de.business.customer</groupId>
<artifactId>product-root</artifactId>
<version>1.0.0-beta.9</version>
<packaging>pom</packaging>
<name>Product Parent</name>
<description>Parent project for Angular and Spring.</description>
<modules>
<module>angular-gui</module>
<module>spring-gui-backend</module>
</modules>
<properties>
<project.version>1.0.0-beta.9</project.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.finalName>product</project.build.finalName>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Greenwich.M3</spring-cloud.version>
<keycloak.version>4.6.0.Final</keycloak.version>
<joda-time.version>2.10</joda-time.version>
<hibernate.version>5.3.6.Final</hibernate.version>
<postgres.version>42.2.5</postgres.version>
<springfox.version>2.9.2</springfox.version>
<docker.repository>https://link.to.hub.de</docker.repository>
<docker.folder>docker-folder</docker.folder>
</properties>
</project>
pom.xml - Spring Boot
<?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>de.business.customer</groupId>
<artifactId>product-root</artifactId>
<version>1.0.0-beta.9</version>
</parent>
<artifactId>spring-gui-backend</artifactId>
<version>1.0.0-beta.9</version>
<packaging>jar</packaging>
<name>spring-gui</name>
<description>Rest API for GUI.</description>
<repositories>
<repository>
<id>repository.springframework.maven.milestone</id>
<name>Spring Framework Maven Milestone Repository</name>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.keycloak.bom</groupId>
<artifactId>keycloak-adapter-bom</artifactId>
<version>${keycloak.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<!--<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>-->
<!--<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!-- Postgres -->
<!--<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.version}</version>
</dependency>-->
<!-- Keycloak -->
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-spring-security-adapter</artifactId>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- Joda Time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda-time.version}</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.9.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.7</version>
</dependency>
<!-- Springfox Swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox.version}</version>
</dependency>
<!-- Google Guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0-jre</version>
</dependency>
<!-- OpenCSV -->
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>4.1</version>
</dependency>
</dependencies>
<build>
<finalName>${project.build.finalName}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.9</version>
<executions>
<execution>
<id>default</id>
<goals>
<!--<goal>tag</goal>-->
<goal>build</goal>
<goal>push</goal>
</goals>
<configuration>
<tag>${project.version}</tag>
</configuration>
</execution>
<execution>
<id>default-2</id>
<goals>
<goal>tag</goal>
<!--<goal>build</goal>-->
<goal>push</goal>
</goals>
<configuration>
<tag>latest</tag>
</configuration>
</execution>
</executions>
<configuration>
<repository>${docker.folder}/backend</repository>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
pom.xml - Angular
<?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>de.business.customer</groupId>
<artifactId>product-root</artifactId>
<version>1.0.0-beta.9</version>
</parent>
<artifactId>angular-gui</artifactId>
<packaging>pom</packaging>
<name>angular-gui</name>
<description>Angular Application UI.</description>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
<configuration>
<nodeVersion>v11.4.0</nodeVersion>
<npmVersion>6.5.0</npmVersion>
<installDirectory>target</installDirectory>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.9</version>
<executions>
<execution>
<id>default</id>
<goals>
<!--<goal>tag</goal>-->
<goal>build</goal>
<goal>push</goal>
</goals>
<configuration>
<tag>${project.version}</tag>
</configuration>
</execution>
<execution>
<id>default-2</id>
<goals>
<goal>tag</goal>
<!--<goal>build</goal>-->
<goal>push</goal>
</goals>
<configuration>
<tag>latest</tag>
</configuration>
</execution>
</executions>
<configuration>
<repository>${docker.folder}/frontend</repository>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Anyone have an idea?
Okay, there was a path error in settings-security.xml.
Related
I am unable to run serenityBDD tests in parallel.
Project is with 3 modules with standard steps(test/java/steps) and feature files(test/java/resources/feature_files) locations for api and ui modules. Everything works fine but with given pom file I am expecting tests to run parallel at feature files level but tests are being executed serially. I have referred this blog any help please?
api
common
ui
main pom.xml
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>demo-automation</artifactId>
<description>demo-automation</description>
<groupId>demo-automation</groupId>
<name>demo-automation</name>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>common</module>
<module>api</module>
<module>ui</module>
</modules>
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<relativePath/>
<version>2.7.5</version> <!-- lookup parent from repository -->
</parent>
<properties>
<encoding>UTF-8</encoding>
<java.version>1.8</java.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<junit.vintage.version>5.8.2</junit.vintage.version>
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.failsafe.plugin.version>3.0.0-M5</maven.failsafe.plugin.version>
<maven.surefire.plugin.version>3.0.0-M5</maven.surefire.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<rest.version>4.2.1</rest.version>
<selenium.version>4.1.1</selenium.version>
<serenity.cucumber.version>3.2.3</serenity.cucumber.version>
<serenity.version>3.2.3</serenity.version>
<tags/>
<version>${project.version}</version>
</properties>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>bintray-plugins</name>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://jcenter.bintray.com</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<name>bintray</name>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://jcenter.bintray.com</url>
</repository>
<repository>
<id>maven_central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<version>${maven.surefire.plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/TestRunner*.java</include>
</includes>
<systemPropertyVariables>
<tags/>
<webdriver.base.url/>
</systemPropertyVariables>
<parallel>methods</parallel>
<threadCount>4</threadCount>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<version>${maven.failsafe.plugin.version}</version>
</plugin>
<plugin>
<artifactId>serenity-maven-plugin</artifactId>
<configuration>
<reports>single-page-html</reports>
<tags>${tags}</tags>
</configuration>
<dependencies>
<dependency>
<artifactId>serenity-single-page-report</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>${serenity.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>aggregate</goal>
</goals>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
</execution>
</executions>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<version>${serenity.version}</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<artifactId>spring-boot-starter</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>lombok</artifactId>
<groupId>org.projectlombok</groupId>
<optional>true</optional>
</dependency>
<!-- JUnit 5 -->
<dependency>
<artifactId>junit-jupiter-engine</artifactId>
<groupId>org.junit.jupiter</groupId>
<scope>test</scope>
<version>${junit.jupiter.version}</version>
</dependency>
<dependency>
<artifactId>junit-vintage-engine</artifactId>
<groupId>org.junit.vintage</groupId>
<scope>test</scope>
<version>${junit.vintage.version}</version>
</dependency>
<!-- Serenity -->
<dependency>
<artifactId>serenity-core</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>serenity-cucumber</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.cucumber.version}</version>
</dependency>
<dependency>
<artifactId>serenity-junit</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>maven-failsafe-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<type>maven-plugin</type>
<version>3.0.0-M5</version>
</dependency>
<dependency>
<artifactId>commons-lang3</artifactId>
<groupId>org.apache.commons</groupId>
</dependency>
<dependency>
<artifactId>jackson-databind</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</dependency>
<dependency>
<artifactId>spring-retry</artifactId>
<groupId>org.springframework.retry</groupId>
<scope>test</scope>
<version>1.2.5.RELEASE</version>
</dependency>
<dependency>
<artifactId>serenity-spring</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>3.5.0</version>
</dependency>
<dependency>
<artifactId>spring-boot-test</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>httpcore</artifactId>
<groupId>org.apache.httpcomponents</groupId>
<scope>test</scope>
<version>4.4.15</version>
</dependency>
<dependency>
<artifactId>serenity-rest-assured</artifactId>
<exclusions>
<exclusion>
<artifactId>rest-assured</artifactId>
<groupId>io.rest-assured</groupId>
</exclusion>
</exclusions>
<groupId>net.serenity-bdd</groupId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>rest-assured</artifactId>
<groupId>io.rest-assured</groupId>
<version>${rest.version}</version>
</dependency>
<dependency>
<artifactId>xml-path</artifactId>
<groupId>io.rest-assured</groupId>
<version>${rest.version}</version>
</dependency>
<dependency>
<artifactId>json-path</artifactId>
<groupId>io.rest-assured</groupId>
<version>${rest.version}</version>
</dependency>
<dependency>
<artifactId>json-schema-validator</artifactId>
<groupId>io.rest-assured</groupId>
<version>${rest.version}</version>
</dependency>
<dependency>
<artifactId>cucumber-java</artifactId>
<groupId>io.cucumber</groupId>
<version>7.2.3</version>
</dependency>
<dependency>
<artifactId>spring-boot-starter-test</artifactId>
<exclusions>
<exclusion>
<artifactId>android-json</artifactId>
<groupId>com.vaadin.external.google</groupId>
</exclusion>
</exclusions>
<groupId>org.springframework.boot</groupId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>spring-rabbit</artifactId>
<groupId>org.springframework.amqp</groupId>
<version>2.4.2</version>
</dependency>
<dependency>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
<version>1.2.10</version>
</dependency>
<dependency>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
<version>2.11.0</version>
</dependency>
<dependency>
<artifactId>jackson-core</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<version>2.13.1</version>
</dependency>
<dependency>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<version>2.13.1</version>
</dependency>
<dependency>
<artifactId>assertj-core</artifactId>
<groupId>org.assertj</groupId>
<scope>test</scope>
<version>3.22.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
<dependency>
<artifactId>commons-cli</artifactId>
<groupId>commons-cli</groupId>
<version>1.5.0</version>
</dependency>
</dependencies>
</project>
And ui pox.xml,
<?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">
<modelVersion>4.0.0</modelVersion>
<name>ui</name>
<artifactId>ui</artifactId>
<parent>
<artifactId>demo-automation</artifactId>
<groupId>demo-automation</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.19.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<configuration>
<sourceDirectory>${basedir}/src/test/resources/schema</sourceDirectory>
<sourceType>json</sourceType>
<targetPackage>demo.ui</targetPackage>
<useCommonsLang3>true</useCommonsLang3>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<groupId>org.jsonschema2pojo</groupId>
<version>0.4.34</version>
</plugin>
<plugin>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<configuration>
<sources>
<source>>${basedir}/target/java-gen</source>
</sources>
</configuration>
<goals>
<goal>add-source</goal>
</goals>
<id>test</id>
<phase>generate-sources</phase>
</execution>
</executions>
<groupId>org.codehaus.mojo</groupId>
<version>1.4</version>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<artifactId>common</artifactId>
<groupId>demo-automation</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<artifactId>serenity-screenplay</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>serenity-screenplay-webdriver</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>serenity-ensure</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.version}</version>
</dependency>
</dependencies>
</project>
Looks like you are indirectly running Serenity through the junit-vintage-engine. When executed this way, parallel execution is simply not supported.
To be exact you are running your tests through Surefire -> JUnit 5 -> JUnit Vintage -> JUnit 4 -> Serenity -> Cucumber.
You'd have to wait for JUnit Vintage to support parallel execution or get rid of JUnit 5 from your depencies so Surefire can run JUnit 4 directly.
However given that you are also using Spring you may not be able to get rid of JUnit 5.
You could ask Serenity to support JUnit 5 but I suspect they will be unable too. They have never bothered to contribute the extension points they'd need upstream. Instead they have hacked their stuff into Cucumber.
Small question regarding Maven Site, mvn site for a SpringBoot multi module project.
I am currently building a maven project, however, on a basic mvn site, I am seeing the following:
Unable to find a URL to the parent project. The parent menu will NOT be added.
This message is a bit confusing to me, this is my pom:
This is reproducible 100%, please feel free to copy paste this and run mvn clean install site -U -Dspringdoc.writer-with-default-pretty-printer=true jacoco:prepare-agent jacoco:report dependency:tree pmd:cpd pmd:pmd javadoc:javadoc checkstyle:checkstyle spotbugs:spotbugs
<?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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.5</version>
<relativePath/>
</parent>
<name>someName</name>
<description> some description</description>
<url>https://pages.github.com</url>
<organization>
<name>myOrg</name>
</organization>
<scm>
<url>https://github.com</url>
</scm>
<groupId>org.example</groupId>
<artifactId>cvequestion</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2021.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra-reactive</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-kubernetes-fabric8</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty-http-brave</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-micrometer</artifactId>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-reactor</artifactId>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-spring-boot2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>org.springframework.statemachine</groupId>
<artifactId>spring-statemachine-core</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>7.0.1</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webflux-ui</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>io.github.hakky54</groupId>
<artifactId>sslcontext-kickstart-for-netty</artifactId>
<version>7.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<reportsDirectory>target/reports/junit</reportsDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<outputDirectory>target/javadoc</outputDirectory>
<reportOutputDirectory>target/javadoc</reportOutputDirectory>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration>
<executions>
<execution>
<goals>
<goal>javadoc</goal>
</goals>
<phase>site</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.9.1.2184</version>
<dependencies>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.4.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.5.3.0</version>
<configuration>
<outputDirectory>target/reports/findbugs</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.16.0</version>
<configuration>
<targetDirectory>.out/reports/pmd</targetDirectory>
<outputDirectory>target/reports/pmd</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<outputFile>.out/reports/checkstyle/checkstyle-result.xml</outputFile>
<outputDirectory>target/reports/checkstyle</outputDirectory>
<outputFileFormat>xml</outputFileFormat>
</configuration>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<configuration>
<append>true</append>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.7.5</version>
<configuration>
<withHistory>true</withHistory>
<threads>16</threads>
<outputFormats>
<param>XML</param>
<param>HTML</param>
</outputFormats>
<mutators>
<mutator>CONDITIONALS_BOUNDARY</mutator>
<mutator>INCREMENTS</mutator>
<mutator>INVERT_NEGS</mutator>
<mutator>MATH</mutator>
<mutator>NEGATE_CONDITIONALS</mutator>
<mutator>EMPTY_RETURNS</mutator>
<mutator>FALSE_RETURNS</mutator>
<mutator>TRUE_RETURNS</mutator>
<mutator>PRIMITIVE_RETURNS</mutator>
<mutator>REMOVE_INCREMENTS</mutator>
<mutator>EXPERIMENTAL_BIG_INTEGER</mutator>
<mutator>EXPERIMENTAL_MEMBER_VARIABLE</mutator>
<mutator>EXPERIMENTAL_SWITCH</mutator>
</mutators>
</configuration>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>0.15</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.11.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.2.2</version>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.2.0</version>
</plugin>
</plugins>
</reporting>
</project>
Even on the spring root pom, I see “url”.
As you can see, I am indeed using an URL.
What am I doing wrong here to get this "Unable to find a URL to the parent project. The parent menu will NOT be added."?
And how to solve it please?
Thank you!
I'm using a GitLab CI/CD Pipeline that uses the spotbugs plugin for Maven; when I try to run
mvn compile spotbugs:check
I get the following error:
[INFO] Fork Value is true
[java] The following classes needed for analysis were missing:
[java] org.junit.jupiter.api.Assertions
The previous command works on my local machine, but fails on the GitLab runner. I suppose this may be a configuration problem (ie: something wrong on my pom.xml file) but I am not quite sure how to fix it.
Here is 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.1.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>accessing-data-mysql</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>accessing-data-mysql</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</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>
<!-- junit 5, unit test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.2.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</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-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- Maven checkstyle plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<configLocation>google_checks.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
</plugin>
<!-- Maven spotbugs plugin -->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>3.1.12.2</version>
</plugin>
<!-- Maven PMD plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.12.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.12</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-integration-test-source</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/integration-test/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-integration-test-resource</id>
<phase>generate-test-resources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/integration-test/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<!-- target/docker-spring-boot.jar -->
<finalName>docker-spring-boot</finalName>
</build>
</project>
Thanks for all your help.
I have application which is doing some business staff, and presents the outcome through REST api.
Outcome of the build should be one, executable jar, which is later transformed into dockerfile.
Recently, I've been trying to separate its parts into maven modules.
I've split the application (which works just fine when built and run in IDE), assembled the jar using maven-shade-plugin, but when I try to run app using java -jar command I receive following error:
`org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
I've already tried using #EnableAutoConfiguration annotation and extending main class with SpringBootServletInitializer - with no effect.
I would appreciate any help. Thanks!
Master 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.company</groupId>
<artifactId>app-backend</artifactId>
<version>latest</version>
<packaging>pom</packaging>
<modules>
<module>app-api</module>
<module>app-webapi</module>
<module>app-applogic</module>
<module>app-deployment</module>
<module>app-legacydbadapter</module>
<module>app-integrationtests</module>
</modules>
<name>app-backend</name>
<description>Backend part for app Application</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring.boot.version>2.0.1.RELEASE</spring.boot.version>
<axon.version>3.2.2</axon.version>
<swagger.version>2.8.0</swagger.version>
<guava.version>25.1-jre</guava.version>
<gson.version>2.8.5</gson.version>
<junit.version>5.2.0</junit.version>
<assertj.version>3.9.1</assertj.version>
<restassured.version>3.1.0</restassured.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<configuration>
<excludes>
<exclude>**/*Configuration*</exclude>
<exclude>**/*Startup*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>coverage-check</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>checkCodeCoverage</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<configuration>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>test</phase>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.85</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<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>
<version>${spring.boot.version}</version>
<scope>test</scope>
</dependency>
<!-- Axon -->
<dependency>
<groupId>org.axonframework</groupId>
<artifactId>axon-spring</artifactId>
<version>${axon.version}</version>
</dependency>
<!-- Utilities -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.axonframework</groupId>
<artifactId>axon-test</artifactId>
<version>${axon.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>${restassured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Executable module's 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>app-backend</artifactId>
<groupId>com.company</groupId>
<version>latest</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>app-webapi</artifactId>
<properties>
<spring.boot.version>2.0.1.RELEASE</spring.boot.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!--Internal dependencies-->
<dependency>
<groupId>com.company</groupId>
<artifactId>app-applogic</artifactId>
<version>latest</version>
</dependency>
<dependency>
<groupId>com.company</groupId>
<artifactId>app-legacydbadapter</artifactId>
<version>latest</version>
</dependency>
<dependency>
<groupId>com.company</groupId>
<artifactId>app-api</artifactId>
<version>latest</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</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-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
</dependencies>
</project>
Deployment module's 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>app-backend</artifactId>
<groupId>com.company</groupId>
<version>latest</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<artifactId>app-deployment</artifactId>
<properties>
<docker.maven.plugin.version>1.3.6</docker.maven.plugin.version>
<maven.dependency.plugin.version>3.1.1</maven.dependency.plugin.version>
<docker.image.artifacts>${project.build.directory}/docker-artifacts</docker.image.artifacts>
<sonar.jacoco.report.path>${project.basedir}/../target/jacoco.exec</sonar.jacoco.report.path>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.company.app.webapi.Application</mainClass>
</transformer>
</transformers>
<outputDirectory>${docker.image.artifacts}</outputDirectory>
<outputFile>app-backend-latest.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<executions>
<execution>
<id>default</id>
<phase>install</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>docker.company.com/app-backend</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.company</groupId>
<artifactId>app-webapi</artifactId>
<version>latest</version>
</dependency>
</dependencies>
</project>
App's main class
package com.company.app.webapi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Configuration class
package com.company.app.webapi.config;
import com.company.app.applogic.config.AxonConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;
#Configuration
#Import({AxonConfiguration.class})
#ComponentScan(basePackages = "com.company.app")
#EnableJpaRepositories(basePackages = "com.company.app.legacydbadapter")
#EntityScan(basePackages = "com.company.app.legacydbadapter.model")
#EnableScheduling
public class ApplicationConfiguration {}
Hello I'm trying to use groovy with java, on java maven project, I think I provided every artifacts and plugins needed to run it well, here is my pom :
pom content
and here is the exception caught after trying to build
I linked it to pastebin cause I enabled -X option to get full stack trace trace
Finally I found a way to get a pom working with gmaven 1.4, groovy 2.0 and java 7, inspired by this project "primefaces-groovy-cassandra"
here is a simple pom of a war type application :
`<?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>office</groupId>
<artifactId>gmOffice</artifactId>
<name>gmOffice</name>
<version>0.0.1</version>
<packaging>war</packaging>
<properties>
<!-- Configuration -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<!-- Dependencies -->
<javax.servlet.api.version>3.0.1</javax.servlet.api.version>
<primefaces.version>3.2</primefaces.version>
<myfaces.version>2.1.7</myfaces.version>
<!-- Maven plugins -->
<maven.compiler.version>2.4</maven.compiler.version>
<maven.enforcer.version>1.0.1</maven.enforcer.version>
<maven.war.version>2.2</maven.war.version>
<maven.gmaven.version>1.4</maven.gmaven.version>
<netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
<slf4j.version>1.6.1</slf4j.version>
</properties>
<repositories>
<repository>
<id>sonatype-releases</id>
<name>Sonatype Releases Repository</name>
<url>http://oss.sonatype.org/content/repositories/releases/</url>
</repository>
<repository>
<id>primefaces-releases</id>
<name>PrimeFaces Releases Repository</name>
<url>http://repository.primefaces.org</url>
</repository>
</repositories>
<prerequisites>
<maven>3.0.0</maven>
</prerequisites>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>${primefaces.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.19</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.164</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven.enforcer.version}</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.0.0,)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[1.6.0,)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>${maven.gmaven.version}</version>
<configuration>
<source>src/main/groovy</source>
<providerSelection>2.0</providerSelection>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<configLocation>config/sun_checks.xml</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.version}</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Timestamp>${maven.build.timestamp}</Implementation-Timestamp>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>