For some reason this command works fine with my local machine:
mvn clean install -DskipTests=true -Psdk
However for Codeship it does now work and throws this "Cannot find symbol" error. In Codeship the full command is:
jdk_switcher use oraclejdk8
echo $JAVA_HOME
mvn clean install -DskipTests=true -Psdk
In the POM the repository have this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
Error:
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ client-app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 65 source files to /home/rof/src/bitbucket.org/company/client-app/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/rof/src/bitbucket.org/company/client-app/src/main/java/com/client/rest/resources/MyResource.java:[3,61] cannot find symbol
symbol: class MyEntity
Your Maven is reading Java version as 1.8, Where as the pom.xml says the version is 1.7.
Try installing the required verison.
If already installed check your $JAVA_HOME environment variable, it should contain the path of Java JDK 8. If you dont find it, fix your environment variable.
also remove the lines
<fork>true</fork>
<executable>${JAVA_1_8_HOME}/bin/javac</executable>
from the pom.xml
I had the same issue. reason was one of the class was used in
src/main/java/
Where as in actual it was present in
src/test/java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With