Maven compilation failure

1,263 views
Skip to first unread message

Sura

unread,
Aug 12, 2015, 5:12:46 AM8/12/15
to Project Lombok
When running

mvn install

I get following error messages at places where I call lombok getters:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project lab-web: Compilation failure: Compilation failure:
[ERROR] /Users/sura/IdeaProjects/lab-web/src/main/java/ch/ildsoftware/lab/security/SecurityUserDetailsService.java:[45,84] error: cannot find symbol
[ERROR] variable user of type User
[ERROR] /Users/sura/IdeaProjects/lab-web/src/main/java/ch/ildsoftware/lab/controller/UserController.java:[38,50] error: cannot find symbol
[ERROR] variable user of type User
[ERROR] /Users/sura/IdeaProjects/lab-web/src/main/java/ch/ildsoftware/lab/controller/UserController.java:[44,35] error: cannot find symbol
[ERROR] variable user of type UserNewDTO
[ERROR] /Users/sura/IdeaProjects/lab-web/src/main/java/ch/ildsoftware/lab/controller/UserController.java:[44,55] error: cannot find symbol
[ERROR] variable user of type UserNewDTO
[ERROR] /Users/sura/IdeaProjects/lab-web/src/main/java/ch/ildsoftware/lab/controller/UserController.java:[44,72] error: cannot find symbol

Here is that line 44:


userService.createUser(user.getUsername(), user.getEmail(), user.getPlainTextPassword());


Whereas in User it’s simply


@Getter @Setter private String username;
@Getter @Setter private String passwordDigest;
@Getter @Setter private String email;



The lombok Plugin in Intellij Idea is enabled, as well as the little tick in Annotation Processors in both locations (Mac). 


1.) Intellij Idea -> Preferences -> Compiler -> Annotation Processors
2.) File -> Other Settings -> Default Settings -> Compiler -> Annotation Processors


Build -> Rebuild Project runs without errors or warnings.

Parts of my pom.xml:

<dependency>
 
<groupId>org.projectlombok</groupId>
 
<artifactId>lombok</artifactId>
 
<version>1.16.4</version>
 
<scope>provided</scope>
</dependency>

...

<build>
 
<finalName>${project.artifactId}-${project.version}</finalName>
 
<plugins>
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-compiler-plugin</artifactId>
 
<version>2.3.2</version>
 
<configuration>
 
<source>${java-version}</source>
 
<target>${java-version}</target>
 
</configuration>
 
</plugin>
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-dependency-plugin</artifactId>
 
<executions>
 
<execution>
 
<id>install</id>
 
<phase>install</phase>
 
<goals>
 
<goal>sources</goal>
 
</goals>
 
</execution>
 
</executions>
 
</plugin>
 
<plugin>
 
<groupId>org.apache.tomcat.maven</groupId>
 
<artifactId>tomcat7-maven-plugin</artifactId>
 
<version>2.2</version>
 
<configuration>
 
<path>/</path>
 
<httpsPort>8443</httpsPort>
 
<keystoreFile>${basedir}/other/keystore.jks</keystoreFile>
 
<keystorePass>secret</keystorePass>
 
</configuration>
 
</plugin>
 
</plugins>
</build>

Maven 3
Java 1.8
Lombok 1.16.4
Tomcat 7.0.62

How can I get it to compile without errors?
Thanks a lot.

George Stanchev

unread,
Aug 15, 2015, 4:45:15 PM8/15/15
to Project Lombok
I got the same error. Searching google revealed that circa Lobok 0.12.x there was similiar problem that was reported fixed by the developers.

I looks like regression.

I used

<dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.14.2</version>
      <scope>provided</scope>
    </dependency>

and it fixed the problem.

Someone should file a bug over this

George
Reply all
Reply to author
Forward
0 new messages