-4

I was trying to deploy my project into a fat jar, but it failed, I'v tried to run the mvn clean before the mvn install, and everything is looks fine, but the error still happens on all the classes of my project. here is the error (of 1 class):

CMD

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile <default-compile> on project application: Compilation failure: Compilation failure: [ERROR] /C:/Workspace/MyProject/src/main/com/project/Customer.java [35, 41] cannot find symbol

pom.xml

<groupId>project</groupId>
<artifactId>application</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.5.RELEASE</version>
    <relativePath />
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-ws</artifactId>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>2.11.0</version>
    </dependency>
    <dependency>
        <groupId>org.jgroups</groupId>
        <artifactId>jgroups</artifactId>
        <version>3.6.4.Final</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <executable>true</executable>
            </configuration>
        </plugin>
    </plugins>
    <finalName>executableJar</finalName>
</build>

Any ideas on how to solve this issue?

The line form the code

line 35 / ^ = 41

    public int deleteUser (long id, Regi^on region) throws MyException;

Answer

So after a few hours of searching The problem was that the pom.xml didn't had the dependency that was needed to read this classes, I'v just added the dependency to my pom.xml file and everything is working fine!

Fima Taf
  • 929
  • 9
  • 22
  • The compiler error is directing you to a certain line and character on that line - would be best to add that snippet in the question as well. – markdsievers Aug 19 '16 at 12:20

1 Answers1

1

I might have it wrong compeletly but isn't the error message saying there is a character missing in your Customer class, i would asume at line 41, character 35 (I assume the end of the line, so most likely you're missing a " ; ".)

Is your IDE showing any errors ?

Nodon Darkeye
  • 532
  • 5
  • 20
  • Nop, thats the problem, I'v added this specific line above. – Fima Taf Aug 19 '16 at 12:29
  • There you go Regi^on seems to not be a valid class. Typo's happen so easily! – Nodon Darkeye Aug 19 '16 at 12:54
  • I'v passed over my code and i saw that most of the lines and the characters that was printed is a classes from an external API that I'v implemented, it means that the compiler doesn't see this classes. Is there a way to fix it? – Fima Taf Aug 19 '16 at 15:24