Method 'setLenient' of GsonBuilder not found in IntelliJ - java

I am trying to create a Jira plugin which consumes a REST web service using Retrofit and RxJava2. I created a prototyp of the rest client in a "normal" java programm with the following pom.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Test</groupId>
<artifactId>Test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>adapter-rxjava2</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>2.2.8</version>
</dependency>
</dependencies>
</project>
Here is the creation of the retrofit client:
public ClientService() {
OkHttpClient okHttpClient = new OkHttpClient().newBuilder().addInterceptor(new Interceptor() {
#Override
public okhttp3.Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
Request.Builder builder = originalRequest.newBuilder().header("Authorization", Credentials.basic(username, password));
Request newRequest = builder.build();
return chain.proceed(newRequest);
}
}).build();
Gson gson = new GsonBuilder().setLenient().create();
Retrofit retro = new Retrofit.Builder().baseUrl(API_URL).client(okHttpClient).addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()).build();
stmdApi = retro.create(StammdatenServiceApi.class);
}
The prototype works as expected.
Now I migrated this prototype into my jira plugin with the following 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.stmd</groupId>
<artifactId>stmd-import-new</artifactId>
<version>0.0.1-2</version>
<organization>
<name>company</name>
<url>http://www.company.com</url>
</organization>
<name>retrofit-proto</name>
<description>test of retrofit</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-runtime</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.context.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${javax.activation.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>adapter-rxjava2</artifactId>
<version>${retrofit.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>${retrofit.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>${retrofit.version}</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>${rx.java.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>jira-maven-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<enableQuickReload>true</enableQuickReload>
<jvmArgs>-Xms2g -Xmx4g</jvmArgs>
<applications>
<application>
<applicationKey>jira-software</applicationKey>
<version>${jira.version}</version>
</application>
</applications>
<!-- See here for an explanation of default instructions: -->
<!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<!-- Add package to export here -->
<Export-Package>
de.westlotto.jira.stmd.api,
</Export-Package>
<!-- Add package import here -->
<Import-Package>
android.*;resolution:=optional,
org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
*;version="0";resolution:=optional
</Import-Package>
<!-- Ensure plugin is spring powered -->
<Spring-Context>*</Spring-Context>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<executions>
<execution>
<goals>
<goal>atlassian-spring-scanner</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<scannedDependencies>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-external-jar</artifactId>
</dependency>
</scannedDependencies>
<verbose>false</verbose>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jira.version>7.13.1</jira.version>
<amps.version>8.0.0</amps.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<javax.activation.version>1.1.1</javax.activation.version>
<rx.java.version>2.2.8</rx.java.version>
<retrofit.version>2.5.0</retrofit.version>
<retrofit.osgi.version>2.5.0_1</retrofit.osgi.version>
<spring.context.version>4.2.5.RELEASE</spring.context.version>
<gson.version>2.8.5</gson.version>
<!-- This property ensures consistency between the key in atlassian-plugin.xml and the OSGi bundle's key. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
This time there seems to be a dependency problem with the Gson lib. The method setLenient() of GsonBuilder in the line
Gson gson = new GsonBuilder().setLenient().create();
is not being resolved. Everything else is working just fine. I used the same dependencies in both poms as far as it is possible but the error still exists. I don't have an idea where to look now. IntelliJ is just not resolving this method.
I tried re-importing all dependencies and deleted the project cache but both did not work. Any ideas?

Related

Spring Boot Migration from 2.7 to 3.0.1 Lombok issues `cannot find sybol`

this post Spring Boot 3 Lombock I already read, it is exactly my issues but the solution does not help me.
The issue occured while migrating from Spring Boot 2.7 to 3.0.1. According to version of lombock both have 1.18.24, which to post above suggests using. See Spring 2.7.X and Spring 3.0.X. (Edit: I got those pages from Spring-Boot-3.0-Migration-Guide)
So I get following error while mvn clean compile on my Entities annotated with #Data
[ERROR] /home/me/code/connect/services/integrator-service/src/main/java/de/comp/integratorservice/service/data/DataService.java:[113,52] cannot find symbol
symbol: method getKey()
location: variable d of type de.comp.integratorservice.rest.dto.DataDto
All pom.xml are altered to hide company names
Here is my modules 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>
<parent>
<groupId>de.comp</groupId>
<artifactId>pname-services</artifactId>
<version>1.42-SNAPSHOT</version>
</parent>
<artifactId>integrator-service</artifactId>
<packaging>jar</packaging>
<name>integrator-service</name>
<dependencies>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</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-test</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<!-- open-api -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webmvc-core</artifactId>
</dependency>
<!-- when switchting to openapi from springfox swagger the compile didnt work any more... https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- Add application packages -->
<!-- some other dependencies from our company -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-sqlserver</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Here is the one parent 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>de.comp</groupId>
<artifactId>pname</artifactId>
<version>1.42-SNAPSHOT</version>
</parent>
<artifactId>pname-services</artifactId>
<packaging>pom</packaging>
<properties>
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
<apt-maven-plugin.version>1.1.3</apt-maven-plugin.version>
<helm-maven-plugin.version>6.6.1</helm-maven-plugin.version>
</properties>
<modules>
...
<module>integrator-service</module>
...
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>${helm-maven-plugin.version}</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
<useLocalHelmBinary>true</useLocalHelmBinary>
</configuration>
<executions>
<execution>
<id>package-helm-chart</id>
<phase>package</phase>
<goals>
<goal>lint</goal>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
<includeScope>compile</includeScope>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
and here is the parent`s 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.comp</groupId>
<artifactId>pname</artifactId>
<version>1.42-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.1</version>
<relativePath/>
</parent>
<modules>
<module>pname-commons</module>
</modules>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>pname-external-apis</module>
<module>pname-apis</module>
<module>pname-services</module>
<module>pname-tools</module>
<module>pname-tests</module>
</modules>
</profile>
<profile>
<id>pname-tests</id>
<modules>
<module>pname-tests</module>
</modules>
<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
</profiles>
<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<build.tag>latest</build.tag>
<dockerfile.push.skip>true</dockerfile.push.skip>
<codechecks.skip>false</codechecks.skip>
<!-- spring-cloud must fit to the base spring-boot version -->
<spring-cloud.version>2021.0.5</spring-cloud.version>
<org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
<openapi-webmvc.version>1.6.14</openapi-webmvc.version>
<swagger-annotations.version>2.2.7</swagger-annotations.version>
<logstash-logback-encoder.version>7.2</logstash-logback-encoder.version>
<com.microsoft.sqlserver.version>11.2.2.jre17</com.microsoft.sqlserver.version>
<google.guava.version>31.1-jre</google.guava.version>
<checkstyle-maven-plugin.version>3.2.0</checkstyle-maven-plugin.version>
<com.puppycrawl.tools.checkstyle.version>10.5.0</com.puppycrawl.tools.checkstyle.version>
<sca-rules.version>1.3</sca-rules.version>
<spotbugs-maven-plugin.version>4.7.3.0</spotbugs-maven-plugin.version>
<com.github.spotbugs.version>4.7.3</com.github.spotbugs.version>
<de.comp.security-code-generator.version>1.0.8</de.comp.security-code-generator.version>
<de.comp.kcu.version>1.5.0</de.comp.kcu.version>
<org.testcontainers.mssqlserver.version>1.17.6</org.testcontainers.mssqlserver.version>
<com.microsoft.azure.sdk.iot.iot-service-client.versions>1.34.2</com.microsoft.azure.sdk.iot.iot-service-client.versions>
<com.azure.azure-storage-blob.version>12.14.4</com.azure.azure-storage-blob.version>
<net.javacrumbs.shedlock.shedlock-spring.version>4.43.0</net.javacrumbs.shedlock.shedlock-spring.version>
<joda-time.version>2.12.2</joda-time.version>
<querydsl-apt.version>5.0.0</querydsl-apt.version>
<reproducible-build-maven-plugin.version>0.16</reproducible-build-maven-plugin.version>
<exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
<commons-io.version>2.11.0</commons-io.version>
<apache.collections.version>4.4</apache.collections.version>
<org.immutables.value.version>2.9.3</org.immutables.value.version>
<com.ibm.icu4j.version>72.1</com.ibm.icu4j.version>
<hamcrest-junit.version>2.0.0.0</hamcrest-junit.version>
<esper.version>8.8.0</esper.version>
<esper-runtime.version>8.8.0</esper-runtime.version>
<esper-common.version>8.8.0</esper-common.version>
<esper-compiler.version>8.8.0</esper-compiler.version>
<dockerfile.maven.version>1.4.13</dockerfile.maven.version>
<apache.commons-text.version>1.10.0</apache.commons-text.version>
<mockserver.version>5.14.0</mockserver.version>
<scala.version>2.13.10</scala.version>
</properties>
<distributionManagement>
<repository>
<id>pname</id>
<url>...</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>pname</id>
<url>...</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
...
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</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-validation</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<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.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<exclusions>
<!--
Exluding Sping Data mongodb to avoid CVE-2021-44906 (https://avd.aquasec.com/nvd/2021/cve-2021-44906/)
in versions prior to 3.3.5 and 3.4.1
-->
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>3.4.6</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webmvc-core</artifactId>
<version>${openapi-webmvc.version}</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-annotations.version}</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>${com.microsoft.sqlserver.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${google.guava.version}</version>
</dependency>
<dependency>
<groupId>de.comp</groupId>
<artifactId>security-code-generator</artifactId>
<version>${de.comp.security-code-generator.version}</version>
</dependency>
<dependency>
<groupId>de.comp.kcu</groupId>
<artifactId>interfaces</artifactId>
<version>${de.comp.kcu.version}</version>
<exclusions>
<!-- we manage our own version of this dependencies -->
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mssqlserver</artifactId>
<version>${org.testcontainers.mssqlserver.version}</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure.sdk.iot</groupId>
<artifactId>iot-service-client</artifactId>
<version>${com.microsoft.azure.sdk.iot.iot-service-client.versions}</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>${com.azure.azure-storage-blob.version}</version>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>${com.github.spotbugs.version}</version>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>${com.ibm.icu4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${apache.collections.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${apache.commons-text.version}</version>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>${org.immutables.value.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-junit</artifactId>
<version>${hamcrest-junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.espertech</groupId>
<artifactId>esper</artifactId>
<version>${esper.version}</version>
</dependency>
<dependency>
<groupId>com.espertech</groupId>
<artifactId>esper-common</artifactId>
<version>${esper-common.version}</version>
</dependency>
<dependency>
<groupId>com.espertech</groupId>
<artifactId>esper-compiler</artifactId>
<version>${esper-compiler.version}</version>
</dependency>
<dependency>
<groupId>com.espertech</groupId>
<artifactId>esper-runtime</artifactId>
<version>${esper-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-core</artifactId>
<version>${mockserver.version}</version>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-client-java</artifactId>
<version>${mockserver.version}</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
<version>${net.javacrumbs.shedlock.shedlock-spring.version}</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId>
<version>${net.javacrumbs.shedlock.shedlock-spring.version}</version>
</dependency>
<!-- start
Rise Scala version for "CVE-2022-31692" transient dependency of
spring-cloud-stream-binder-kafka:3.25
-->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<!-- end
Rise Scala version for "CVE-2022-31692" transient dependency of
spring-cloud-stream-binder-kafka:3.25
-->
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>false</addClasspath>
</manifest>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>io.github.zlika</groupId>
<artifactId>reproducible-build-maven-plugin</artifactId>
<version>${reproducible-build-maven-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>strip-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile.maven.version}</version>
<executions>
<execution>
<id>build-tag-latest</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>tag-version</id>
<phase>package</phase>
<goals>
<goal>tag</goal>
</goals>
<configuration>
<tag>${build.tag}</tag>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
...
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>io.github.zlika</groupId>
<artifactId>reproducible-build-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
You have misunderstood something.
Spring CLI
The Spring Boot CLI is a command line tool that you can use to
bootstrap a new project from start.spring.io or encode a password.
CLI is not part of spring-boot-starter. CLI is only a command line tool used as the spring io initialized (Web) but executes from your local command line instead.
So the table that you have referenced in your question means that if you use Spring CLI and ask for lombok dependency in a spring-boot app of either 2.7 or 3.0.1 the initializer will provide you a newly created project where it would already have declared as dependency the lombok 1.18.24.
This would not mean that you don't have to have declared a specific lombok dependency in your spring boot project. spring-boot-starter-parent would not have one declared for you.
It is just that the CLI would make automatically this declaration in the pom of your new project if you choose to use the CLI for project creation.

Maven - How to exclude dependencies from generated JAR

I have 3 projects that looks like this:
The problem is that the common DB code has a converter class, and I am getting the below error while running the Business logic.
Caused by: org.hibernate.AssertionFailure: AttributeConverter class [class com.td.sba.iep.jpa.converters.ModeltoDBAttributeConverter] registered multiple times
What I did:
I tried to exclude the dependencies while packaging the Utility classes using the below code in pom.xml.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- Fools the plugin into creating the code only jar instead of the runnable one -->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
But when I include the exec jar created into the Business logic, it shows that the utility classes are not found.
WHAT I NEED:
How do I fix the 'org.hibernate.AssertionFailure'?
Should I exclude the dependencies while creating the jar from utility classes? How do I do it?
Incase it matters, I am using Eclipse.
attaching pom.xml: BusinessLogic
<?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>
<!-- Use maven profiles to control Spring Boot profile. -->
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<activeProfile>local</activeProfile>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<activeProfile>dev</activeProfile>
</properties>
</profile>
</profiles>
<groupId>com.usermanagement</groupId>
<artifactId>BusinessLogicClass</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Business Logic</name>
<description>Business Logic to handle user requests</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.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>
<org.mapstruct.version>1.2.0.Final</org.mapstruct.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-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.uuid</groupId>
<artifactId>java-uuid-generator</artifactId>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-jdk8</artifactId>
<version>1.2.0.Final</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>5.0.8.RELEASE</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.javers</groupId>
<artifactId>javers-core</artifactId>
<version>3.11.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.usermanagement</groupId>
<artifactId>CommonDBLogic</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.usermanagement</groupId>
<artifactId>UtilityClasses</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source> <!-- or higher, depending on your project -->
<target>${java.version}</target> <!-- or higher, depending on your project -->
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<compilerArg>
-Amapstruct.defaultComponentModel=spring
</compilerArg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<distributionManagement>
</distributionManagement>
</project>
Utility Class:
<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.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<groupId>com.usermanagement</groupId>
<artifactId>UtilityClasses</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>UtilityClasses</name>
<description>Utility Classes used by Business Logic class</description>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.objectlab.kit</groupId>
<artifactId>datecalc-common</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>net.objectlab.kit</groupId>
<artifactId>datecalc-jdk8</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.javers</groupId>
<artifactId>javers-core</artifactId>
<version>3.11.4</version>
</dependency>
<dependency>
<groupId>com.usermanagement</groupId>
<artifactId>CommonDBLogic</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- Fools the plugin into creating the code only jar instead of the runnable one -->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Common DB Logic:
<?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.usermanagement</groupId>
<artifactId>CommonDBLogic</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CommonDBLogic</name>
<description>Common DB Logic used by Business class</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.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>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.0.3.RELEASE</version>
</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-actuator</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>2.0.2.RELEASE</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</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>
<!-- Fools the plugin into creating the code only jar instead of the runnable one -->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
</distributionManagement>
</project>
Have you tried to use <exclusions> element on this project dependencies? Like:
Business Logic Project pom.xml file:
<dependency>
<groupId>com.utility.project</groupId>
<artifactId>UtilityProject</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>group.id.jar.you.want.to.exclude</groupId>
<artifactId>artifact.id.jar.you.want.to.exclude</artifactId>
</exclusion>
</exclusions>
</dependency>
UPDATE
Since you already have CommonDB dependencies on your UtilityProject pom, remove this CommonDB dependency from your business logic pom. This error is because you have 2 classes (same class) being registered with same name. If you already have CommonDB dependency on UtilityProject and you use this UtilityProject as dependency on Business, you don't need to import it twice.

mvn clean install intellij - compile error - can not find symbol

From Intellij Idea Using Build menu , projects compiles succesfully,
but when we compiling using "mvn clean install" command it fails. What can be reason for this?
Project Location:
And I added these libraries for success compile in intellij using
Project Structure->Libraries->New Project Library->Java
And this is how pom.xml looks
<?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.datastech.idmb.iba</groupId>
<artifactId>idmb-test</artifactId>
<version>3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<description>IDMB TEST module</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
<datas-spring.version>1.2-SNAPSHOT</datas-spring.version>
<!-- WEB -->
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
</properties>
<dependencies>
<!-- WEB -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax.servlet-api.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
</project>
Get dependencies pom syntax from https://mvnrepository.com/
add in pom.xml as follows
Remember to add suitable version in following <version> tag
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.10.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.10.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.mjeanroy/dbunit-plus -->
<dependency>
<groupId>com.github.mjeanroy</groupId>
<artifactId>dbunit-plus</artifactId>
<version>0.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.fcrepo.camel/fcrepo-camel -->
<dependency>
<groupId>org.fcrepo.camel</groupId>
<artifactId>fcrepo-camel</artifactId>
<version>4.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.dbunit/dbunit -->
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.4.8</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>

Drools (Maven) Error (Unable to build KieBaseModel:defaultKieBase)

I am working on a project, and I am stuck with this Drools part. When I want to interact with the server I get this error msg:
ERROR org.drools.compiler.kie.builder.impl.AbstractKieModule - Unable to build KieBaseModel:defaultKieBase
Here is my pom file, what could be missing? Thank you very much for your help!
<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.irobot</groupId>
<artifactId>irobot</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>irobot Maven Webapp</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>irobot.Client</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>6.1.0.Final</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mvel/mvel2 -->
<dependency>
<groupId>org.mvel</groupId>
<artifactId>mvel2</artifactId>
<version>2.1.0.drools8</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.bundles</groupId>
<artifactId>jaxrs-ri</artifactId>
<version>2.16</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>2.16</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-base</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-core</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-arq</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>6.1.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.drools/knowledge-api -->
<dependency>
<groupId>org.drools</groupId>
<artifactId>knowledge-api</artifactId>
<version>6.1.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.drools/drools-core -->
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>6.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>6.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.23</version>
</dependency>
</dependencies>
<properties>
<jersey.version>2.16</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

Maven parent build unable to find locally built child artifact

I have a directory structure like the following (following the suggestion here:
parent-dir
pom.xml
core-dir
|
------pom.xml
web-service-dir
|
------pom.xml
Here is my MAIN (parent-dir) pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ca.ubc</groupId>
<artifactId>iamWebServices</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>${project.artifactId}</name>
<url>http://maven.apache.org</url>
<properties>
<project_home>${project.dir}</project_home>
</properties>
<modules>
<module>core</module>
<module>webService</module>
</modules>
<dependencyManagement>
<dependencies>
<!-- Inter-Module dependencies -->
<dependency>
<groupId>ca.ubc.iam.core</groupId>
<artifactId>iamCore</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
And here is my POM.XML:
<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>ca.ubc</groupId>
<artifactId>iamWebServices</artifactId>
<version>1.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>iamCore</artifactId>
<groupId>ca.ubc.iam.core</groupId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<version>1.0</version>
<properties>
<target.dir>target</target.dir>
</properties>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cryptix</groupId>
<artifactId>cryptix</artifactId>
<version>3.2.0</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>
<groupId>libmd5</groupId>
<artifactId>md5tools</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>libojdbc6</groupId>
<artifactId>ojdbc6</artifactId>
<version>1.0.0</version>
</dependency> -->
<dependency>
<groupId>local.jcrypt</groupId>
<artifactId>jcrypt</artifactId>
<scope>system</scope>
<version>xx</version>
<systemPath>${project.basedir}/src/lib/jcrypt.jar</systemPath>
</dependency>
<dependency>
<groupId>local.md5tools</groupId>
<artifactId>md5tools</artifactId>
<version>xx</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/lib/md5tools.jar</systemPath>
</dependency>
<dependency>
<groupId>local.randomPasswordGenerator</groupId>
<artifactId>randomPasswordGenerator</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/lib/RandomPasswordGenerator.jar</systemPath>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<!-- <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version> <scope>system</scope> <systemPath>${project.basedir}/src/lib/ojdbc6.jar</systemPath>
</dependency> -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
</dependencies>
<build>
<finalName>iamcore</finalName>
<outputDirectory>${basedir}/${target.dir}/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<!-- copy-dependency plugin -->
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</build>
</project>
and finally, here is my POM.XML:
<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>ca.ubc</groupId>
<artifactId>iamWebServices</artifactId>
<version>1.0</version>
<relativePath>..</relativePath>
</parent>
<groupId>ca.ubc.iamws</groupId>
<artifactId>iamws</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>${project.artifactId}</name>
<properties>
<jersey.version>2.5.1</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
<codi.version>1.0.5</codi.version>
<target.dir>target</target.dir>
</properties>
<repositories>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ca.ubc.iam.core</groupId>
<artifactId>iamCore</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope></scope>
</dependency>
<dependency>
<groupId>cryptix</groupId>
<artifactId>cryptix</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>local.jcrypt</groupId>
<artifactId>jcrypt</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jcrypt.jar</systemPath>
</dependency>
<dependency>
<groupId>local.md5tools</groupId>
<artifactId>md5tools</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/md5tools.jar</systemPath>
</dependency>
<dependency>
<groupId>local.randomPasswordGenerator</groupId>
<artifactId>randomPasswordGenerator</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/RandomPasswordGenerator.jar</systemPath>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>${jersey.version}</version>
</dependency>
<!-- jackson dependencies for pojo/json support -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
</dependency>
<!-- end jackson deps -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-processing</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<!-- junit test and jersey client features -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<!-- Weld/CDI Begin -->
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>2.1.2.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>iamws</finalName>
<outputDirectory>${basedir}/${target.dir}/classes</outputDirectory>
<testOutputDirectory>${basedir}/${target.dir}/test-classes</testOutputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<packagingExcludes>src/test/*</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<!-- copy-dependency plugin -->
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>eclipse-folders</id>
<properties>
<target.dir>target-eclipse</target.dir>
</properties>
</profile>
</profiles>
</project>
When I build from the parent-dir and issue a command-line like:
mvn install
I get an error that the jar file cannot be found. What am I doing wrong?
[ERROR] Failed to execute goal on project iamws: Could not resolve dependencies for project ca.ubc.iamws:iamws:war:1.0: Could not find artifact ca.ubc.iam.core:iamCore:jar:1.0 in jboss-public-repository-group (https://repository.jboss.org/nexus/content/repositories/releases/) -> [Help 1]
It looks like it's trying to download my locally built jar file from an external repository, and I can't figure out how to fix that?
First of all you seem to have different artifactId, than module names. Although not a problem, it makes things a little bit harder to look at :)
When you issue a mvn install it will attempt to resolve the the pom files first to generate some effective POM files for the project, and that means that before it builds any of your modules, the parent pom needs to be resolved.
In the parent you depend on the iamcore module, but you haven't built it yet, and that's the reason why it fails.
Remove the dependency from the parent, and just put it into iamwebservice

Categories