I was needed for javax.xml package for my new project. I did search in mvnrepository.com and found one :
<!-- https://mvnrepository.com/artifact/javax.xml/jaxrpc-api -->
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>2.0_EA1</version>
</dependency>
I suppose, first comment line is package repository. Please, correct me if I'm wrong. I added following sections in my pom.xml:
<repositories>
<repository>
<id>repo1</id>
<name>Repo 1</name>
<url>https://mvnrepository.com/artifact/javax.xml/jaxrpc-api</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>2.0_EA1</version>
</dependency>
</dependencies>
But looks I got wrong maven address.
mvn compile brought error:
[ERROR] Failed to execute goal on project test-xpath: Could not resolve dependencies for project com.kkk:test-xpath:jar:0.0.1-SNAPSHOT: Failure to find javax.xml:jaxrpc-api:jar:2.0_EA1 in https://mvnrepository.com/artifact/javax.xml/jaxrpc-api was cached in the local repository, resolution will not be reattempted until the update interval of repo1 has elapsed or updates are forced -> [Help 1]
What I did wrong and how to fix that?
UPD
After removing repository I got error:
Failed to execute goal on project test-xpath: Could not resolve dependencies for project com.kkk:test-xpath:jar:0.0.1-SNAPSHOT: Failure to find javax.xml:jaxrpc-api:jar:2.0_EA1 in https://mvnrepository.com/artifact/javax.xml/jaxrpc-api was cached in the local repository, resolution will not be reattempted until the update interval of repo1 has elapsed or updates are forced -> [Help 1]
UPD2
I have learned that I should add spring repository to my dependencies:
<repositories>
<repository>
<id>repo1</id>
<name>Repo 1</name>
<url>http://repo.spring.io/plugins-release/</url>
</repository>
</repositories>
I have deleted .m2\repository\javax and did maven clean
maven compile produced error:
Downloading from repo1: http://repo.spring.io/plugins-release/javax/xml/jaxrpc-api/2.0_EA1/jaxrpc-api-2.0_EA1.pom
Downloaded from repo1: http://repo.spring.io/plugins-release/javax/xml/jaxrpc-api/2.0_EA1/jaxrpc-api-2.0_EA1.pom (395 B at 736 B/s)
Downloading from repo1: http://repo.spring.io/plugins-release/javax/xml/jaxrpc-api/2.0_EA1/jaxrpc-api-2.0_EA1.jar
Downloading from central: https://repo.maven.apache.org/maven2/javax/xml/jaxrpc-api/2.0_EA1/jaxrpc-api-2.0_EA1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.767 s
[INFO] Finished at: 2018-11-07T14:17:38+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project test-xpath: Could not resolve dependencies for project com.kkk:test-xpath:jar:0.0.1-SNAPSHOT: Could not find artifact javax.xml:jaxrpc-api:jar:2.0_EA1 in repo1 (http://repo.spring.io/plugins-release/), try downloading from https://jax-rpc.dev.java.net/jaxrpc20-ea/ -> [Help 1]
In case I do the same action without <repository> in my pom.xml and do maven compile I have the same error, but it tries to download pom from maven.repo.
Downloading from central: https://repo.maven.apache.org/maven2/javax/xml/jaxrpc-api/2.0_EA1/jaxrpc-api-2.0_EA1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/javax/xml/jaxrpc-api/2.0_EA1/jaxrpc-api-2.0_EA1.pom (395 B at 987 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/javax/xml/jaxrpc-api/2.0_EA1/jaxrpc-api-2.0_EA1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.180 s
[INFO] Finished at: 2018-11-07T14:31:44+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project test-xpath: Could not resolve dependencies for project com.kpv:test-xpath:jar:0.0.1-SNAPSHOT: Could not find artifact javax.xml:jaxrpc-api:jar:2.0_EA1 in central (https://repo.maven.apache.org/maven2), try downloading from https://jax-rpc.dev.java.net/jaxrpc20-ea/ -> [Help 1]
That is not the proper use of repository tag. If you go to https://mvnrepository.com main page you'll see that it makes indices from multiple repositories, such as central, jcenter, etc. So you have to use standard repositories.
if we open maven repository page, we can see two tabs: Central and Spring Plugins. Open Spring plugins tab, and try to use it, because that version is fresh, and dated April of 2018.
<!-- https://mvnrepository.com/artifact/javax.xml/jaxrpc-api -->
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>2.0_ea1</version>
</dependency>
Also, run mvn clean command, and to be sure, delete javax folder in .m2 location.
2.0_EA1 doesn't exists on Maven central. if you use 1.1 you will see that it works. The non normalized semver version seem to relate to a non official version, maybe an alpha version.
The search on search.maven.org claims it exists, but the jar itself doesn't exists
To check with a working version:
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
Also note: The error maven displays tell you that you can download the jar manually from an url, it's not a repository.
To answer only the title of the question you can add a repository to your pom.xml, but the central maven repository dosen't need to be added, so I give you an example for another repository:
<repositories>
<repository>
<id>jitpack</id>
<name>jitpack</name>
<url>https://jitpack.io</url>
</repository>
</repositories>
Related
I'm totally new to Maven. I am building an Apache projects using Maven command: mvn clean package.
It showed build failure and give the following error message:
[ERROR] Failed to execute goal on project taverna-perspective-myexperiment: Could not
resolve dependencies for project org.apache.taverna.workbench:taverna-perspective-
myexperiment:bundle:3.1.0-incubating-SNAPSHOT: Could not find artifact
org.jdom:com.springsource.org.jdom:jar:1.1.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
It seems it needs a dependency org.jdom:com.springsource.org.jdom:jar:1.1.0 but it cannot find it. I searched this artifact in the internet and found a page giving the following maven configurations:
<dependency>
<groupId>org.jdom</groupId>
<artifactId>com.springsource.org.jdom</artifactId>
<version>1.1.0</version>
<scope>provided</scope>
</dependency>
I checked the pom.xml and found the dependency for org.jdom is identical with the above. What should I do to fix it? Does it mean this artifact has been removed from the central? Is there any other sources we can set for it?
in page write note:
Note: this artifact is located at Spring Plugins repository (https://repo.spring.io/plugins-release/)
then you must add https://repo.spring.io/plugins-release/ to repositories in pom.xml file:
<repositories>
<repository>
<id>spring</id>
<name>Spring Repository</name>
<url>https://repo.spring.io/plugins-release/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>com.springsource.org.jdom</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
I'm writing a standalone client for an ejb application deployed to jboss wildfly 9.0.1.Final. The documentation I've reviewed suggests there is a readme file (readme-ejb-jms.txt) in the wildfly directory. This file contained the following suggestion for the maven dependencies:
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ejb-client-bom</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-jms-client-bom</artifactId>
<type>pom</type>
</dependency>
</dependencies>
If I use this I get an error saying version is required so I modified the dependencies to look like this:
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ejb-client-bom</artifactId>
<version>9.0.1.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-jms-client-bom</artifactId>
<version>9.0.1.Final</version>
<type>pom</type>
</dependency>
When I run mvn clean install with the above I get this error:
The following artifacts could not be resolved:
org.jboss.as:jboss-as-ejb-client-bom:pom:9.0.1.Final,
org.jboss.as:jboss-as-jms-client-bom:pom:9.0.1.Final:
Failure to find org.jboss.as:jboss-as-ejb-client-bom:pom:9.0.1.Final
The full output from mvn clean install is shown below:
C:\_WORKSPACE\workspace\_myapp\myappjbosswildflyclient>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myappjbosswildflyclient 4.3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.jboss.as:jboss-as-ejb-client-bom:pom:9.0.1.Final is missing, no dependency information available
[WARNING] The POM for org.jboss.as:jboss-as-jms-client-bom:pom:9.0.1.Final is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.957s
[INFO] Finished at: Tue Aug 04 17:17:04 EDT 2015
[INFO] Final Memory: 5M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myappjbosswildflyclient: Could not resolve dependencies for project mycompany-myapp:myappjbosswildflyclient:jar:4.3.0-SNAPSHOT: The following artifacts could not be resolved: org.jboss.as:jboss-as-ejb-client-bom:pom:9.0.1.Final, org.jboss.as:jboss-as-jms-client-bom:pom:9.0.1.Final: Failure to find org.jboss.as:jboss-as-ejb-client-bom:pom:9.0.1.Final in http://downl
oad.java.net/maven/2 was cached in the local repository, resolution will not be reattempted until the update interval of java.net2 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
C:\_WORKSPACE\workspace\_myapp\myappjbosswildflyclient>
What should I be using for these dependencies?
This works fine for me:
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<type>pom</type>
<version>9.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jms-client-bom</artifactId>
<type>pom</type>
<version>9.0.1.Final</version>
</dependency>
It looks like you don't have access to the maven repository or could have disconnected while retrieving the dependency jars. You can manually delete your local repo and retry the build
Your dependencies must be of type POM.
<type>pom</type>
I found this post and followed the suggestions it provided:
https://developer.jboss.org/thread/237382
My dependencies look like this:
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<type>pom</type>
<version>8.0.0.Final</version>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jms-client-bom</artifactId>
<type>pom</type>
<version>8.0.0.Final</version>
<scope>import</scope>
</dependency>
I am now able to build the project and create the initial context for the ejb look up.
I Tried using 9.0.1.Final and 9.0.0.Final for the versions with no luck.
I am very uncomfortable with the fact that the versions do not match and with the fact that the dependencies documented in the README-EJB-JMS.txt file provided with the distribution does not work.
I am unable to build a Java project which uses ElasticSearch-Hadoop.
This is the error that I am seeing, when I try to build my project:
Scanning for projects...
------------------------------------------------------------------------
Building testES 1.0-SNAPSHOT
------------------------------------------------------------------------
The POM for cascading:cascading-local:jar:2.5.5 is missing, no dependency information available
The POM for cascading:cascading-hadoop:jar:2.5.5 is missing, no dependency information available
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 6.499s
Finished at: Mon Sep 08 11:29:08 IST 2014
Final Memory: 8M/19M
------------------------------------------------------------------------
Failed to execute goal on project testES: Could not resolve dependencies for
project org.edge:testES:jar:1.0-SNAPSHOT: The following artifacts could not
be resolved: cascading:cascading-local:jar:2.5.5, cascading:cascading-
hadoop:jar:2.5.5: Failure to find cascading:cascading-local:jar:2.5.5 in
http://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]
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.
For more information about the errors and possible solutions, please read
the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Below are the dependencies in the POM file for the project:-
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-hadoop</artifactId>
<version>2.1.0.Beta1</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.2.1</version>
<type>jar</type>
</dependency>
</dependencies>
Am I missing something?
looks like you are blocking maven to look at spring-source repository, to make it work add following snippet in your pom.xml
<project>
...
<repositories>
<repository>
<id>spring-milestones</id>
<url>http://repo.springsource.org/libs-milestone/</url>
</repository>
</repositories>
...
</project>
Have Eclipse Juno, maven 2.2.1, and m2eclipse running on a Red Hat Linux platform...
Downloaded a simple example to build a Restful Hello World web service (which works on my OS X computer) but for some odd reason, its not working on my Linux box.
Here's the 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>com.mkyong.common</groupId>
<artifactId>RESTfulExample</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>RESTfulExample Maven Webapp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
<build>
<finalName>RESTfulExample</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
When I try to issue an mvn compile from the command line:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building RESTfulExample Maven Webapp
[INFO] task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:jersey-server:bundle:null
Reason: Cannot find parent: com.sun.jersey:jersey-project for project: null:jersey -server:bundle:null for project null:jersey-server:bundle:null
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Nov 15 17:07:16 PST 2012
[INFO] Final Memory: 8M/309M
[INFO] ------------------------------------------------------------------------
Has anyone encountered this issue? I don't understand how it works on my OS X computer but not on Linux (which I don't think is the issue).
Thank you for taking the time to read this.
I would completely remove the entire repositories element in your pom.xml file. This way maven will use the standard central repository. Then change the version of jersey-server to 1.15 (the latest).
The latest jersey in that java.net repository is dated august 2011, while the standard central maven repository has version 1.15 dated October 30 2012.
I suspect that the reason it works on one machine and not the other is that in your ~/.m2/repository cache you have good cached files on one machine but not on the other. It may be necessary to delete the entire ~/.m2/repository/com/sun/jersey hierarchy and rebuild. You may have corrupted files there.
Had cracked my head for too long with this, so I really really need help from some experts out there who has a solution for this problem.
I have installed Sonatype Nexus ver 2.0.3 and I'm having it as my development repository for JavaEE, Glassfish kind of app and have configured maven settings.xml to read from the nexus repo. Every other jar was properly downloaded and cached but everytime when it comes to jars on org.eclipse.persistence.xxx, it failed with the result:
[WARNING] The POM for org.eclipse.persistence:eclipselink:jar:2.3.2 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:javax.persistence:jar:2.0.3 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen.processor:jar:2.3.2 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.core:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.oracle:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.2.0-RC4 is missing, no dependency information available
...
[ERROR] Failed to execute goal on project xxx-ejb: Could not resolve dependencies for project xxx:xxx-ejb:ejb:1.0-SNAPSHOT: The following artifacts could not be resolved: org.eclipse.persistence:eclipselink:jar:2.3.2, org.eclipse.persistence:javax.persistence:jar:2.0.3, org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen.processor:jar:2.3.2, org.eclipse.persistence:org.eclipse.persistence.core:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.oracle:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.2.0-RC4: Failure to find org.eclipse.persistence:eclipselink:jar:2.3.2 in http://localhost:8993/nexus/content/groups/myrepo/ was cached in the local repository, resolution will not be reattempted until the update interval of MyRepo 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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :xxx-ejb
Here's the way that I configure the nexus repo (open source version):
I have created a proxy to EclipseLink:
Repository Name: EclipseLink Maven Repository
Type: Proxy
Repository ID: eclipselink
Policy: Snapshot
Remote Storage Location: http://download.eclipse.org/rt/eclipselink/maven.repo/
Download Remote Indexes: False
Repository Path URL: http://localhost:8993/nexus/content/repositories/ecliselink/
As for the repo for the use of maven, I have created a group to lump the necessary repo:
Group Name: My Repository
Group ID: myrepo
In the Ordered Group Repository Lists, I have
:- Apache Snapshots
:- Central
:- Codehaus Snapshots
:- EclipseLink Maven Repository (which is referring to the previously created EclipseLink proxy)
In my pom.xml, the snipped of dependencies are as below:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.appclient</groupId>
<artifactId>gf-client</artifactId>
<version>3.1</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<version>5</version>
<scope>provided</scope>
</dependency>
In the maven settings.xml file, the mirror was defined as:
<mirror>
<id>MyRepo</id>
<name>My Repository</name>
<url>http://localhost:8993/nexus/content/groups/myrepo/</url>
<mirrorOf>*</mirrorOf>
</mirror>
Just to test if one of the jars exists, I have directly call [this is not a link]http://download.eclipse.org/rt/eclipselink/maven.repo/org/eclipse/persistence/eclipselink/2.3.2/eclipselink-2.3.2.jar in the browser and the jar is there. But when I try to get the jar from nexus at [this is not a link]http://localhost:8993/nexus/content/repositories/eclipselink/org/eclipse/persistence/eclipselink/2.3.2/eclipselink-2.3.2.jar, its 404?!
I have updated and repaired the index but all these are to no avail. Any help is truly appreciated.
Thank you.
I find a maven repository URL which works with "Nexus" too:
http://maven.eclipse.org/nexus/content/repositories/Sonatype/
The root of EclipseLink repository gives a 404 error (not when you link a specific jar). This strange behaviour may be is the source of the problem and Nexus cannot index the repository.
Try to use a mirror like this:
http://linorg.usp.br/eclipse/rt/eclipselink/maven.repo/
And also check this related question
Where did the EclipseLink/Maven repository go to? (again)