I am working on a module in a project that's to convert old data structure to match updated data structure. Since most of the methods and classes required for said conversion have already been implemented in a prior module in the same project, I added the prior module as a dependency in the new module.
It works, as I can access the required classes and their public methods. However, when I run 'mvn clean install' to build the new module, the new module's build fails with errors about not finding the imported classes.
Here is the parent pom file:
<?xml version="1.0" encoding="UTF-8"?>
<!--suppress MavenModelInspection -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hcb.migration.bioenrol</groupId>
<artifactId>hcb-migration-bienrol</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<java.version>1.8</java.version>
<maven.compiler.version>3.8.0</maven.compiler.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<modules>
<module>abis-migrations-imports</module>
<module>abis-migrations-export</module>
<module>abis-migrations-conversion</module>
<module>runtime-migrations-export</module>
<module>runtime-migrations-conversion</module>
<module>runtime-migrations-import</module>
</modules>
<distributionManagement>
<snapshotRepository>
<!-- This repo requires credentials from your ~/.m2/settings.xml -->
<id>archiva-snapshot-repo</id>
<name>hcb-snapshot-repo</name>
<url>http://archiva.hcb:8080/repository/archiva-snapshot-repo/</url>
</snapshotRepository>
<repository>
<!-- This repo requires credentials from your ~/.m2/settings.xml -->
<id>archiva-release-repo</id>
<name>hcb-release-repo</name>
<url>http://archiva.hcb:8080/repository/archiva-release-repo/</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<!-- This repo requires credentials from your ~/.m2/settings.xml -->
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>archiva-snapshot-repo</id>
<name>hcb-snapshot-repo</name>
<url>http://archiva.hcb:8080/repository/archiva-snapshot-repo/</url>
</repository>
<repository>
<!-- This repo requires credentials from your ~/.m2/settings.xml -->
<id>archiva-release-repo</id>
<name>hcb-release-repo</name>
<url>http://archiva.hcb:8080/repository/archiva-release-repo/</url>
</repository>
</repositories>
</project>
This is the pom file of the older module:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>hcb-migration-bienrol</artifactId>
<groupId>com.hcb.migration.bioenrol</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>abis-migrations-conversion</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- MMABIS client -->
<dependency>
<groupId>com.hcb.3rdparty.libs</groupId>
<artifactId>neurotec-abis-client-management-rest</artifactId>
<version>12.0.0.0</version>
</dependency>
<dependency>
<groupId>com.hcb.services.bioenroll</groupId>
<artifactId>bioenroll-inf</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Add class with main method to manifest-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.4.RELEASE</version>
<configuration>
<mainClass>com.hcb.neurotec.migrations.conversion.AbisExportConverter</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
This is the pom file of the module I am working on whose build fails:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>hcb-migration-bienrol</artifactId>
<groupId>com.hcb.migration.bioenrol</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>runtime-migrations-conversion</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.hcb.migration.bioenrol</groupId>
<artifactId>abis-migrations-conversion</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.4.RELEASE</version>
<configuration>
<mainClass>com.hcb.runtime.migrations.conversion.RuntimeConversionApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Here is the build error:
[INFO] 45 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.418 s
[INFO] Finished at: 2023-01-20T12:23:07+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project runtime-migrations-conversion: Compilation failure: Compilation failure:
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[4,46] package com.hcb.neurotec.migrations.conversion does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[5,46] package com.hcb.neurotec.migrations.conversion does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[6,46] package com.hcb.neurotec.migrations.conversion does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[7,46] package com.hcb.neurotec.migrations.conversion does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[8,56] package com.hcb.neurotec.migrations.conversion.exception does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[9,52] package com.hcb.neurotec.migrations.conversion.pojos does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[10,52] package com.hcb.neurotec.migrations.conversion.pojos does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[11,52] package com.hcb.neurotec.migrations.conversion.pojos does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[12,52] package com.hcb.neurotec.migrations.conversion.pojos does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[13,52] package com.hcb.neurotec.migrations.conversion.utils does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[27,59] package com.hcb.neurotec.migrations.conversion.utils does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[31,13] cannot find symbol
[ERROR] symbol: class DirectoryUtils
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[32,13] cannot find symbol
[ERROR] symbol: class ConversionDemograhpicsInfo
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[33,13] cannot find symbol
[ERROR] symbol: class ConversionFaceInfo
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[34,13] cannot find symbol
[ERROR] symbol: class ConversionPrintInfo
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[35,13] cannot find symbol
[ERROR] symbol: class ConversionIrisInfo
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[39,13] cannot find symbol
[ERROR] symbol: class SubjectDemographicsConverter
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[44,74] cannot find symbol
[ERROR] symbol: class SubjectDemographicsConverter
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[50,42] cannot find symbol
[ERROR] symbol: class ConversionException
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[63,42] cannot find symbol
[ERROR] symbol: class ConversionException
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[95,35] cannot find symbol
[ERROR] symbol: class SubjectDemographicsConverter
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[95,101] cannot find symbol
[ERROR] symbol: class ConversionException
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[171,43] cannot find symbol
[ERROR] symbol: class ConversionException
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[205,43] cannot find symbol
[ERROR] symbol: class ConversionException
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/pojo/RConversionSubInfo.java:[238,12] cannot find symbol
[ERROR] symbol: class ConversionDemograhpicsInfo
[ERROR] location: class com.hcb.runtime.migrations.conversion.pojo.RConversionSubInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RConvertedRecordInfo.java:[7,56] package com.hcb.neurotec.migrations.conversion.exception does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RConvertedRecordInfo.java:[8,52] package com.hcb.neurotec.migrations.conversion.utils does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RConvertedRecordInfo.java:[25,13] cannot find symbol
[ERROR] symbol: class DirectoryUtils
[ERROR] location: class com.hcb.runtime.migrations.conversion.RConvertedRecordInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RConvertedRecordInfo.java:[63,69] cannot find symbol
[ERROR] symbol: class ConversionException
[ERROR] location: class com.hcb.runtime.migrations.conversion.RConvertedRecordInfo
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionApplication.java:[3,56] package com.hcb.neurotec.migrations.conversion.exception does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionApplication.java:[4,54] package com.hcb.neurotec.migrations.conversion.network does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionApplication.java:[5,54] package com.hcb.neurotec.migrations.conversion.network does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionApplication.java:[6,61] package com.hcb.neurotec.migrations.conversion.network.config does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionApplication.java:[18,51] cannot find symbol
[ERROR] symbol: class ConversionException
[ERROR] location: class com.hcb.runtime.migrations.conversion.RuntimeConversionApplication
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[3,46] package com.hcb.neurotec.migrations.conversion does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[4,56] package com.hcb.neurotec.migrations.conversion.exception does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[5,54] package com.hcb.neurotec.migrations.conversion.network does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[6,54] package com.hcb.neurotec.migrations.conversion.network does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[7,52] package com.hcb.neurotec.migrations.conversion.utils does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[15,59] package com.hcb.neurotec.migrations.conversion.utils does not exist
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[15,1] static import only from classes and interfaces
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[19,19] cannot find symbol
[ERROR] symbol: class SubjectDemographicsConverter
[ERROR] location: class com.hcb.runtime.migrations.conversion.RuntimeConversionImpl
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[22,34] cannot find symbol
[ERROR] symbol: class EnrolmentAPI
[ERROR] location: class com.hcb.runtime.migrations.conversion.RuntimeConversionImpl
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[22,61] cannot find symbol
[ERROR] symbol: class ConfigurationAPI
[ERROR] location: class com.hcb.runtime.migrations.conversion.RuntimeConversionImpl
[ERROR] /C:/Users/ikechukwua/IdeaProjects/migration-bioenrol/runtime-migrations-conversion/src/main/java/com/hcb/runtime/migrations/conversion/RuntimeConversionImpl.java:[26,80] cannot find symbol
[ERROR] symbol: class ConversionException
[ERROR] location: class com.hcb.runtime.migrations.conversion.RuntimeConversionImpl
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I have checked that they're both accounted for in the parent pom, I also ensured that the older module built successfully with 'mvn clean install' before trying to build the module where it is used as a dependency.
Solved the error. Found out that the module I intend on importing as a dependency when built with mvn clean install, does not build correctly in the first place because:
<build>
<plugins>
<!-- Add class with main method to manifest-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.4.RELEASE</version>
<configuration>
<mainClass>com.hcb.neurotec.migrations.conversion.AbisExportConverter</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The module is not a spring project, so when the build gets to this block of code, it encounters issues that aren't surprisingly flagged. Removing this block in the old module allowed the new module build successfully.
Related
I am currently using Spring Framework version 4.1.6.RELEASE. When I try to upgrade its version to 4.2.4.RELEASE, my projects is in trouble.
Upgrading version to 4.1.7 - 4.2.3 is totally fine, but I need above 4.2.4 version. Can anyone tell me what is wrong here?
Here is my entire pom.xml.
And now I am also having this problem while I am testing my api with jUnit.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.isu</groupId>
<artifactId>ifm</artifactId>
<name>IfMobileHrAdapterService</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<!-- Generic properties -->
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Spring -->
<springframework.version>4.2.5.RELEASE</springframework.version>
<springframework.jpa.version>1.8.0.RELEASE</springframework.jpa.version>
<springframework.ldap.version>2.0.3.RELEASE</springframework.ldap.version>
<!-- Mysql -->
<db.version>5.1.35</db.version>
<!-- Hibernate / JPA -->
<hibernate.version>4.3.8.Final</hibernate.version>
<hibernate.validator.version>5.1.3.Final</hibernate.validator.version>
<hibernate.core.version>4.3.8.Final</hibernate.core.version>
<org.aspectj-version>1.8.5</org.aspectj-version>
<!-- Logging -->
<org.slf4j-version>1.6.6</org.slf4j-version>
<!-- Test -->
<junit.version>4.11</junit.version>
</properties>
<repositories>
<repository>
<id>thirdparty</id>
<url>http://hatch.pearbranch.com:8081/content/repositories/thirdparty</url>
</repository>
</repositories>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.tika/tika-core -->
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>1.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tika/tika -->
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika</artifactId>
<version>1.8</version>
<type>pom</type>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<!-- Oracle -->
<dependency>
<groupId>oracle</groupId>
<artifactId>OracleDriver</artifactId>
<version>11.2.0.1.0</version>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/ojdbc6.jar</systemPath>
</dependency>
<dependency>
<groupId>log4sql</groupId>
<artifactId>log4sql</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/log4sql.jar</systemPath>
</dependency>
<!-- JSON -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20141113</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${springframework.version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${springframework.version}</version>
</dependency>
</dependencies>
<build>
<!-- <sourceDirectory>src</sourceDirectory> -->
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
PS D:\Workspace\SpringToolSuiteProjects\ifMobileApiUnitTest> mvn clean package
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.isu:ifm:war:1.0.0-BUILD-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for oracle:OracleDriver:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/ojdbc6.jar will be unresolvable by dependent projects # line 76, column 16
[WARNING] 'dependencies.dependency.systemPath' for log4sql:log4sql:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/log4sql.jar will be unresolvable by dependent projects # line 84, column 16
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:spring-beans:jar -> duplicate declaration of version ${springframework.version} # line 178, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ----------------------------< com.isu:ifm >-----------------------------
[INFO] Building IfMobileHrAdapterService 1.0.0-BUILD-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # ifm ---
[INFO] Deleting D:\Workspace\SpringToolSuiteProjects\ifMobileApiUnitTest\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # ifm ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # ifm ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to D:\Workspace\SpringToolSuiteProjects\ifMobileApiUnitTest\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[4,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[5,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[6,24] package org.junit.runner does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[7,19] package org.mockito does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[8,19] package org.mockito does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[9,19] package org.mockito does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[18,30] package com.isu.ifm.hr.control does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[19,30] package com.isu.ifm.hr.service does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[21,2] cannot find symbol
symbol: class RunWith
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[26,23] cannot find symbol
symbol: class LoginService
location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[27,30] cannot find symbol
symbol: class LoginController
location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[4,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[5,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[6,24] package org.junit.runner does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[14,30] package com.isu.ifm.hr.control does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[16,2] cannot find symbol
symbol: class RunWith
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[23,9] cannot find symbol
symbol: class SalaryController
location: class com.isu.ifm.testcase.SalaryControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[4,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[6,24] package org.junit.runner does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[14,30] package com.isu.ifm.hr.control does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[16,2] cannot find symbol
symbol: class RunWith
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[23,9] cannot find symbol
symbol: class EDocumentController
location: class com.isu.ifm.testcase.EDocumentControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[26,10] cannot find symbol
symbol: class Mock
location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[27,10] cannot find symbol
symbol: class InjectMocks
location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[34,6] cannot find symbol
symbol: class Before
location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[40,6] cannot find symbol
symbol: class Test
location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[25,6] cannot find symbol
symbol: class Before
location: class com.isu.ifm.testcase.SalaryControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[30,6] cannot find symbol
symbol: class Test
location: class com.isu.ifm.testcase.SalaryControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[25,6] cannot find symbol
symbol: class Before
location: class com.isu.ifm.testcase.EDocumentControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[30,6] cannot find symbol
symbol: class Test
location: class com.isu.ifm.testcase.EDocumentControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[36,9] cannot find symbol
symbol: variable MockitoAnnotations
location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[23,49] cannot find symbol
symbol: class SalaryController
location: class com.isu.ifm.testcase.SalaryControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[23,55] cannot find symbol
symbol: class EDocumentController
location: class com.isu.ifm.testcase.EDocumentControllerTest
[INFO] 33 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.814 s
[INFO] Finished at: 2018-11-02T18:07:26+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project ifm: Compilation failure: Compilation failure:
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[4,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[5,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[6,24] package org.junit.runner does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[7,19] package org.mockito does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[8,19] package org.mockito does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[9,19] package org.mockito does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[18,30] package com.isu.ifm.hr.control does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[19,30] package com.isu.ifm.hr.service does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[21,2] cannot find symbol
[ERROR] symbol: class RunWith
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[26,23] cannot find symbol
[ERROR] symbol: class LoginService
[ERROR] location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[27,30] cannot find symbol
[ERROR] symbol: class LoginController
[ERROR] location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[4,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[5,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[6,24] package org.junit.runner does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[14,30] package com.isu.ifm.hr.control does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[16,2] cannot find symbol
[ERROR] symbol: class RunWith
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[23,9] cannot find symbol
[ERROR] symbol: class SalaryController
[ERROR] location: class com.isu.ifm.testcase.SalaryControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[4,17] package org.junit does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[6,24] package org.junit.runner does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[14,30] package com.isu.ifm.hr.control does not exist
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[16,2] cannot find symbol
[ERROR] symbol: class RunWith
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[23,9] cannot find symbol
[ERROR] symbol: class EDocumentController
[ERROR] location: class com.isu.ifm.testcase.EDocumentControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[26,10] cannot find symbol
[ERROR] symbol: class Mock
[ERROR] location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[27,10] cannot find symbol
[ERROR] symbol: class InjectMocks
[ERROR] location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[34,6] cannot find symbol
[ERROR] symbol: class Before
[ERROR] location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[40,6] cannot find symbol
[ERROR] symbol: class Test
[ERROR] location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[25,6] cannot find symbol
[ERROR] symbol: class Before
[ERROR] location: class com.isu.ifm.testcase.SalaryControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[30,6] cannot find symbol
[ERROR] symbol: class Test
[ERROR] location: class com.isu.ifm.testcase.SalaryControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[25,6] cannot find symbol
[ERROR] symbol: class Before
[ERROR] location: class com.isu.ifm.testcase.EDocumentControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[30,6] cannot find symbol
[ERROR] symbol: class Test
[ERROR] location: class com.isu.ifm.testcase.EDocumentControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/LoginControllerTest.java:[36,9] cannot find symbol
[ERROR] symbol: variable MockitoAnnotations
[ERROR] location: class com.isu.ifm.testcase.LoginControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/SalaryControllerTest.java:[23,49] cannot find symbol
[ERROR] symbol: class SalaryController
[ERROR] location: class com.isu.ifm.testcase.SalaryControllerTest
[ERROR] /D:/Workspace/SpringToolSuiteProjects/ifMobileApiUnitTest/src/main/java/com/isu/ifm/testcase/EDocumentControllerTest.java:[23,55] cannot find symbol
[ERROR] symbol: class EDocumentController
[ERROR] location: class com.isu.ifm.testcase.EDocumentControllerTest
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
i have also faced the same problem while updating the spring version
i checked your POM.XML File so there is no jackson dependency so add below dependency it works
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.8.1</version>
</dependency>
if you not used above dependency version use the latest version of dependency which version you want.
Just changing the version should work but you have to follow the instructions by spring community.
But before that clear the m2 repository and do clean install to download maven dependencies again in case if corrupted jars.
Upgrading-to-Spring-Framework-4.x
And try to do eclipse clean project and then Maven > update project should solve your issue.follow steps given below.
Project -> Clean
Restart Eclipse
Disable then re-enable dependency management (right-click Maven -> Disable Dependency Management then Maven -> Enable Dependency Management
Close and Reopen Project
Project -> Run as -> Maven Build -> Set goals as clean install -> Select options Update Snapshots Debug Output Non Recursive Resolve Workspace Artifacts -> Apply and Run
Repeat Step 5 after removing dependencies from ~/.m2/repository
Check that your Maven settings are configured correctly. If you are behind a proxy you'll need to configure the proxy settings in the global or user settings.
I want to document my project with swagger. I add swagger annotations and io.springfox dependencies to my project but when I run mvn clean package I have a lot of errors:
PS D:\parent-project> mvn clean package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] parent-project [pom]
[INFO] module-common-lib [jar]
[INFO] module1 [jar]
[INFO] module2 [jar]
[INFO]
[INFO] ------------< parent-project:parent-project >-------------
[INFO] Building parent-project 0.0.1-SNAPSHOT [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # parent-project ---
[INFO]
[INFO] -------< parent-project:module-common-lib >-------
[INFO] Building module-common-lib 0.0.1-SNAPSHOT [2/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # module-common-lib ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) # module-common-lib ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\parent-project\module-common-lib\src\main\resources
[INFO] skip non existing resourceDirectory D:\parent-project\module-common-lib\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) # module-common-lib ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to D:\parent-project\module-common-lib\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[6,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[7,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[9,2] cannot find symbol
symbol: class ApiModel
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldResponse.java:[4,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldResponse.java:[5,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseSimple.java:[5,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseSimple.java:[6,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseSimple.java:[8,2] cannot find symbol
symbol: class ApiModel
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldResponse.java:[7,2] cannot find symbol
symbol: class ApiModel
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[4,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[5,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[7,2] cannot find symbol
symbol: class ApiModel
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[31,10] cannot find symbol
symbol: class ApiModelProperty
location: class com.company.lab.microservices.common.api.ResponseInfo
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[40,10] cannot find symbol
symbol: class ApiModelProperty
location: class com.company.lab.microservices.common.api.ResponseInfo
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[49,10] cannot find symbol
symbol: class ApiModelProperty
location: class com.company.lab.microservices.common.api.ResponseInfo
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldResponse.java:[13,10] cannot find symbol
symbol: class ApiModelProperty
location: class com.company.lab.microservices.common.api.HelloWorldResponse
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseSimple.java:[13,10] cannot find symbol
symbol: class ApiModelProperty
location: class com.company.lab.microservices.common.api.ResponseSimple
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[14,10] cannot find symbol
symbol: class ApiModelProperty
location: class com.company.lab.microservices.common.api.HelloWorldMessageResponse
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[23,10] cannot find symbol
symbol: class ApiModelProperty
location: class com.company.lab.microservices.common.api.HelloWorldMessageResponse
[INFO] 19 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] parent-project 0.0.1-SNAPSHOT ............... SUCCESS [ 0.156 s]
[INFO] module-common-lib ................... FAILURE [ 1.530 s]
[INFO] module1 ..................... SKIPPED
[INFO] module2 0.0.1-SNAPSHOT ...... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.910 s
[INFO] Finished at: 2018-09-18T09:39:17+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project module-common-lib: Compilation failure: Compilation failure:
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[6,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[7,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[9,2] cannot find symbol
[ERROR] symbol: class ApiModel
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldResponse.java:[4,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldResponse.java:[5,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseSimple.java:[5,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseSimple.java:[6,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseSimple.java:[8,2] cannot find symbol
[ERROR] symbol: class ApiModel
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldResponse.java:[7,2] cannot find symbol
[ERROR] symbol: class ApiModel
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[4,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[5,30] package io.swagger.annotations does not exist
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[7,2] cannot find symbol
[ERROR] symbol: class ApiModel
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[31,10] cannot find symbol
[ERROR] symbol: class ApiModelProperty
[ERROR] location: class com.company.lab.microservices.common.api.ResponseInfo
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[40,10] cannot find symbol
[ERROR] symbol: class ApiModelProperty
[ERROR] location: class com.company.lab.microservices.common.api.ResponseInfo
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseInfo.java:[49,10] cannot find symbol
[ERROR] symbol: class ApiModelProperty
[ERROR] location: class com.company.lab.microservices.common.api.ResponseInfo
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldResponse.java:[13,10] cannot find symbol
[ERROR] symbol: class ApiModelProperty
[ERROR] location: class com.company.lab.microservices.common.api.HelloWorldResponse
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/ResponseSimple.java:[13,10] cannot find symbol
[ERROR] symbol: class ApiModelProperty
[ERROR] location: class com.company.lab.microservices.common.api.ResponseSimple
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[14,10] cannot find symbol
[ERROR] symbol: class ApiModelProperty
[ERROR] location: class com.company.lab.microservices.common.api.HelloWorldMessageResponse
[ERROR] /D:/workspace/parent-project/module-common-lib/src/main/java/com/company/lab/microservices/common/api/HelloWorldMessageResponse.java:[23,10] cannot find symbol
[ERROR] symbol: class ApiModelProperty
[ERROR] location: class com.company.lab.microservices.common.api.HelloWorldMessageResponse
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :module-common-lib
In this project both module1 and module2 use the common-lib to use JSON as a response type and to create the documentation with swagger.
Structure Project:
parent-project
pom.xml
module-common-lib
pom.xml
src/main/java
module1
src/main/java
src/main/resources
pom.xml
module2
src/main/java
src/main/resources
pom.xml
Pom.xml - parent-project:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<packageClassifier>exec</packageClassifier>
<spring-boot.version>1.5.9.RELEASE</spring-boot.version>
<spring-cloud.version>1.4.4.RELEASE</spring-cloud.version>
<springfox-swagger.version>2.6.1</springfox-swagger.version>
</properties>
<dependencyManagement>
<dependencies>
.....
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>module-common-lib</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox-swagger.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
Pom.xml - module-common-lib
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
</dependencies>
</dependencyManagement>
</project>
One of the classes with swagger annotations (the other classes have the same annotations but diferent code):
import java.io.Serializable;
import java.util.Optional;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
#ApiModel
public class ResponseSimple implements Serializable {
transient private static final long serialVersionUID = 5106222175899418836L;
private ResponseInfo responseInfo = new ResponseInfo();
#ApiModelProperty(notes = "Response info")
public ResponseInfo getResponseInfo() {
return responseInfo;
}
public void setResponseInfo(ResponseInfo responseInfo) {
this.responseInfo = responseInfo;
}
#Override
public String toString() {
return Optional.of(responseInfo).map(ri -> ri.toString()).orElse("");
}
}
I have Maven 3.5.4
Does anyone know why it does not work?
In your module-common-lib/pom.xml file, you only refer to the io.springfix:springfox-swagger2 dependency in the <dependencyManagement> element.
In the child POM, the <dependencies> element does not need to be inside a <dependencyManagement> element, since you are consuming the dependency (not just managing its version, scope, exclusions and so on for subsequent consumption - which is what the parent POM does).
Basically the fact that the dependency io.springfox:springfox-swagger2 is only in the <dependencyManagement> section means that it (and, more importantly, also its transitive dependency io.swagger:swagger-annotations which contains the io.swagger.annotationspackage) is not added to the compilation classpath.
You can verify this by running mvn dependency:build-classpath to see the classpath that Maven builds.
The fix is to remove the lines <dependencyManagement> and </dependencyManagement> in module-common-lib/pom.xml (but NOT from parent-project/pom.xml, where the element serves its intended purpose).
I am trying to deploy my app using heroku website, but it does not see any maven dependency like HttpServlet although I have it in my pom.xml AND it doesn't see Gson.jar although its in the lib directory. I have added webapp-runner plugin but nothing happened.
This is the error that I got. your help is appreciated. Thanks all.
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[6,21] package javax.servlet does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[7,26] package javax.servlet.http does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[8,26] package javax.servlet.http does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[9,26] package javax.servlet.http does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[11,48] package com.sun.javafx.collections.MappingChange does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[13,40] cannot find symbol
symbol: class HttpServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[15,30] cannot find symbol
symbol: class HttpServletRequest
location: class hotels.HotelDealsServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[15,54] cannot find symbol
symbol: class HttpServletResponse
location: class hotels.HotelDealsServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[15,87] cannot find symbol
symbol: class ServletException
location: class hotels.HotelDealsServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[24,64] cannot find symbol
symbol: class HttpServletRequest
location: class hotels.HotelDealsServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDeals.java:[14,23] package com.google.gson does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDeals.java:[15,48] package com.sun.javafx.collections.MappingChange does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/Deals.java:[6,48] package com.sun.javafx.collections.MappingChange does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[14,9] method does not override or implement a method from a supertype
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDeals.java:[26,38] cannot find symbol
symbol: class Gson
location: class hotels.HotelDeals
[INFO] 15 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.514 s
[INFO] Finished at: 2018-03-09T16:25:19+00:00
[INFO] Final Memory: 19M/177M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project hotels: Compilation failure: Compilation failure:
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[6,21] package javax.servlet does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[7,26] package javax.servlet.http does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[8,26] package javax.servlet.http does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[9,26] package javax.servlet.http does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[11,48] package com.sun.javafx.collections.MappingChange does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[13,40] cannot find symbol
[ERROR] symbol: class HttpServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[15,30] cannot find symbol
[ERROR] symbol: class HttpServletRequest
[ERROR] location: class hotels.HotelDealsServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[15,54] cannot find symbol
[ERROR] symbol: class HttpServletResponse
[ERROR] location: class hotels.HotelDealsServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[15,87] cannot find symbol
[ERROR] symbol: class ServletException
[ERROR] location: class hotels.HotelDealsServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[24,64] cannot find symbol
[ERROR] symbol: class HttpServletRequest
[ERROR] location: class hotels.HotelDealsServlet
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDeals.java:[14,23] package com.google.gson does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDeals.java:[15,48] package com.sun.javafx.collections.MappingChange does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/Deals.java:[6,48] package com.sun.javafx.collections.MappingChange does not exist
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDealsServlet.java:[14,9] method does not override or implement a method from a supertype
[ERROR] /tmp/build_d6140010f65ec320b1605ee2b8276832/khalidCS-deals-hotel-fa63bfd/src/main/java/hotels/HotelDeals.java:[26,38] cannot find symbol
[ERROR] symbol: class Gson
[ERROR] location: class hotels.HotelDeals
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
Adding POM posted in the answer section by OP
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.khalid.hotels</groupId>
<artifactId>hotels</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>embeddedTomcatSample Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<tomcat.version>8.5.23</tomcat.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>8.0.30.2</version>
<destFileName>webapp-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Please use the updated POM below:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.khalid.hotels</groupId>
<artifactId>hotels</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>embeddedTomcatSample Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<tomcat.version>8.5.23</tomcat.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>8.0.30.2</version>
<destFileName>webapp-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
</dependencies>
</project>
I am attempting to run Maven builds of a Java project, however tests are failing stating that the Player symbol cannot be founded, despite being imported.
Maven builds are failing as follows:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[4,31] error: cannot find symbol
[ERROR] package com.ffxivcensus.gatherer
/var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[22,8] error: cannot find symbol
[ERROR] class PlayerTest
/var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[22,27] error: cannot find symbol
[ERROR] class PlayerTest
/var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[116,12] error: cannot find symbol
[ERROR] class PlayerTest
/var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[116,28] error: cannot find symbol
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.415 s
[INFO] Finished at: 2016-01-18T15:35:38+01:00
[INFO] Final Memory: 18M/206M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (default-testCompile) on project XIVStats-Gatherer-Java: Compilation failure: Compilation failure:
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[4,31] error: cannot find symbol
[ERROR] package com.ffxivcensus.gatherer
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[22,8] error: cannot find symbol
[ERROR] class PlayerTest
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[22,27] error: cannot find symbol
[ERROR] class PlayerTest
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[116,12] error: cannot find symbol
[ERROR] class PlayerTest
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[116,28] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
My config is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ffxivcensus.gatherer</groupId>
<artifactId>XIVStats-Gatherer-Java</artifactId>
<version>1.0pre</version>
<name>XIVStats Lodestone Gatherer</name>
<url>https://github.com/xivstats</url>
<licenses>
<license>
<name>BSD 2-Clause License</name>
<url>https://opensource.org/licenses/BSD-2-Clause</url>
<distribution>repo</distribution>
</license>
</licenses>
<issueManagement>
<url>https://github.com/XIVStats/XIVStats-Gatherer-Java/issues</url>
<system>GitHub Issues</system>
</issueManagement>
<developers>
<developer>
<email>me#example.com</email>
<name>Peter Reid</name>
<url>https://github.com/reidweb</url>
<id>reidweb</id>
</developer>
<developer>
<email>me#example.com</email>
<name>Jonathan Price</name>
<url>https://github.com/pricetx</url>
<id>pricetx</id>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>mvnrepository.com</id>
<name>mvnrepository.com</name>
<url>http://mvnrepository.com/</url>
</repository>
</repositories>
<build>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
<finalName>${project.artifactId}-${project.version}</finalName>
<testOutputDirectory>target/test</testOutputDirectory>
<sourceDirectory>src/main</sourceDirectory>
<testSourceDirectory>src/test/</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<includes>
<include>src</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>com.ffxivcensus.gatherer.GathererController</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1207</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
See this github project
In your Maven-compiler-plugin definition:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<includes>
<include>src</include>
</includes>
</configuration>
</plugin>
Do not include the src folder directly. It will mess up the compilation order, Maven ends up building the test folder first, then fails on missing the main classes. Change it to this to make it work:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
</plugin>
I am trying to make changes in the sample Java Code provided by Spark JavaKafkaWordCount.java and trying to build it using Maven. I am working on Spark standalone module.
I am using following pom.xml:
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<modelVersion>4.0.0</modelVersion>
<name>Simple Project</name>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency> <!-- Spark dependency -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming-kafka_2.10</artifactId>
<version>1.5.1</version>
</dependency>
</dependencies>
</project>
When I run
mvn package
I get the following errors:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project my-app: Compilation failure: Compilation failure:
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[17,34] package org.apache.spark.streaming does not exist
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[18,43] package org.apache.spark.streaming.api.java does not exist
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[19,43] package org.apache.spark.streaming.api.java does not exist
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[20,43] package org.apache.spark.streaming.api.java does not exist
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[21,43] package org.apache.spark.streaming.api.java does not exist
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[39,5] cannot find symbol
[ERROR] symbol: class JavaStreamingContext
[ERROR] location: class com.mycompany.app.JavaKafkaWordCount
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[39,37] cannot find symbol
[ERROR] symbol: class JavaStreamingContext
[ERROR] location: class com.mycompany.app.JavaKafkaWordCount
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[39,73] cannot find symbol
[ERROR] symbol: class Duration
[ERROR] location: class com.mycompany.app.JavaKafkaWordCount
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[48,5] cannot find symbol
[ERROR] symbol: class JavaPairReceiverInputDStream
[ERROR] location: class com.mycompany.app.JavaKafkaWordCount
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[48,5] cannot find symbol
[ERROR] symbol: class JavaPairReceiverInputDStream
[ERROR] location: class com.mycompany.app.JavaKafkaWordCount
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[49,23] cannot access org.apache.spark.streaming.dstream.ReceiverInputDStream
[ERROR] class file for org.apache.spark.streaming.dstream.ReceiverInputDStream not found
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[51,5] cannot find symbol
[ERROR] symbol: class JavaDStream
[ERROR] location: class com.mycompany.app.JavaKafkaWordCount
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[58,5] cannot find symbol
[ERROR] symbol: class JavaDStream
[ERROR] location: class com.mycompany.app.JavaKafkaWordCount
[ERROR] /root/my-app/src/main/java/com/mycompany/app/JavaKafkaWordCount.java:[65,5] cannot find symbol
[ERROR] symbol: class JavaPairDStream
[ERROR] location: class com.mycompany.app.JavaKafkaWordCount
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
It seems that I have to modify my PATH variable but I am unable to locate the proper jar.
The error message you are getting is:
package org.apache.spark.streaming.api.java does not exist
This means you are missing the following dependency:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_2.10</artifactId>
<version>1.5.1</version>
</dependency>