阿喀琉斯4.2.0编译错误-找不到符号符号:类表位置:包info.archinnov.achilles.annotations [英] Achilles 4.2.0 compilation error - cannot find symbol symbol: class Table location: package info.archinnov.achilles.annotations

查看:76
本文介绍了阿喀琉斯4.2.0编译错误-找不到符号符号:类表位置:包info.archinnov.achilles.annotations的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在编译简单的Achilles Maven项目时遇到一些问题。
我的pom.xml:

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​​ntellij Idea注释过程: https://github.com/doanduyhai/Achilles/wiki/IDE-configuration

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

当我尝试运行mvn -X clean install时,我遇到了一些错误编译:

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

用户是我的实体

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;
    }
}

我在做什么错了?

推荐答案

对我来说 User 类包含到程序包中已解决问题。

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

问题似乎出在代码生成的方式上,如您提到的IDE配置页面

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:


在某些情况下,如果处理器无法正确生成代码,则可能需要使用Maven进行干净的构建(实际上,这是唯一在任何情况下都可以100%运行的方法)。为此,请打开一个shell终端并键入 mvn clean compile ,然后返回IDE并刷新您的项目,您应该会看到生成的代码。

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.

这篇关于阿喀琉斯4.2.0编译错误-找不到符号符号:类表位置:包info.archinnov.achilles.annotations的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆