Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven AutoValue Errors #305

Closed
konne88 opened this issue Mar 10, 2015 · 7 comments
Closed

Maven AutoValue Errors #305

konne88 opened this issue Mar 10, 2015 · 7 comments

Comments

@konne88
Copy link

konne88 commented Mar 10, 2015

I'm trying to build error-prone from source. I'm following this guide. It seems that something about AutoValue is broken/setup incorrectly.

Building error-prone without tests works:

mvn install -DskipTests

Running the tests fails with error messages containing:

AutoValue_MatchState cannot be resolved to a type

Importing the project into eclipse, with

Import ... -> Existing Maven Projects

doesn't build. I get the following errors:

AutoValue_AnalysesConfig cannot be resolved to a type
AutoValue_ChildMultiMatcher_MatchResult cannot be resolved to a type
AutoValue_ChildMultiMatcher_Matchable cannot be resolved to a type
AutoValue_GuardedByExpression_TypeLiteral cannot be resolved to a type
AutoValue_GuardedByExpression_Select cannot be resolved to a type
AutoValue_GuardedByExpression_LocalVariable cannot be resolved to a type
AutoValue_GuardedByExpression_ClassLiteral cannot be resolved to a type
AutoValue_GuardedByUtils_GuardedByValidationResult cannot be resolved to a type
AutoValue_GuardedByUtils_GuardedByValidationResult cannot be resolved to a type
AutoValue_LocalAnalysisAsTopLevelAnalysis cannot be resolved to a type
AutoValue_MatchState cannot be resolved to a type
AutoValue_RecompilingTopLevelAnalysis cannot be resolved to a type
AutoValue_Replacement cannot be resolved to a type
AutoValue_SumTopLevelAnalysis cannot be resolved to a type
AutoValue_TopLevelAnalysisWithSeverity cannot be resolved to a type

I'm using eclipse Luna on Mac. My maven version is:

mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T09:29:23-08:00)
Maven home: /usr/local/Cellar/maven/3.2.5/libexec
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.2", arch: "x86_64", family: "mac"
@cushon
Copy link
Collaborator

cushon commented Mar 10, 2015

Hey Konstantin! I'm not sure why you're seeing that error. Our jenkins builds are still passing with mvn 3.2.5 and both jdk7u76 and jdk8u31.

Does it still fail if you take a clean checkout of error prone and reset your local maven repo?

@konne88
Copy link
Author

konne88 commented Mar 10, 2015

Thanks for the quick response. Resetting everything fixed the maven build/tests!

Eclipse still doesn't build the project though, and reports the same errors as before. Is there anything special I have to do to get eclipse to work?

@eaftan
Copy link
Contributor

eaftan commented Mar 10, 2015

I've seen the same thing with Eclipse, and I think it's related to running the AutoValue annotation processor. Let me check with the AutoValue people and get back to you.

@konne88
Copy link
Author

konne88 commented Mar 10, 2015

I'm not sure if this is related, but my eclipse changes the annotation/.classpath file that is shipped with error-prone:

diff --git a/annotation/.classpath b/annotation/.classpath
index fd7ad7f..f619a53 100644
--- a/annotation/.classpath
+++ b/annotation/.classpath
@@ -12,7 +12,7 @@
                        <attribute name="maven.pomderived" value="true"/>
                </attributes>
        </classpathentry>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
                <attributes>
                        <attribute name="maven.pomderived" value="true"/>
                </attributes>

@eaftan
Copy link
Contributor

eaftan commented Mar 10, 2015

Konstantin, can you try the instructions in google/auto#94 (comment) ("use the maven-apt plugin from Jboss") and see if that fixes your problem?

@konne88
Copy link
Author

konne88 commented Mar 11, 2015

Thanks for all the help! Installing the m2e-apt plugin fixed the problem.

Maybe mentioning this in the guide would help future users.

@konne88 konne88 closed this as completed Mar 11, 2015
@cushon
Copy link
Collaborator

cushon commented Mar 11, 2015

Great, I updated the wiki. We should also document how to set up intellij, but I haven't managed to get intellij to run AutoValue on incremental builds yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants