天天看点

JAVA签名已损坏,java – Maven编译器插件错误:无法访问枚举(错误签名,坏类)

我正在使用maven-compiler-plugin:2.3.2并且每当我在导入中具有枚举(ContentType)的类中进行更改时,我需要清理,否则它会给我:

ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project wp2: Compilation failure

[ERROR] /home/semyon/development/.../ContentManager.java:[15,46] error: cannot access ContentType

[ERROR] -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project wp2: Compilation failure

/home/semyon/development/.../ContentManager.java:[15,46] error: cannot access ContentType

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:364)

...

ContentType是枚举,如下所示:

import org.jetbrains.annotations.NotNull;

public enum ContentType {

...;

private final String title;

private final boolean hasJad;

private final CoreType coreType;

private final String[] searchKeywords;

ContentType(@NotNull String title, CoreType coreType, boolean hasJad, String[] searchKeywords) {

this.title = title;

this.coreType = coreType;

this.hasJad = hasJad;

this.searchKeywords = searchKeywords;

}

@NotNull

public String getTitle() {

return title;

}

@NotNull

public String getName() {

return name();

}

@NotNull

public CoreType getCoreType() {

return coreType;

}

public enum CoreType {

...;

private String title;

CoreType(String title) {

this.title = title;

}

public String getTitle() {

return title;

}

}

}

UPD1,项目结构:

/wp2

/core

/cpe

/widget

/ContentManager.java

/cdr

/entities

/ContentType.java

UPD 2:

ContentManager.java:[15,46]是导入wp2.core.cdr.entities.ContentType;

UPD 3:

现代编译器也会显示错误的类和错误的签名错误