1

I have some problems with compile simple achilles maven project. My pom.xml:

<dependencies>
        <dependency>
            <groupId>info.archinnov</groupId>
            <artifactId>achilles-core</artifactId>
            <version>4.2.0</version>
        </dependency>
        <dependency>
            <groupId>info.archinnov</groupId>
            <artifactId>achilles-model</artifactId>
            <version>4.2.0</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>
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                </configuration>
            </plugin>
        </plugins>
    </build>

I configured Intellij Idea Annotation Process like here: https://github.com/doanduyhai/Achilles/wiki/IDE-configuration

when i try to run mvn -X clean install i have got some errors compilation:

[ERROR] /home/konrad/Pulpit/CassandraAchilles/target/generated-sources/annotations/info/archinnov/achilles/generated/meta/entity/User_AchillesMeta.java:[49,69] cannot find symbol
  symbol: class User
[ERROR] /home/konrad/Pulpit/CassandraAchilles/target/generated-sources/annotations/info/archinnov/achilles/generated/manager/User_Manager.java:[25,57] cannot find symbol
  symbol: class User
[ERROR] /home/konrad/Pulpit/CassandraAchilles/target/generated-sources/annotations/info/archinnov/achilles/generated/meta/entity/User_AchillesMeta.java:[59,38] cannot find symbol
  symbol:   class User
  location: class info.archinnov.achilles.generated.meta.entity.User_AchillesMeta
[ERROR] /home/konrad/Pulpit/CassandraAchilles/target/generated-sources/annotations/info/archinnov/achilles/generated/meta/entity/User_AchillesMeta.java:[70,38] cannot find symbol
  symbol:   class User
  location: class info.archinnov.achilles.generated.meta.entity.User_AchillesMeta

User is my entity:

import info.archinnov.achilles.annotations.Column;
import info.archinnov.achilles.annotations.PartitionKey;
import info.archinnov.achilles.annotations.Table;

@Table(keyspace = "example", table = "user")
public class User {

    @PartitionKey
    private Long id;

    @Column("fname")
    private String firstName;

    @Column("age")
    private int age;


    public User() {
    }

    public User(Long id, String firstName, int age) {
        this.id = id;
        this.firstName = firstName;
        this.age = age;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

What am I doing wrong?

CSniper
  • 333
  • 2
  • 4
  • 14

1 Answers1

0

For me including the User class into a package solved the problem.

It seems that the problem comes from the way the code is generated, as explained at the end of the IDE configuration page you mentioned:

In some cases, if the processor does not generate the code correctly, you may need to do a clean build with Maven (this is actually the only method that is working 100% in any case). For this open a shell terminal and type mvn clean compile then go back to the IDE and refresh your project, you should see the generated code.

Rémi.B
  • 183
  • 10