I am using maven-compiler-plugin:2.3.2
and every time I make changes in classes which have an enum (ContentType
) in imports, I need to make clean
, otherwise it gives me:
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 is enum
and looks like this:
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, project structure:
/wp2
/core
/cpe
/widget
/ContentManager.java
/cdr
/entities
/ContentType.java
UPD 2:
ContentManager.java:[15,46] is import wp2.core.cdr.entities.ContentType;
UPD 3:
Modern compiler will show bad class
and bad signature
errors as well
pom.xml
and show us your directory structure.