I upgrade to Grails 2.4.2 because that supposedly fixes a bug with the maven plugin that caused it to generate a bad pom.xml file. Now, when I try to run the 2.4.2-generated pom with mvn clean install I get the following error message:
[ERROR] Failed to execute goal
org.grails:grails-maven-plugin:2.4.2:maven-compile
(default-maven-compile) on project PROJECT : Failed to create
classpath for Grails execution. Failure to find
org.codehaus.groovy:groovy-all:jar:2.4.2 in https://REPO 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]
Groovy 2.4.2 obvious doesn't exist since 2.3.X is the latest release. How do I force the maven plugins to take 2.3.2's groovy-all package as the dependency to use for Groovy?
Solution: it was a bug in the Maven plugin. I sent a code fix to the owner.
Update: I sent a bug fix that was incorporated into Grails. The new dependency is org.grails:grails-maven-plugin:2.4.3. You should update your Grails BuildConfig and the pom file (or regenerate it).
Related
I have a doubt with the dependency management in maven central. I have to say that this is a project in initial phase and I am not using my own repository, that's why I have this doubt.
GitHub dependabot tells me that the version I use jackson-databind is vulnerable.
Package com.fasterxml.jackson.core:jackson-databind (Maven)
Affected versions >= 2.13.0, <= 2.13.2.0
Patched version 2.13.2.1
[ERROR] Failed to execute goal on project erp-cloud-api: Could not resolve dependencies for project es.test.api.cloud:cloud-api:jar:0.3.0: The following artifacts could not be resolved: com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.13.2.1, com.fasterxml.jackson.core:jackson-core:jar:2.13.2.1, com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2.1, com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.13.2.1, com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.13.2.1: com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.13.2.1 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
I am using version 2.13.2 in Maven core, because there are no patched versions. And dependabot still detects the version as vulnerable. How would be the right way to fix this without stopping using maven central?
What I want is to be able to have a reproducible build and use the patched version correctly.
Thank you very much and sorry if the way has already been explained.
Solution:
That version did exist. The problem was with other artifacts (like jackson-annotations, jackson-databind or jackson-datatype-joda etc.) of the same groupId that did not have that version. I was using a common property to group them all together and that's where the problem was coming from. Thank you!
A brief search of maven central reveals that the newest version of jackson-databind is 2.13.2.2.
I am currently trying to follow this guide and every time I try to run the test code I am getting this error:
[ERROR] Failed to execute goal on project MyBot: Could not resolve
dependencies for project org.example:MyBot:jar:1.0-SNAPSHOT:
org.javacord:javacord:jar:3.4.0 was not found in
https://repo.maven.apache.org/maven2 during a previous attempt. This
failure was cached in the local repository and resolution is not
reattempted until the update interval of central has elapsed or
updates are forced -> [Help 1]
pom.xml
Maybe you have to load the dependencies you added to the pom.xml.
in IntelliJ you can right click on your pom.xml chose maven -> reload Project.
This loads all dependencies from pom.xml.
Check the console output for any errors.
Should the answer from Kaspatoo not working for you you can try to add the repository from Javacord to your project.
I figured it out, maven had downloaded the jars for the Dependency but wasn't loading them, I pointed maven to them in the system directory, and its working now
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 have cloned the git repository from https://github.com/viatra/org.eclipse.viatra.examples
and imported the project incquery-demo-generic (located in /query/headless-maven) as a Maven Project in Eclipse. Unfortunately I get the following error when I open the project's pom.xml:
Furthermore everytime when I click on "Run As" -> "Maven install" or "Maven build..." I get the following error message in the console:
Failed to execute goal on project incquery-demo-generic: Could not resolve dependencies for project hu.bme.mit.incquery:incquery-demo-generic:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.eclipse.incquery:runtime:jar:0.8.0-SNAPSHOT: Failed to read artifact descriptor for org.eclipse.incquery:runtime:jar:0.8.0-SNAPSHOT: Failure to find org.eclipse.incquery:org.eclipse.incquery.parent:pom:0.8.0-SNAPSHOT in https://repo.eclipse.org/content/repositories/emf-incquery-snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of incquery-snapshot has elapsed or updates are forced -> [Help 1]
Blockquote
In the Maven Dependencies Folder I can find some, but not all necessary jar files.
I have tried "Project clean", "Maven update", "Maven build... (Goal: clean package)" and to delete the .m2 repository and to re-build the maven project, but nothing helps.
I also tried to download some dependencies as .jar files and add them to the build-path, but they contain nothing but pom.xml and properties-files themself, thus I keep getting "cannot be resolved to a type" errors in relevant parts of the Java src-code.
Can somebody successfully run this project in her/his eclipse?
I am not an expert on Maven Projects so please tell me what to do in "layman words".
Thanks & kind regards,
MCRaven
The projects in the VIATRA examples repository (I notice it as one of the committers of the VIATRA project) are somewhat unusual: they are Eclipse plug-in projects that have Maven build informations added via Maven Tycho.
One more thing here: the 0.8.0 version of EMF-IncQuery bundles was released in 2014, thus it makes sense that the corresponding snapshot versions are removed. This means to me that this example was not updated for a long time. This is somewhat by design - some examples are not updated for each released version, but they are not are still available for references. If you are explicitly interested in this example, please contact us on VIATRA project forums or Bugzilla and we will provide example-specific support there.
Inside Eclipse we usually not rely on Maven (and our experience is that Tycho-based projects often does not work with M2E correctly). You could try to update Maven dependencies for the org.eclipse.incquery projects to 0.8.0, but I am still unsure whether it will work or not.
On the other hand, I'd rather suggest to install the old EMF-IncQuery version into your Eclipse instance and then simply rely on the Java Development Tools and the Plugin Development Environment to compile the project, and simply ignore any errors in the Maven descriptors for now.
I am following steps listed for Broadleaf 3.0 from the link.
Using the Eclipse-workspace with M2E plugin, I tried Maven Update Project and refresh.
However, the maven multi-module projects have unresolved build errors:
Description Resource Path Location Type
Missing artifact org.eclipse.equinox:registry:jar:3.3.1 pom.xml /core line 3 Maven Dependency Problem
Missing artifact org.eclipse.core:jobs:jar:3.3.1 pom.xml /admin line 3 Maven Dependency Problem
Missing artifact org.eclipse.core:jobs:jar:3.3.1 pom.xml /core line 3 Maven Dependency Problem
Missing artifact org.eclipse.equinox:registry:jar:3.3.1 pom.xml /site line 3 Maven Dependency Problem
Missing artifact org.eclipse.core:jobs:jar:3.3.1 pom.xml /site line 3 Maven Dependency Problem
Missing artifact org.eclipse.equinox:registry:jar:3.3.1 pom.xml /admin line 3 Maven Dependency Problem
I am using STS v3.2.0( I even tried with Eclipse Kepler version, same issue).
No build problems were present when using previous Broadleaf version 2.2.
I also searched maven repository for missing jars: here and here but errors are unresolved.
Is this still an issue for you? I see all three of those depdencies as available on Maven central as seen here:
registry
common
jobs
If you make sure that you're not using a mirror of Maven central that doesn't have those JARs available, it should pull down if you run mvn install -U
I employed a dirty and hacky workaround to fix Maven Build issues.
I had to manually download the closest version missing jars from maven repository, change versioning of jars in maven install command. For example:
The only available version for jar org.eclipse.equinox.common is v3.6.0.v20100503 present here:
Then install artifact with required version(v3.3.0) using maven command in following way:
mvn install:install-file -Dfile=~/Downloads/org.eclipse.equinox.common-3.6.0.v20100503.jar -DgroupId=org.eclipse.equinox -DartifactId=common -Dversion=3.3.0 -Dpackaging=jar
Please note you will have to download/install 5-6 jars in this manner.
I got the demo site and admin to work so far with no errors. Thus, the jar version mismatch hasn't impacted the Broadleaf Demo, atleast for now.