Can anyone help me with this error ? I was using "mvn install" command in my warnings-plugin directory.
I got this error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 57:18.440s
[INFO] Finished at: Tue Oct 25 01:59:03 IST 2016
[INFO] Final Memory: 18M/73M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project warnings: Could not resolve dependencies for project org.jvnet.hudson.plugins:warnings:hpi:4.58-SNAPSHOT: The following artifacts could not be resolved: org.jenkins-ci.main:jenkins-war:war:1.625.1, org.jenkins-ci.main:jenkins-test-harness:jar:1.625.1: Could not transfer artifact org.jenkins-ci.main:jenkins-war:war:1.625.1 from/to repo.jenkins-ci.org (http://repo.jenkins-ci.org/public/): GET request of: org/jenkins-ci/main/jenkins-war/1.625.1/jenkins-war-1.625.1.war from repo.jenkins-ci.org failed: Read timed out -> [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
My pom.xml file looks like this
<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>
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-pom</artifactId>
<version>1.65</version>
<relativePath>../analysis-pom</relativePath>
</parent>
<artifactId>warnings</artifactId>
<packaging>hpi</packaging>
<name>Warnings Plug-in</name>
<version>4.58-SNAPSHOT</version>
<url>http://wiki.jenkins-ci.org/x/G4CGAQ</url>
<description>This plug-in reads the compiler warnings from the console log file and generates a trend report.</description>
<licenses>
<license>
<name>MIT license</name>
<comments>All source code is under the MIT license.</comments>
</license>
<license>
<name>LGPL</name>
<comments>All icons are made by Carlitus (Carles Carbonell Bernado) and are under the LGPL.</comments>
</license>
<license>
<name>BSD license</name>
<comments>All YUI source code is under the BSD license. Duke, the Java mascot also is under the BSD license.</comments>
</license>
<license>
<name>Scala License</name>
<url>http://www.scala-lang.org/license.html</url>
<comments>Scala icons are made by converting of http://www.scala-lang.org/resources/img/smooth-spiral.png</comments>
</license>
<license>
<name>Creative Commons Attribution 3.0</name>
<url>https://creativecommons.org/licenses/by/3.0</url>
<comments>Go mascot and logo were designed by Renée French and are covered by the Creative Commons Attribution 3.0 license.</comments>
</license>
</licenses>
<dependencies>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.77</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>violations</artifactId>
<version>0.7.11</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-digester3</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-test</artifactId>
<version>1.18</version>
<scope>test</scope>
</dependency>
</dependencies>
<scm>
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:git#github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<tag>HEAD</tag>
</scm>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
I'm on ubuntu 14.04. I installed maven using sudo apt-get install maven.
I'm writing a new parser following [https://wiki.jenkins-ci.org/display/JENKINS/Warnings+Plugin][1] .
[1]: https://wiki.jenkins-ci.org/display/JENKINS/Warnings+Plugin and just following the steps given there.
I have tried to browse the repo you use to download jenkins war :
http://repo.jenkins-ci.org/public/
The server has difficulties to respond. Try that :
http://repo.jenkins-ci.org/public/com/
So, yes, it is well a timeout problem.
Maybe temporary, maybe permanent... I don't know.
Anyway, you have three solutions :
try again later
configure another mvn repository in your pom.xml where the artifact exists
download the war from another website (ex: https://mvnrepository.com/artifact/org.jenkins-ci.main/jenkins-war/1.625.1)
and put it in your maven local repository.
Related
I followed a tutorial and get this dependency file in maven project in intelliJ IDEA 2018.3
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>kafka.sample.firstProject</groupId>
<artifactId>kafka-first-sample</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
<kafka.version>2.1.0</kafka.version>
</properties>
<build>
<plug
ins>
<!-- Maven Compiler Plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Apache Kafka Clients-->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.0.0</version>
</dependency>
<!-- Apache Kafka Streams-->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
<version>2.0.0</version>
</dependency>
<!-- Apache Log4J2 binding for SLF4J -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.11.0</version>
</dependency>
<!-- JUnit5 Jupiter -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<!-- JUnit 5 Jupiter Engine -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<!-- JUnit 5 Jupiter Parameterized Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
but whenever i try to run my build it throws this:
Error:(3, 41) java: package org.apache.kafka.clients.producer does not
exist and so on ...
Even after trying to run maven build still the problem persist.
Believe it or not i have get stuck in this problem from last many days.
Edit:
As #Parsecer asked to show maven build log, i found that there is an error as well
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building kafka-first-sample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.329 s
[INFO] Finished at: 2019-02-20T09:10:30+05:00
[INFO] Final Memory: 7M/34M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): No such host is known (repo.maven.apache.org) -> [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
Process finished with exit code 1
1) Check settings of IntelliJ by Ctrl-Alt-S. Type 'Maven' and see if you have proper Maven distribution (not the bundled one).
2) Refresh your Maven project from the right hand side of IntelliJ window.
This happens due to several issues which normally fixed after an IDE restart. Well you can try several things,
Do a maven reimport
Do a maven Download sources and documentation
And restart the JIdea IDE
You can try to use a latest maven version and see also.
My System was behind a Proxy which not allowing me to get these packages. I remove the proxy and now it is working fine.
So whatever I do I can't get my project to run on my mac. But the project seems to run fine on my colleagues pc's. Is there something i'm not seeing in my pom file? I keep getting this error,
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
(default-cli) on project got-team20: Command execution failed. Process
exited with an error: 1 (Exit value: 1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e
switch. Re-run Maven using the -X switch to enable full debug logging.
I have maven 3.5.0 installed on my mac, but i don't know if that can be a issue? I have also tried three different ide's, so the problem is not there.
My pom 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>io.gameoftrades</groupId>
<!-- Change Me -->
<artifactId>got-team20</artifactId> <!-- got-teamNN -->
<!-- -->
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Game of Trades Student Starter Kit</name>
<description>Student starter kit for Game of Trades</description>
<inceptionYear>2016</inceptionYear>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<name>42 BV</name>
<url>http://blog.42.nl/</url>
</organization>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<got.version>0.3.0</got.version>
<junit.version>4.11</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>io.gameoftrades</groupId>
<artifactId>gameoftrades-library</artifactId>
<version>${got.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
This is the full error i have when i run it with the -e switch.
[ERROR] Failed to execute goal
org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on
project got-team20: The parameters 'mainClass' for goal
org.codehaus.mojo:exec-maven-plugin:1.6.0:java are missing or invalid
-> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java
(default-cli) on project got-team23: The parameters 'mainClass' for
goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java are missing or
invalid...
So i guess something is wrong with the plugins i am using.
I want to use Apache Archiva like a company repo and mirror of the central maven repo(https://repo.maven.apache.org/maven2).
But archiva can't download jar from central repo, when I call archiva's server.
Somebody knowns how to fix it?
Result of compile my project is:
[INFO] Scanning for projects...
Downloading: http://localhost:8080/org/apache/maven/wagon/wagon-ssh/1.0-beta-7/wagon-ssh-1.0-beta-7.pom
[WARNING] The POM for org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-7 is missing, no dependency information available
Downloading: http://localhost:8080/org/apache/maven/wagon/wagon-ssh/1.0-beta-7/wagon-ssh-1.0-beta-7.jar
Downloading: http://localhost:8080/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR] The project MyProject:2.05:1.0 (d:\Work\test_maven\pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-ssh:1.0-beta-7 or one of its dependencies
could not be resolved: The following artifacts could not be resolved: org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-7,
org.codehaus.plexus:plexus-utils:jar:1.1: Could not find artifact org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-7
in internal (http://localhost:8080/) -> [Help2]
I use default archiva settings for repositories and proxyConnectors (have connector from internal to central repo. I don't use a proxy for Internet).
Central repo "remote check" is correct.
My maven settings.xml:
<mirror>
<id>internal</id>
<name>Archiva Internal Repository</name>
<url>http://localhost:8080/</url>
<mirrorOf>*</mirrorOf>
</mirror>
My pom.xml:
<project>
<modelVersion>4.0.0</modelVersion>
<name>Maven Default Project</name>
<groupId>MyProject</groupId>
<artifactId>2.05</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>own</groupId>
<artifactId>imapown</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-beta-7</version>
</extension>
</extensions>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
<sourceDirectory>src</sourceDirectory>
</build>
</project>
Version jdk: 1.6.0_45, maven: 3.2.5, archiva: 2.2.1
I'm trying to write a simple Jenkins plugin, which requires a proprietary external library myAwesomePackage.jar. Including external jars into a maven project was often discussed here on stackoverflow and the solution here https://stackoverflow.com/a/7623805 seems to be the tidy way solve this.
So I added my jar with
mvn install:install-file \
-Dfile=./lib/path_to_jar/lib/myAwesomePackage.jar \
-DlocalRepositoryPath=my_repo \
-DcreateChecksum=true \
-DgroupId=myAwesomePackage \
-DartifactId=myAwesomePackage \
-Dversion=1 \
-Dpackaging=jar \
-DgeneratePom=true
and modified my pom.xml that it looks like
<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>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.532.3</version>
</parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>myPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>hpi</packaging>
<licenses>
<license>
<name> ... license name ... /name>
<url> ... license url ... </url>
</license>
</licenses>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
<repository>
<id>my_repo</id>
<url>file://${project.basedir}/my_repo</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.xml.rpc</artifactId>
<version>3.0-Prelude-Embedded-m2</version>
</dependency>
<dependency>
<groupId>myAwesomePackage</groupId>
<artifactId>myAwesomePackage</artifactId>
<version>1</version>
</dependency>
</dependencies>
</project>
And I don't have a ~/m2/.settings file.
The error message, I get (after running mvn package) is the following:
.....
Downloaded: http://repo.jenkins-ci.org/public/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar (96 KB at 79.2 KB/sec)
Downloaded: http://repo.jenkins-ci.org/public/xalan/xalan/2.7.1/xalan-2.7.1.jar (3102 KB at 150.7 KB/sec)
Downloaded: http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/1.532.3/jenkins-war-1.532.3-war-for-test.jar (62097 KB at 467.9 KB/sec)
Downloading: file:///home/path_to/my_repo/myAwesomePackage/myAwesomePackage/1/myAwesomePackage-1.jar
Downloading: http://repo.maven.apache.org/maven2/myAwesomePackage/myAwesomePackage/1/myAwesomePackage-1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:17.009s
[INFO] Finished at: Fri Jul 11 01:40:32 EDT 2014
[INFO] Final Memory: 12M/86M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myPlugin: Could not resolve dependencies for project org.jenkins-ci.plugins:myPlugin:hpi:1.0-SNAPSHOT: Could not find artifact myAwesomePackage:myAwesomePackage:jar:1 in repo.jenkins-ci.org (http://repo.jenkins-ci.org/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
So my question is:
Which is the right way to include a proprietary jar into a jenkins plugin, which is build with maven?
Since you have manually specified repositories in your pom.xml it will look in those repositories for your myAwesomePackage:myAwesomePackage:jar:1 artifact which isn't resolvable from it
add the repository where this artifact is available in your pom.xml under <repositories>
The procedure as described in my question works!
The error occurred due to a typing error within the -Dfile=.... option, but maven doesn't give any error I thought that operation was successful.
As described in the comments of Jigar Joshi, a mvn clean install -X helps to debug such troubles.
I'm using Maven for the first time. I am trying to build "GeoTools" (http://www.geotools.org/) which has a seemingly well documented "Getting Started" page. I am using NetBeans 7.3.1. When I build my project, I get a "Build Failure" :
Failed to execute goal on project tutorial: Could not resolve dependencies for project org.geotools:tutorial:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.geotools:gt-shapefile:jar:10-SNAPSHOT, org.geotools:gt-swing:jar:10-SNAPSHOT: Failure to find org.geotools:gt-shapefile:jar:10-SNAPSHOT in http://download.java.net/maven/2 was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.dev.java.net has elapsed or updates are forced -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
I'm not really sure what that means. In my code I have several imports that are considered to not exist, though I followed the pom.xml instructions to the letter. For example:
import org.geotools.data.FileDataStore;
The above has a read underline with error saying:
package org.geotools.data does not exist
Here is my 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>
<groupId>org.geotools</groupId>
<artifactId>tutorial</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>tutorial</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<geotools.version>10-SNAPSHOT</geotools.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-shapefile</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>${geotools.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
</repositories>
Can anyone give me some advice to get this tool running? Am I making a fundamental Maven error or could it be tool-specific? The JARs show up under "Dependencies" so I don't understand why there's a problem.
Thanks in advance.
The real answer is that the GeoTools tutorial is pernicious. So if any future stragglers come here know this: on the NetBeans tutorial (and perhaps the Eclipse tutorial which I also failed to get to work) there are steps which define how to set up the pom.xml. Follow them. However, do NOT copy and paste their full pom.xml file, there's an error in it somewhere. I merely added the dependencies and repositories and built the project - successfully.
But wait there's more. After building the project I was unable to run the Quickstart.java example they provide. It crashed because
JMapFrame.showMap(map)
only accepts a "MapContext" type, which the documentation calls "deprecated". So, I imported
org.geotools.map.MapContext
and changed
MapContent map = new MapContent();
to
MapContext map = new MapContext();
Viola, beating the system. I wish developers would actually test their tutorials!