maven Failed to collect dependencies for flapdoodle.embed.mongo - maven

I have an issue locally with maven range. Maven failed to collect dependencies for below dependency. But in deed, there is version for 3.4.6 which was downloaded already.
May u have any hints?
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<version>[3.4.6,3.5.0)</version>
<scope>test</scope>
</dependency>

Check your internet connection also see if you need to configure proxy for your internet
I had similar issue and this fixed it.

Related

unable to resolve dependency for akamai edgegrid API

I am trying to use akamai edgegrid API for invalidating akamai chache. I have added below dependency in my pom.xml, but my bundle keeps in installed state. Below are more details-
pom.xml dependency-
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-apache-http-client</artifactId>
<version>2.1.0</version>
<scope>provided</scope>
</dependency>
Bundle is in installed state, on felix console it says-
Imported Packages com.akamai.edgegrid.signer -- Cannot be resolved
error.log says -
Unable to resolve 497.82: missing requirement [497.82] osgi.wiring.package; (osgi.wiring.package=com.akamai.edgegrid.signer)
You have used <scope>provided</scope> , it means this jar will be used during compile time and during run time it will use the jar available on the run time environment. Unfortunately edgegrid-signer-apache-http-client-2.1.0.jar is not available on the AEM instance.
To resolve the issue, Do not use <scope>provided</scope> .
Updated POM -
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-apache-http-client</artifactId>
<version>2.1.0</version>
</dependency>
Before deploying the bundle on AEM, extract the jar and check edgegrid-signer-apache-http-client.jar , edgegrid-signer-core.jar, httpclient.jar, httpcore.jar should be part of the bundle.
Hopefully it will solve your issue. All the best.
Please let me know if you still face any issue.
-Mrutyunjaya

Unable to download saxon-he 9.5 with maven

Maven will not retrieve saxon 9.5, because it has two conflicting dependencies on jdom.
It turns out the second dependency :
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.4</version>
<optional>true</optional>
</dependency>
should probably have "jdom2" as artifactId.
Does anyone have suggestions on how to override this?
Yes indeed you are right. I have raised this as a bug issue on the Saxon community site:
https://saxonica.plan.io/issues/2056
We will address the problem as soon as possible.
To override dependencies in maven I suggest look at the following:
Override dependencies of third party jar in maven

Maven failure to find maven-plugins:maven-cobertura-plugin

I try to compile maven web project with
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws</artifactId>
<version>3.0.5-FINAL</version>
</dependency>
The problem is that when I try compile it I get the following errors:
[ERROR] Failed to execute goal on project inferx-d2aserver: Could
not resolve dependencies for project
com.inferx:inferx-d2aserver:war:4.0: The following artifacts could not
be resolved: maven-plugins:maven-cobertura-plugin:plugin:1.3,
maven-plugins:maven-findbugs-plugin:plugin:1.3.1,
org.springframework.ws:spring-ws:jar:3.0.5.RELEASE: Failure to find
maven-plugins:maven-cobertura-plugin:plugin:1.3 in
http://repository.springsource.com/maven/bundles/release was cached in
the local repository, resolution will not be reattempted until the
update interval of com.springsource.repository.bundles.release has
elapsed or updates are forced -> [Help 1] [ERROR]
I use Apache Maven 3.0.3, Java: 1.7.0 OS: Windows 7 (64 bit)
I am not sure if this is the same case since my dependencies is different. I got similar error message with the same dependencies error so I removed both dependencies from ~/.m2/repository/jaxen/jaxen/1.1.3/jaxen-1.1.3.pom and the project is compile fine now.
I was also facing similar issue. I just excluded jaxen from Jdom dependency and it worked for me.
jdom 1.1.2 includes jaxen 1.1.3 which imports those artifacts.
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1.2</version>
<exclusions>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
</exclusions>
</dependency>
It look like your pom or parent pom contains a wrong definition of the maven-coberatura-plugin which should be fixed first. Furthermore remove the folder in your local repository.
From the error message related to cobertura version, it looks like you may be having a pom.xml corresponding to maven 1.
The following are maven 1.x versions of the plugins and not supported.
maven-plugins:maven-cobertura-plugin:plugin:1.3,
maven-plugins:maven-findbugs-plugin:plugin:1.3.1
Removing the pom is not the solution; in future builds may be you need them. Best solution according to my opinion is to modify the POM of corresponding jars. Like if you are getting error because of any jar; actually there is the dependency defined in its POM. So use <exclude>. That will work for sure.

Cannot resolve Derby 10.5.3.0 dependancies with Maven

I'm trying to build my client application to include Derby 10.5.3.0 in a maven build. My pom.xml dependancy is :
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.5.3.0</version>
<scope>compile</scope>
</dependency>
I get this error during the build:
Could not resolve dependencies for project DERBY:DerbyDemo:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [org.apache.derby:derby:jar:10.5.3.0 (compile)]
Other versions of Derby build fine. I wanted to use 10.5.3.0 in the build to stay in sync with the version of the server, which is the Oracle Download of Java DB 10.5.3.0
For reference sake, at post time version 10.9.1.0 works:
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.9.1.0</version>
</dependency>
I just picked the latest version from the Derby site
That's a fairly old version of Derby. Not all versions of Derby are stored in the master Maven repositories. Can you use a newer version?

downloading guice3.0 artifact from maven central repository

I'm trying to upgrade my struts2 web app from guice2.0 to guice3.0.
I'm trying to test it out using maven jetty.
I've successfully upgraded my pom.xml to use the correct version and groupId for the 3.0 release, but if I call mvn jetty:run
I see that it is trying to download
guice-3.0-no_deps.jar
which throws a build error and can't be found the central repository?
I don't get this error if I don't include any guice extensions.
Any ideas?
Thanks
I posted this question also to the guice user group.
This is the answer I received.
The guice-3.0-no_deps.jar is a build-time artifact that's used to compile the extensions, but is not required at runtime - it's not on maven central because the Guice team didn't want people depending on this "uber-jar" by mistake. The extensions have an optional dependency to guice-3.0-no_deps.jar (so they can compile) but they also have a non-optional dependency to guice-3.0.jar for the runtime case.
Well-behaved maven plugins should see that the the no_deps dependency is optional and not throw a build error if it's missing, so this sounds like a bug in the jetty plugin. To workaround the Jetty bug you can explicitly hide this dependency as follows:
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-struts2</artifactId>
<version>3.0</version>
<exclusions>
<exclusion>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
Note that we can't do this in the original build pom because we still need the no_deps dependency when doing the original compilation.

Resources