I have installed spark 1.3.1 on local by downloading the zip and extracting it into my home repository so that I have it in here home/my-user-name/spark-1.3.1 .
The next thing is that I want to work using Java, and in order to it to work I have installed maven via this command :
$ sudo apt-get install maven
Then I checked the version with this command:
mvn -version
Which gave me this:
Maven home: /usr/share/maven
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-38-generic", arch: "amd64", family: "unix"
Then the next thing is I wanted to create a java project using Maven from current depository Documents/ :
mvn archetype:generate -DgroupId=projet -DartifactId=Indexing -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
Which means that my pom.xml file is in repository Documents/projet/Indexing/
Here's is what I got in pom.xml :
<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>mif37.projet</groupId>
<artifactId>Indexing</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>IndexingMapReduce</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
After that I included in the tag dependencies one more dependency to spark so I god this pom.xml:
<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>mif37.projet</groupId>
<artifactId>Indexing</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>IndexingMapReduce</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
And then I run the command-line from the repository where is pom.xml:
mvn package
But in the end here's what I got:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9:18.021s
[INFO] Finished at: Sun May 31 20:49:52 CEST 2015
[INFO] Final Memory: 12M/137M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Indexing: Could not resolve dependencies for project projet:Indexing:jar:1.0-SNAPSHOT: Could not transfer artifact org.apache.spark:spark-core_2.10:jar:1.3.1 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/apache/spark/spark-core_2.10/1.3.1/spark-core_2.10-1.3.1.jar from central failed: Connection reset -> [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
Anyone could point on where I do things wrong??
Thanks.
Your pom.xml and process is fine. There is a firewall / connectivity issue - as noted by:
.spark:spark-core_2.10:jar:1.3.1 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/apache/spark/spark-core_2.10/1.3.1/spark-core_2.10-1.3.1.jar from central failed: Connection reset -> [Help 1]
[ERROR]
You can verify for yourself by repeating your steps in an 'open' environment - e.g. at your home instead of work.
Related
Java Spring project fails to package the project with maven, printing the following error:
Could not transfer artifact org.apache.maven.surefire:surefire-junit-platform:pom:2.22.2 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit-platform/2.22.2/surefire-junit-platform-2.22.2.pom
The use used 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 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.6.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>***</groupId>
<artifactId>***</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>***</name>
<description>***</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</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>
I use IntelliJ to develop and build the project.
I do not need a proxy to enter the internet. If I click the link, I can see the pom file without problems. Reloading the project does not work, downloading all sources neither.
In the local storage, I find the following files:
C:\Users\***\.m2\repository\org\apache\maven\plugins\maven-surefire-plugin\2.22.2
_remote.repositories
maven-surefire-plugin-2.22.2.jar
maven-surefire-plugin-2.22.2.jar.sha1
maven-surefire-plugin-2.22.2.pom
maven-surefire-plugin-2.22.2.pom.sha1
Removing them and reloading the project restores the files, the error persists.
I cleaned the project and used the -Dhttps.protocols=TLSv1.2 parameter no changes.
Edit:
Using a VPN doe not work.
Output of mvn -v:
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: C:\Program Files\java\apache-maven-3.8.4
Java version: 1.8.0_312, vendor: Temurin, runtime: C:\Program Files\Eclipse Adoptium\jdk-8.0.312.7-hotspot\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
When building with mvn clean package -U:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project Grafnus-Server: Unable to generate classpath: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information for org.apache.maven.surefire:surefire-junit-platform:jar:2.22.2: Failed to retrieve POM for org.apache.maven.surefire:surefire-junit-platform:jar:2.22.2: Could not transfer artifact org.apache.maven.surefire:surefire-junit-platform:pom:2.22.2 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit-platform/2.22.2/surefire-junit-platform-2.22.2.pom
[ERROR] from the specified remote repositories:
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR] Path to dependency:
[ERROR] 1) dummy:dummy:jar:1.0
The issue was the outdated java version. I updated to a newer one and at first I did not change it in the project settings (thought that would change on his own). Now it works like a charm. Thanks to #khmarbaise
im trying to deploy my back end application to heroku
bun when I run this command
git push --force heroku-be-app splitting-staging-be:master
im getting this error
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9.jar (317 kB at 7.6 MB/s)
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 24 source files to /tmp/build_4e875976/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.593 s
[INFO] Finished at: 2020-12-21T15:28:14Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project backend: Fatal error compiling: invalid target release: 11 -> [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
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
This is my 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 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.4.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>vs</groupId>
<artifactId>backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>backend</name>
<description>Main server voor van streek project</description>
<properties>
<java.version>15</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<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>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.4.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>5.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>15</source> <!-- maven.compiler.source -->
<target>15</target> <!-- maven.compiler.target -->
</configuration>
</plugin>
</plugins>
</build>
</project>
I solved this problem by adding a new file system.properties and the content added to the file is java.runtime.version=11 (For me I am using JDK 11).
java.runtime.version=11
I would try focusing on why maven complains about invalid release 11 (Fatal error compiling: invalid target release: 11).
As seen in your pom.xml config you clearly intend to use version 15, so I would suggest to investigate why there is a problem with version 11.
Check $JAVA_HOME environment variable, system.properties file, etc.
Also try debug route suggested in official docs or a Q&A on a similar topic.
You must use the specific version of Java supported by Heroku. The following versions supported are:
Java 7 - 1.7.0_292
Java 8 - 1.8.0_282
Java 11 - 11.0.10
Java 13 - 13.0.6
Java 15 - 15.0.2
Set a java.runtime.version property of the system.properties file, create a system.properties file if one does not already exist.
java.runtime.version = SUPPORTED_VERSION
Read more in heroku-java-support
This is what I have experienced today.
I have been using jdk 1.8, and then have to install jdk 1.11.
But, after running mvnw through my shell script file dep.sh, it failed to build jar.
#!/bin/bash
MVN=$(pwd)/mvnw
echo "[1/2] Building app.jar ..."
$MVN clean package -Dmaven.test.skip=true
dep.sh calls mvnw script file with goal clan package
Error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile
(default-compile) on project dictation:
Fatal error compiling: invalid target release: 11 -> [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
My pom.xml is configured with jdk 1.11. But it does not solve the build error.
<project ...>
<properties>
<java.version>11</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source><!-- 1.11 not working -->
<target>11</target><!-- 1.11 not working -->
</configuration>
</plugin>
</plugins>
</build>
</project>
build failure
When I installed jdk 1.8, JAVA_HOME was set to /my/jdk/1.8/dir, which is used for bundling jar.
I set JAVA_HOME to /my/jdk/1.111/dir in dep.sh, it works without error.
#!/bin/bash
JAVA_HOME="/C/Program Files/Java/jdk-11.0.9"
MVN=$(pwd)/mvnw
echo "[1/2] Building app.jar ..."
$MVN clean package -Dmaven.test.skip=true
create system.properties file and Add java.runtime.version=11
I'm having difficulty building a spring boot application from within a Dockerfile on Linux.
It works just fine on Windows.
I've seen other posts where folks say I should specify or remove the relativePath in the pom.xml file, but I don't think that's the issue nor did it work.
Here's my error, followed by my code:
> Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.1.RELEASE/spring-boot-starter-parent-2.1.1.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.ciee:stanfordcorenlp-server:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.1.RELEASE/spring-boot-starter-parent-2.1.1.RELEASE.pom and 'parent.relativePath' points at no local POM # line 6, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.ciee:stanfordcorenlp-server:0.0.1-SNAPSHOT (/home/app/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.ciee:stanfordcorenlp-server:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.1.RELEASE/spring-boot-starter-parent-2.1.1.RELEASE.pom and 'parent.relativePath' points at no local POM # line 6, column 13: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.232.196.215, repo.maven.apache.org/199.232.192.215] failed: Connection timed out (Connection timed out) -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
ERROR: Service 'web' failed to build: The command '/bin/sh -c /home/app/with-proxy.sh mvn -f /home/app/pom.xml clean test package' returned a non-zero code: 1
pom.xml
<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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.ciee</groupId>
<artifactId>stanfordcorenlp-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>stanfordcorenlp-server</name>
<description>Stanford Core NLP Server</description>
<properties>
<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-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>4.0.0</version>
<classifier>models</classifier>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>4.0.0</version>
<classifier>models-english</classifier>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
docker-compose.yml
version: "3"
services:
web:
build:
context: ..
dockerfile: ./docker/Dockerfile.cambridge
image: stanfordcorenlp # (override the name Compose picks)
container_name: stanfordcorenlp
ports:
- "9000:9000"
networks:
- cieenetwork
networks:
cieenetwork:
external: true
Dockerfile:
# build stage
FROM maven:3.6.3-jdk-8 AS build
MAINTAINER Philips CIEE Team
ENV TZ=US/Central
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezon
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
COPY ./stanfordcorenlp-server/src /home/app/src
COPY ./stanfordcorenlp-server/pom.xml /home/app
RUN chmod -R 775 /home/app
RUN mvn -f /home/app/pom.xml clean test package
# Package stage
FROM openjdk:8-jdk-alpine
ENV TZ=US/Central
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezon
# set environment variable to log messages immediately
ENV PYTHONUNBUFFERED 1
# set environment variable to prevent Python from writing pyc files to disc (equivalent to python -B option)
ENV PYTHONDONTWRITEBYTECODE 1
COPY --from=build /home/app/target/*.jar app.jar
ENV PORT 9000
EXPOSE 9000
ENTRYPOINT ["java","-jar","app.jar"]
I had to set up maven proxy settings.
Maven proxy config
I am currently doing a software engineering module where we learn about CI and TDD. As an assignment we must create a Java project using maven, JUnit, and Shippable. My files include three java classes (Student, Course, and Module classes) and a simple test for each that tests getters and setters.
I am using:
Apache NetBeans 12.0
Maven (default is 3.6.3 but I added a plugin for 3.8)
Openjdk11
My 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>com.nuig</groupId>
<artifactId>assignment1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<name>assignment1</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release> <!--or <release>10</release>-->
</configuration>
</plugin>
</plugins>
</build>
</project>
And shippable.yml file:
language: java
jdk:
- openjdk11
after_success:
- mvn clean verify
- mvn clean cobertura:cobertura
- mvn test
When I build the code in netbeans, it builds and passes the tests fine. But once I push and go to shippable console, it keeps failing at mvn clean cobertura:cobertura with the following error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.165 s
[INFO] Finished at: 2020-10-11T00:26:35Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (default-cli) on project assignment1: Execution default-cli of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument failed: Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified path /usr/lib/jvm/java-11-openjdk-amd64/../lib/tools.jar -> [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/PluginResolutionException
I am really unfamiliar with all these technologies and I have already tried several suggestions from answers to similar questions but to no vail.
Would anyone be able to help with this issue? Much appreciated.
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.