Cannot Find Symbol Error In Maven
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of maven compile failure cannot find symbol this site About Us Learn more about Stack Overflow the company Business Learn
Maven Cannot Find Symbol Build Error
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question maven cannot find symbol dependency x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up maven
Maven Cannot Find Symbol Method
“cannot find symbol” message unhelpful up vote 46 down vote favorite 3 This is a really simple question, and it's probably a setting somewhere I don't know about, but Google is being particularly unhelpful for this question, giving results about compilation errors, not how to change compilation error messages. When I build my project with maven, it will give me error messages formatted cannot find symbol error in java roughly as follows: [ERROR] /path/to/source/Main.java:[13,8] error: cannot find symbol When I build with ant or javac, it will actually tell me the symbol that it can't find in the error message. maven gives me a line number and character position, but displaying the actual symbol would be more helpful. The line above is the only line given for each of the "cannot find symbol" errors. There is no line above or below that gives the symbol. I imagine there has to be some way to get maven to tell me that information, but I don't know what it is. I tried the -e option, as mvn told me to try using it, but it gave a maven traceback for the error, not the actual symbol. Any help? Here's the output of mvn --version Apache Maven 3.0.4 (rNON-CANONICAL_2012-10-24_11-25_mockbuild; 2012-10-24 07:25:04-0400) Maven home: /usr/share/maven Java version: 1.7.0_09-icedtea, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.6.6-1.fc17.x86_64", arch: "amd64", family: "unix" And here's an example (unhelpful) error message, exactly as output by maven (just with directories shortened): [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [IN
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn
Cannot Find Symbol Error In Java Interface
more about Stack Overflow the company Business Learn more about hiring developers or posting
Error Cannot Find Symbol Javac
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack error cannot find symbol class Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Maven clean install: cannot find symbol up vote 2 down vote http://stackoverflow.com/questions/14164386/maven-cannot-find-symbol-message-unhelpful favorite 1 My Maven clean install is failing. Below is the error message. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project MyProject: Compilation failure: Compilation failure: [ERROR] C:\..\MyClass.java:[13,2] cannot find symbol [ERROR] symbol : class MyAnnotation [ERROR] location: class mypackage.MyClass MyClass.java public class MyClass{ @MyAnnotation public static class MyAnnotation{ //some static nested class code here... } MyAnnotation.java @Retention (RetentionPolicy.RUNTIME) public @interface MyAnnotation{ } I have no clue http://stackoverflow.com/questions/19167545/maven-clean-install-cannot-find-symbol why this would present problems, can anyone please give me some ideas? java maven build annotations share|improve this question edited Oct 3 '13 at 19:34 blackpanther 4,65852043 asked Oct 3 '13 at 19:24 Jason 5252723 5 You have both a class and an annotation named MyAnnotation? Sounds like a bad idea. –user1907906 Oct 3 '13 at 19:26 It's a project that I inherited and do not have access to source :( –Jason Oct 3 '13 at 19:28 Then at least check your packages. The Java compiler needs to know where your classes are. –user1907906 Oct 3 '13 at 19:29 2 If you don't have access to the source, then what's maven compiling? And how would you know the source looks like that? –Kayaman Oct 3 '13 at 19:30 Sorry bad wording, I can see the source but I have inherited jar file. I cannot change it –Jason Oct 3 '13 at 19:32 add a comment| 3 Answers 3 active oldest votes up vote 6 down vote accepted Found the problem... I apologize as I didn't include enough code for anyone to determine the root cause of the issue, normally I don't include import statements in
BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure C:\source\location\target\clover\src-test\com\acme\SomeClass.java:[11,35] cannot https://confluence.atlassian.com/cloverkb/maven-2-plugin-fails-with-cannot-find-symbol-exception-when-defining-two-locations-for-source-files-177340627.html find symbol symbol: class SomeClass You have a Maven project that compiles and installs just fine, but https://bukkit.org/threads/maven-compile-error.195917/ when run with the Clover goals on it fails with the above error. The project is set up cannot find a little bit different, as the source is in two folders, for example: src/main/java/core, and src/main/java/gen. The maven-compiler-plugin is configured to handle this as below:
BukkitDev ProfileMy Plugins (2) Hello bukkit, I finally got maven to work to compile plugins and everything, then when I tried to compile a plugin that has code with packets, it says that it does not exist. pom.xml: Code: