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>
Related
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.
I am trying to run command "mvn test" from Command Line, build is getting failed and getting below error, but when I ran the same command from Eclipse, it is working fine. I have tried all the suggestions provided in stackoverflow but still its not running. Please let me know what i am missing here
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project D2CAutomation: There are test failures.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] Exception in provider
[ERROR] org.apache.maven.surefire.booter.SurefireExecutionException: Exception in provider
[ERROR] at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:91)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1295)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR] Caused by: org.testng.TestNGException:
[ERROR] TestNG by default disables loading DTD from unsecured Urls. If you need to explicitly load the DTD from a http url, please do so by using the JVM argument [-Dtestng.dtd.http=true]
[ERROR] at org.testng.xml.TestNGContentHandler.resolveEntity(TestNGContentHandler.java:115)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:111)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:1025)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1142)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1040)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:943)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
[ERROR] at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:324)
[ERROR] at java.xml/javax.xml.parsers.SAXParser.parse(SAXParser.java:197)
[ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:39)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
[ERROR] at org.testng.xml.Parser.parse(Parser.java:162)
[ERROR] at org.testng.xml.Parser.parse(Parser.java:248)
[ERROR] at org.testng.TestNG.parseSuite(TestNG.java:322)
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:374)
[ERROR] at org.testng.TestNG.initializeEverything(TestNG.java:1017)
[ERROR] at org.testng.TestNG.run(TestNG.java:1029)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:284)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:119)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:167)
[ERROR] at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:161)
[ERROR] at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:84)
[ERROR] at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:87)
[ERROR] ... 25 more
[ERROR]
[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/MojoExecutionException
Below is the POM xml:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>3.5.1</compilerVersion>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<forkMode>none</forkMode>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
This is your problem
<forkMode>none</forkMode>
Remove it!
It is used in many tutorial but it is wrong to hide and bypass some problems using forkMode=never or forkCount=0. If the Java developers have some problems with Surefire or the Failsafe plugin, report a bug in Apache JIRA or talk with the opensource developers.
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).
From eclipse I am trying to perform a maven install but I gets some errors:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building analyzer 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # distributed.analyzer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # distributed.analyzer ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 14 source files to D:\eclipse-workspace\DistributedAnalyzer\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[8,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[22,30] cannot find symbol
symbol: class Logger
location: class com.distributed.analyzer.Analizador
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[7,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[8,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[31,30] cannot find symbol
symbol: class Logger
location: class com.distributed.analyzer.Ordenante
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[8,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[22,30] cannot find symbol
symbol: class Logger
location: class com.distributed.analyzer.Manager
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[6,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[7,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[22,30] cannot find symbol
symbol: class Logger
location: class com.distributed.analyzer.Main
[INFO] 12 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.481 s
[INFO] Finished at: 2016-02-12T20:04:47+01:00
[INFO] Final Memory: 16M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project distributed.analyzer: Compilation failure: Compilation failure:
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[8,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[22,30] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.distributed.analyzer.Analizador
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[7,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[8,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[31,30] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.distributed.analyzer.Ordenante
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[8,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[22,30] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.distributed.analyzer.Manager
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[6,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[7,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[22,30] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.distributed.analyzer.Main
[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
log4j2 jars are added as maven dependencies in my pom.xml:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.5</version>
</dependency>
Also they are present in java build path in eclipse in the libraries tab.
I have added these two libraries in run/debug setting in eclipse, in the classpath tab.
Maven dependency tree:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
<version>4.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jms</artifactId>
<version>4.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>1.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
What am I doing wrong?