У меня есть приложение, которое использует AspectJ и Spring Roo.У меня нет опыта работы с этими технологиями.Во время сборки Maven (3.3.9) я получил ошибку в консоли:
im@im:~/projects/maintenance$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maintenance 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ maintenance ---
[INFO]
[INFO] --- aspectj-maven-plugin:1.2:compile (default) @ maintenance ---
[ERROR] The method getId() is undefined for the type Employee
, и ошибка справедлива, потому что у меня действительно нет метода getId()
в классе Employee
, ноУ меня есть эти аннотации:
import ...
@RooJavaBean
@RooToString
@RooJpaActiveRecord(persistenceUnit = "entityManagerFactoryMaintenance", identifierField = "id", identifierColumn = "EMPLOYEE_ID", versionColumn = "", versionField = "", finders = { "findEmployeesByHireDateIsNull" }, mergeMethod = "", persistMethod = "", removeMethod = "")
@JsonSerialize(include = Inclusion.NON_NULL)
@Table(name = "EMPLOYEES"/*, schema = Constants.ORACLE_MAINTENANCE_SCHEMA*/)
public class Employee {..}
Я предполагаю, что проблема где-то в AspectJ.Вот мои pom.xml
разделы, которые содержат AspectJ:
<properties>
<aspectj.version>1.8.1</aspectj.version>
<java.version>8</java.version>
<roo.version>1.3.1.RC1</roo.version>
<hibernate.version>4.0.1.Final</hibernate.version>
<spring.version>4.0.9.RELEASE</spring.version>
...
</properties>
...
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
...
</dependencies>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.2</version>
<!-- NB: do not use 1.3 or 1.3.x due to MASPECTJ-90 and do not use 1.4
due to declare parents issue -->
<dependencies>
<!-- NB: You must use Maven 2.0.9 or above or these are ignored (see
MNG-2972) -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<outxml>true</outxml>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version>
<!-- Note 2.8 does not work with AspectJ aspect path -->
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
<additionalBuildcommands>
<buildCommand>
<name>org.eclipse.ajdt.core.ajbuilder</name>
<arguments>
<aspectPath>org.springframework.aspects</aspectPath>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
</buildCommand>
</additionalBuildcommands>
<additionalProjectnatures>
<projectnature>org.eclipse.ajdt.ui.ajnature</projectnature>
<projectnature>com.springsource.sts.roo.core.nature</projectnature>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
</configuration>
</plugin>
...
</plugins>
</build>
Также я не уверен насчет IDE.Я использую IntelliJ IDEA 2019.1.2 (Ultimate Edition) в Ubuntu.Так ли важно использовать Eclipse?
Что я могу сделать, создав приложение?