Ich habe folgende Maven Struktur:Lombok in importierten Maven Modul
parent-module
|-model-module
|-model-contributor-module
In model-module
I Einheiten haben, die mit @lombok.Data
kommentiert. Wenn ich mvn clean install
auf model-module
mache, ist alles in Ordnung. Zweites inneres Modul model-contributor-module
enthält model-module
in Abhängigkeiten. Wenn ich versuche, das gleiche Build auf model-contributor-module
zu erstellen, erhalte ich einen Fehler cannot find symbol
.
pom.xml
für model-module
:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
Und pom.xml
für model-contributor-module
:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
.....
<pluginManagement>
<plugins>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.8.0</version>
</plugin>
</plugins>
</pluginManagement>
....
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.8.0</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>testDelombok</goal>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
Wie diese Zusammenstellung Fehler beheben?
[ERROR] /Users/superuser/Documents/workspace/project/test/src/main/java/com/company/services/impl/MyServiceImpl.java:[291,65] cannot find symbol
[ERROR] symbol: method getUserId()
Welchen Compiler Fehler können Sie das auch buchen? – soorapadman
@soorapadman, habe ich hinzugefügt Fehlermeldung –
Versuchen 'mvn saubere Installation -Dmaven.test.skip' – soorapadman