Failed to execute goal on project J2EE2: Could not resolve
dependencies for project com.example.j2ee2:J2EE2:war:0.0.1-SNAPSHOT:
The following artifacts could not be resolved: javax.jms:jms:jar:1.1,
com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1: Could
not transfer artifact javax.jms:jms:jar:1.1 from/to java.net
(https://maven-repository.dev.java.net/nonav/repository): No connector
available to access repository java.net
(https://maven-repository.dev.java.net/nonav/repository) of type
legacy using the available factories AsyncRepositoryConnectorFactory,
WagonRepositoryConnectorFactory
I've updated all my "lastUpdated" files, still I'm repeatedly getting the same error all the time. Is this error arising because I don't have setting.xml in my .m2?
Either one of the options:
1 - This repository that your configuration is trying to download the dependency doesn't exists (https://maven-repository.dev.java.net/nonav/repository)
2 - You are in a machine under a proxy and it is not configured in your maven settings.xml file (whether it is on .m2 or $MAVEN_HOME/conf )
3 - See if your eclipse is usign the maven installation or the embeded maven installation (change to maven installation)
Hope it help
Related
this is my first question on SO I'll try my best to make it good.
My team deploys multiple Java Cloud Functions (GCP) using a few common classes (with maven to manage dependencies). Right now those classes are duplicated in each function and have to be updated everywhere at each code edit. Each Cloud Function is deployed from source.
To avoid duplicating those classes I packaged them in a jar, everything runs fine locally. I added this jar as a local dependency in each Cloud Function pom file and tried to deploy from jar by building a jar with all dependencies and providing it in the --source option of gcloud deploy. This causes a timeout error from what seems to be the jar uploading.
Error trace :
DEBUG: Starting new HTTPS connection (1): storage.googleapis.com:443
DEBUG: Caught socket error, retrying: ('Connection aborted.', timeout('The write operation timed out',))
What I tried so far :
Setting a higher deployment timeout with gcloud config set app/cloud_build_timeout 10000 but this doesn't seem to apply to the uploading step as it fails always after a few minutes.
Uploading my local dependency to a private nexus repository to deploy my functions from source as before, but the pull failed on a Wagon error when I run mvn package and I didn't find any solution either : WagonTransporterFactory: Unsupported transport protocol
Detailed error :
[ERROR] Failed to execute goal on project get-content: Could not resolve dependencies for project project:cf:jar:1.0: Failed to collect dependencies at project:pipeline:jar:0.0.1: Failed to read artifact descriptor for project:pipeline:jar:0.0.1: Could not transfer artifact project:pipeline:pom:0.0.1 from/to project-nexus (XXX): Cannot access XXX with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access XXX using the registered transporter factories: WagonTransporterFactory: Unsupported transport protocol -> [Help 1]
I beleive this is only due to my jar with dependencies being to large for upload as I actually deployed the jar without dependency by mistake first (deploy succeded but class definition missing during execution). My question is how can I deploy my Cloud Function with one local/private dependency ?
Note :
I can't upload my dependency to a public maven repository
Each Cloud Function depends also on public maven dependencies which seems to be too large to package in a single jar for deployment
I solved this by switching from Maven to Gradle.
The problem was that Maven stores the repository authentification parameters in a local file ~/.m2/settings.xml that Google Build can't access when building my Cloud Function for deployment.
I switched to Gradle to provide the authenfication in the gradle.build file directly following this question.
I am trying to build Apache CXF locally. It does not work behind a maven proxy (e.g. JFrog Artifactory), because CXF's transitives dependencies contain a dependency with an invalid pom.xml file:
[ERROR] Failed to execute goal on project cxf-rt-transports-jms: Could not resolve dependencies for project org.apache.cxf:cxf-rt-transports-jms:bundle:3.4.0-SNAPSHOT: Failed to collect dependencies at org.apache.activemq:activemq-pool:jar:5.15.9 -> org.apache.activemq:activemq-jms-pool:jar:5.15.9 -> org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1: Failed to read artifact descriptor for org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1: Could not transfer artifact org.apache.geronimo.specs:specs:pom:1.1 from/to nexus-central (https://myrepo.local/maven-central/): Failed to transfer file https://myrepo.local/maven-central/org/apache/geronimo/specs/specs/1.1/specs-1.1.pom with status code 409 -> [Help 1]
Artifactory will deliver a 409 if it cannot parse the XML file. In this case, the artifact is apache.geronimo.specs:specs:pom:1.1. If you take a look at the XML file, you'll find it is invalid indeed: https://repo1.maven.org/maven2/org/apache/geronimo/specs/specs/1.1/specs-1.1.pom
After line 89 (closing </developers>), there is an extra `.
I opened an issue at apache to fix their build: https://issues.apache.org/jira/browse/CXF-8101
In the mean time, I'd like to work with CXF to create a patch an contribute.
Things I tried:
Install the dependency manually => failed because mvn still looks for updates
No proxy => not an option for me :(
Add some excludes locally on the parent/pom.xml => didn't help, I will never be able to catch them all (transitive dependencies…).
Forcing the offending artifacts' version to 1.2. Did not help either, because some projects wil still rely on a specific version.
That said, what are my options?
Thanks in advance,
Ben
You can try:
Download org/apache/geronimo/specs/specs/1.1/specs-1.1.pom into your local .m2 path and fix the error.[You need to be sure all dependencies are available in your local repository]
Try to build with maven command: -o (offline)
If -o doesn't help, try with -nsu,--no-snapshot-updates (Suppress SNAPSHOT updates)
Hope it helps you.
I am trying to run a Spring Project, with several dependencies, that I have already downloaded into my local repository, and have also done followings :
Added local repository path in setting.xml in localRepository tag.
Running the project using mvn install -nsu -llr -o , for offline mode.
And I am getting following error :
[ERROR] Failed to execute goal on project file2Json: Could not resolve
dependencies for project
com.nse.file2Json:file2Json:jar:0.0.1-SNAPSHOT: Cannot access central
(http://repo1.maven.org/maven2) in offline mode and the artifact
com.fasterxml.jackson.dataformat:jackson-dataformat-csv:jar:2.8.4 has
not been downloaded from it before. -> [Help 1]
I have the dependency installed, take a look :(
I have following questions :
Why is the project is trying to look into http://repo1.maven.org/maven2 when I am using offline mode ?
How can I run the project offline, by providing the required dependencies at required paths ?
Please help !
thanks in advance.
It says it cannot access Maven Central because you are in offline mode. And it tries to look there, because ´jackson-dataformat-csv` is not in your local repository, so Maven needs to get it from somewhere (and Maven Central is the default repository).
What you need to do is to execute mvn dependency:go-offline before you switch to the offline mode. This will download everything that you need (dependencies, transitive dependencies as well as plugins).
I can't create new maven project using this IDE Spring Tool Suite.
It show me the following errors
CoreException: Could not calculate build plan: Plugin
org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its
dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1:
ArtifactResolutionException: Could not transfer artifact
org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to central
(https://repo.maven.apache.org/maven2): proxy.example.com
enter image description here
the version of my STS is 3.7.1 RELEASE
Could any one please help
I had the exact same problem and since I read somewhere that the error was caused by a cached file, I fixed it by deleting all the files under de .m2 repository folder. The next time I built the project I had to download all the dependencies again but it was worth it.
While creating New Maven > MAVEN-ARCHETYPE-WEBAPP (or infect any provided Arifact of org.apache.maven.archetypes) project on Eclipse Kelper, I am getting following error:
Could not calculate build plan:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its
dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 Plugin
org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its
dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
I did requried proxy session and able to add dependencies in POM.XML. Also the enviorment variables (M2, M2_HOME, JAVA_HOME, CLASSPATH) are set.
mvn -version on command prompt is giving required output so maven is working on system.
Windows - Preference - Maven - Office is not selected. And Download options are selected.
Not sure what is missing :(
Kindly advise!
Thanks in advance,
SK
May be this is requried : settings.xml
Step 1: Create specific settings xml file. see here
Configure the local repository if required.
Configure from where the jar files need to be downloaded, using <mirrors> or <profiles> configuration.
Step 2: Place settings.xml in .m2 folder