I've installed sonarqube on localhost (via docker) and try to scan my maven project with the command below :
mvn sonar:sonar -Dsonar.host.url=http://localhost:32768 -Dsonar.login=27948f763e39322e99a8508c38a28385c22b57f8 -e
But it failed after few seconds :
[INFO] Scanning for projects...
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] --- sonar-maven-plugin:3.4.0.905:sonar (default-cli) # demo ---
[INFO] User cache: /Users/johann/.sonar/cache
[INFO] SonarQube version: 7.1.0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.620 s
[INFO] Finished at: 2018-05-10T10:20:30+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project demo: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar: org/apache/commons/lang/StringUtils
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:3.4.0.905
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/johann/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.4.0.905/sonar-maven-plugin-3.4.0.905.jar
[ERROR] urls[1] = file:/Users/johann/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/Users/johann/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/Users/johann/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[4] = file:/Users/johann/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.10.0.1189/sonar-scanner-api-2.10.0.1189.jar
[ERROR] urls[5] = file:/Users/johann/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : org.apache.commons.lang.StringUtils
[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/PluginContainerException
My Java project is working well and sonarqube seems also to be ok.
I will appreciate your help...
Thanks
--
edit
As requested, here is my pom.xml :
<?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.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I tried to add the profile object as suggested by A J, bu tag is Unrecognised.
And y the way, I'm using intelliJ as IDE.
Thanks
Add dependency for "lifecycle-mapping:jar:1.0.0" in pom.xml
the error states that ":lifecycle-mapping:jar:1.0.0 is missing, no dependency information available"
Related
when i am trying to create Spring Boot Project using New Version which is "v 2.1.7"
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
this time its through Following error:
Description Resource Path Location
Type
Unknown pom.xml /demo-1 line 1 Maven Configuration Problem
If i am going to replace This new Version to my previous old version in porm.xml file with name space its Working good without any error,
and if i deleted .m2 folder and reinstall eclipse then its support to new version but i want to use existing eclipse with New version of Spring Boot, what can i do for it.
it is possible to update existing .m2 folder ?
pom.xml
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo-1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo-1</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
when i am trying to install maven this time following error show
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< com.example:demo-1 >-------------------------
[INFO] Building demo-1 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # demo-1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # demo-1 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\Enternship\SPRING BOOT\demo-1\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.933 s
[INFO] Finished at: 2019-09-02T18:45:56+05:30
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "pom.xml" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project demo-1: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[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
just configure the JDK path the steps are
right-click on the project
click on properties
type java build path and go to java build path
click on libraries
click on JRE system libraries
edit that
click on alternate JRE
click on Installed JREs
click on Add
select standard VM
click Next
place your JDK path and select that
By this, you will not see the error
=>No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
I have project in java that is contain two module.
First module is spring boot and my controller in this module and i call it Host Api.
Second module is maven module and call it command layer and all common model in this module.
My problem is here when is want to reference between two module (it mean my controller use common model) my project run fine but when i clean compile install whit maven give me an error
This error show when c:\userd\.m2\repository\project name is empty
"C:\Program Files\Java\jdk-12\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\Users\m.familsahraei\Desktop\Test\Api "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\lib\idea_rt.jar=2356:C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version2019.1 clean compile install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 0.0.1
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/command/commandartifact/0.0.1/commandartifact-0.0.1.pom
[WARNING] The POM for command:commandartifact:jar:0.0.1 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/command/commandartifact/0.0.1/commandartifact-0.0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.364 s
[INFO] Finished at: 2019-06-26T09:41:00+04:30
[INFO] Final Memory: 18M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project api:test:jar:0.0.1: Could not find artifact command:commandartifact:jar:0.0.1 in central (https://repo.maven.apache.org/maven2) -> [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/DependencyResolutionException
Process finished with exit code 1
And when i clean compile install again give me differ error
"C:\Program Files\Java\jdk-12\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:2349,suspend=y,server=n -Dmaven.multiModuleProjectDirectory=C:\Users\m.familsahraei\Desktop\Test\Api "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\plugins\maven\lib\maven3\bin\m2.conf" -javaagent:C:\Users\m.familsahraei\.IntelliJIdea2019.1\system\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\lib\idea_rt.jar" org.codehaus.classworlds.Launcher -Didea.version2019.1 clean compile install
Connected to the target VM, address: '127.0.0.1:2349', transport: 'socket'
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 0.0.1
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for command:commandartifact:jar:0.0.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.374 s
[INFO] Finished at: 2019-06-26T09:39:16+04:30
[INFO] Final Memory: 16M/57M
[INFO] ------------------------------------------------------------------------
Disconnected from the target VM, address: '127.0.0.1:2349', transport: 'socket'
[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project api:test:jar:0.0.1: Failure to find command:commandartifact:jar:0.0.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [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/DependencyResolutionException
Process finished with exit code 1
This is my Host Api pom file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>api</groupId>
<artifactId>test</artifactId>
<version>0.0.1</version>
<name>test</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>12</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>5.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>command</groupId>
<artifactId>commandartifact</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
And my Command pom file
<?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>command</groupId>
<artifactId>commandartifact</artifactId>
<version>0.0.1</version>
</project>
You have execute mvn install also for the commandartifact project to install it into the local maven repository.
This question already has answers here:
Problems using Maven and SSL behind proxy
(25 answers)
Closed 4 years ago.
i was searching for an hour to find a solution to my problem and i i'm using maven to pom.xml to find the library of this import org.springframework.jdbc.core.JdbcTemplate
my pom.xml
<?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>org.sample</groupId>
<artifactId>test1</artifactId>
<name> Spring boots test</name>
<version>0.0.2-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.2.1.RELEASE</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
</properties>
</project>
the result was :-
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< org.sample:test1 >--------------------------
[INFO] Building Spring boots test 0.0.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/spring-jdbc/3.2.1.RELEASE/spring-jdbc-3.2.1.RELEASE.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.626 s
[INFO] Finished at: 2018-10-21T08:41:16+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project test1: Could not resolve dependencies for project org.sample:test1:jar:0.0.2-SNAPSHOT: Failed to collect dependencies at org.springframework:spring-jdbc:jar:3.2.1.RELEASE: Failed to read artifact descriptor for org.springframework:spring-jdbc:jar:3.2.1.RELEASE: Could not transfer artifact org.springframework:spring-jdbc:pom:3.2.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [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/DependencyResolutionException
Mate, There are multiple things that you can do.
Check the maven repository for the jar of spring-boot-starter under org > springframework > boot
Sometimes the download might be interrupted or may be due to failure it would not have downloaded correctly, in that case delete the spring-boot-starter under org > springframework > boot and build again
You can clean and verify the maven project again (I would suggest to do this from the console, to do this go to the folder where your pom.xml exist and execute mvn clean verify)
This question already has answers here:
How to add a dependency to a Spring Boot Jar in another project?
(12 answers)
Closed 5 years ago.
i am unable to build my springboot project,
I am using classes from another springboot jar, which i placed on the build path, its running in local via eclipse, but is not building, here's the error
"[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ContentManagementService 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # contentmanagementapi ---
[INFO] Deleting /home/bhargavgundu/git/contentmanagementservice/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # contentmanagementapi ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # contentmanagementapi ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 42 source files to /home/bhargavgundu/git/contentmanagementservice/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[32,31] package com.conduiraonline.apis does not exist
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[42,31] package com.conduiraonline.daos does not exist
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[52,35] cannot find symbol
symbol: class SlackService
location: package com.conduiraonline.services
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[85,17] cannot find symbol
symbol: class UserDAO
location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[87,17] cannot find symbol
symbol: class SlackService
location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[95,17] cannot find symbol
symbol: class LicenseV5
location: class com.conduiraonline.controller.ContentManagementControllerV1
[INFO] 6 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.917s
[INFO] Finished at: Tue Sep 12 17:16:44 IST 2017
[INFO] Final Memory: 24M/396M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project contentmanagementapi: Compilation failure: Compilation failure:
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[32,31] package com.conduiraonline.apis does not exist
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[42,31] package com.conduiraonline.daos does not exist
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[52,35] cannot find symbol
[ERROR] symbol: class SlackService
[ERROR] location: package com.conduiraonline.services
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[85,17] cannot find symbol
[ERROR] symbol: class UserDAO
[ERROR] location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[87,17] cannot find symbol
[ERROR] symbol: class SlackService
[ERROR] location: class com.conduiraonline.controller.ContentManagementControllerV1
[ERROR] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/ContentManagementControllerV1.java:[95,17] cannot find symbol
[ERROR] symbol: class LicenseV5
[ERROR] location: class com.conduiraonline.controller.ContentManagementControllerV1
[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 is showing errors wherever i am using classes/functions from the external jar, can someone help?
MY POM-
here is my POM
<?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.conduiraonline</groupId>
<artifactId>contentmanagementapi</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>ContentManagementService</name>
<description>ContentManagementService</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.mail/mail -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.conduiraonline</groupId>
<artifactId>licenseapi</artifactId>
<version>0.0.1</version>
<classifier>exec</classifier>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
</project>
TL;DR
Remove <classifier>exec</classifier> from the dependency on com.conduiraonline:licenseapi
More Details ...
You are correct in using <dependency> to express the relationship between com.conduiraonline:contentmanagementapi and com.conduiraonline:licenseapi. Or to put it another way; this is the right way to tell Maven that the module com.conduiraonline:contentmanagementapi depends on the module com.conduiraonline:licenseapi.
However, you have defined the dependency on com.conduiraonline:licenseapi as:
<dependency>
<groupId>com.conduiraonline</groupId>
<artifactId>licenseapi</artifactId>
<version>0.0.1</version>
<classifier>exec</classifier>
</dependency>
The classifier tells Maven to look for an file named licenseapi.exec in the folder com/conduiraonline in your local Maven repo (and failing that, try to resolve that dependency from whatever remote repositories you have configured in your Maven settings.xml or in this pom.xml).
I presume there is no file named licenseapi.exec in the folder com/conduiraonline in your local Maven repo because exec is a very unusual classifier for a Maven artifact.
As long as a JAR for com.conduiraonline:licenseapi with version 0.0.1 has been installed in your local Maven repo this dependency will work:
<dependency>
<groupId>com.conduiraonline</groupId>
<artifactId>licenseapi</artifactId>
<version>0.0.1</version>
</dependency>
You install a JAR for com.conduiraonline:licenseapi with version 0.0.1 in your local Maven repo by running mvn clean install for the licenseapi module (assuming that the pom.xml for the licenseapi modules has <version>0.0.1</version>).
You must add the path of your jars / folder containing jars in your gradle or maven build file.
For example in gradle add
compile fileTree(dir: 'path_to_ext_libs', include: '*.jar')
to your dependencies in the build.gradle then all the jars in the libs folder will be then included.
or in maven
<repositories>
<repository>
<id>local-files</id>
<name>local-files</name>
<url>file://c:\test\filerepo</url>
</repository>
I am trying to download OpenAM through Maven dependencies as stated on this website:
https://wikis.forgerock.org/confluence/display/openam/Using+Maven+and+OpenAM
Below is Maven pom.xml file:
<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.example</groupId>
<artifactId>OpenAMExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>OpenAMExample</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<openam.version>10.1.0-Xpress</openam.version>
</properties>
<dependencies>
<dependency>
<groupId>org.forgerock.openam</groupId>
<artifactId>openam-core</artifactId>
<version>${openam.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.forgerock.openam</groupId>
<artifactId>openam-shared</artifactId>
<version>${openam.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.forgerock.openam</groupId>
<artifactId>openam-federation-library</artifactId>
<version>${openam.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.forgerock.openam</groupId>
<artifactId>openam-clientsdk</artifactId>
<version>${openam.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>forgerock</id>
<url>http://maven.forgerock.org/repo/releases</url>
</repository>
</repositories>
</project>
I cannot download this, there seems to be problems. It mentions missing artifact for each artifact within OpenAM.
Having researched on Google no one seems to have any problems.
Any ideas why?
EDIT
BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.305s
[INFO] Finished at: Mon Aug 05 16:01:44 BST 2013
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project OpenAMExample: Could not resolve dependencies for project com.webchannel.example:OpenAMExample:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.forgerock.openam:openam-core:jar:10.1.0-Xpress, org.forgerock.openam:openam-shared:jar:10.1.0-Xpress, org.forgerock.openam:openam-federation-library:jar:10.1.0-Xpress, org.forgerock.openam:openam-clientsdk:jar:10.1.0-Xpress: Failure to find org.forgerock.openam:openam-core:jar:10.1.0-Xpress in http://nexus.example.private:8081/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [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/DependencyResolutionException
EDIT 2:
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenAMExample 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.sun.web.ui:cc_zh_HK:jar:2008-08-08 is missing, no dependency information available
Downloading: http://nexus.example.private:8081/content/groups/public/com/sun/web/ui/cc_zh_TW/2008-08-08/cc_zh_TW-2008-08-08.pom
[WARNING] The POM for com.sun.web.ui:cc_zh_TW:jar:2008-08-08 is missing, no dependency information available
Downloading: http://nexus.example.private:8081/content/groups/public/external/esapiport/2009-26-07/esapiport-2009-26-07.pom
[WARNING] The POM for external:esapiport:jar:2009-26-07 is missing, no dependency information available
Downloading: http://nexus.example.private:8081/content/groups/public/external/sleepycat-je/2011-04-07/sleepycat-je-2011-04-07.pom
[WARNING] The POM for external:webservices-rt:jar:2009-29-07 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.038s
[INFO] Finished at: Mon Aug 05 16:31:52 BST 2013
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project OpenAMExample: Could not resolve dependencies for project com.webchannel.example:OpenAMExample:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [org.forgerock.openam:openam-core:jar:10.1.0-Xpress (compile), org.forgerock.openam:openam-shared:jar:10.1.0-Xpress (compile), org.forgerock.openam:openam-federation-library:jar:10.1.0-Xpress (compile), org.forgerock.openam:openam-clientsdk:jar:10.1.0-Xpress (compile), junit:junit:jar:3.8.1 (test)]: Failed to read artifact descriptor for org.forgerock.opendj:opendj-server:jar:2.4.6: Could not find artifact org.forgerock.opendj:opendj-project:pom:3.0.0-SNAPSHOT in nexus (http://nexus.example.private:8081/content/groups/public) -> [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/DependencyResolutionException
it says was cached in the local repository
Go to $HOME/.m2/repository/org/ and remove forgerock directory and try again
you might had a connection error or something like that
another way is to try right click > maven > maven update if you use m2e and check force updating release
the dependency
of OpenSSOclientsdk, at the moment, is not found in any maven repository. Therefore,
you must include in your local repository:
{dir maven repo}/com/sun/identity/OpenSSOclientsdk/8.0/OpenSSOclientsdk-8.0.jar.
Then, you can execute
$ mvn install
And the provider will be located in
{dir maven repo}/com/sun/identity/provider/springsecurity/0.1/springsecurity-0.1.jar
to be used in maven projects. (See more details in http://maven.apache.org)