Can anyone tell me please what's wrong with my dependency Hamcrest in Maven?
That's a pity but I can't attach screenshot here.
The screenshot from IntelliJ IDEA
One the right side one can see that the dependency hamcrest-all:1.3 is inside dependency junit:4.11.
Maybe something wrong with my pom.xml file?
There is also a problem with hamcrest version 1.3 - dependency hamcrest:hamcrest-all:1.3 not found.
When I try to update Maven indices, nothing happens.
There is a slight difference between the group ids. Notice in the maven repository group id is org.hamcrest
http://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3
Sometimes, not specifying the dependency's version can give this Error
Unresolved Dependency
just specify the version of the dependency
example:
instead of this:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
use this:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>3.1.2</version>
</dependency>
Related
In a pom.xml file, I see something like this. What is the meaning of <version>${SomeProject.version}</version> here? Is it to tell Maven to use the latest version of that dependency?
<dependency>
<groupId>org.some.com</groupId>
<artifactId>SomeProject</artifactId>
<version>${SomeProject.version}</version>
</dependency>
So I am working on this project where these two dependencies selenium-firefox-driver and tint-runner are needed. Well the problem is that tint-runner indirectly depends on guava-19 but selenium-firefox-driver depends on guava-25.
So what i can do? I tried to change the pom dependency order and also tried to add guava-25 as a direct dependency.
There can be just one guava. You need to decide if you want to use guava-19 or guava-25 or maybe guava-23. This can only be found out by testing the application against different versions. Hopefully, you find one which suits both applications.
How to set the version: The easiest thing is to use <dependencyManagement>. Put the right version in the <dependencyManagement> section of your POM and this will override all transitive definitions.
You could add a section like this (or integrate it into your existing <dependencyManagement> section):
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>26.0-jre</version>
</dependency>
</dependencies>
</dependencyManagement>
I cant understand, why is failing this dependency in my pom.xml:
<dependency>
<groupId>statistics</groupId>
<artifactId>statistics-1.0-SNAPSHOT</artifactId>
<version>1.0</version>
</dependency>
But I have got the root well done:
C:\m2\repository\statistics\statistics-1.0-SNAPSHOT\1.0
Any help??
Im working of course in mode offline.
Your dependency looks weird with the duplicate versionreference. Maven is looking for ${localrepository}/groupId/artifactId/version/artifactId-version.type, where the dots in the groupId (if any) are used as directory-separators.
So in you case Maven is looking for C:\m2\repository\statistics\statistics-1.0-SNAPSHOT\1.0\statistics-1.0-SNAPSHOT-1.0.jar.
However, what you probably want is
<dependency>
<groupId>statistics</groupId>
<artifactId>statistics</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
I build a maven project and get an error on pom.xml Missing artifact in some dependencies. How can I resolve it?
I cannot see the value of ${jackson.version} on your image, but from the title of the question I assume it's version 1.9.11 you're looking for. If you check in any of the multiple maven repository viewers, like maven central, you'll see that version is not present, and therefore maven cannot resolve that dependency. Click this link to see the versions available in maven central.
You must choose an existing version from the central repository or, if you have version 1.9.11 in another repository, include that repository details in your pom.xml file.
You have to specify property of the jackson.version and this can be done by adding the section shown below:
<properties>
<jackson.version>2.10.0</jackson.version>
</properties>
The version has been updated as per the recent documentation from Maven.
From the Two Maven Dependencies
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.2</version>
<type>bundle</type>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.2.2</version>
<type>bundle</type>
</dependency>
Remove the bundle tag from both the dependencies and keep the version almost same it will work else it will show the above mentioned error.
Getting the following error. The problem is it happens intermittently when we restart our server. Sometimes the error comes and sometimes not. How to resolve this? I am using maven.
java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties;
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties;
Edit: It's not working. Old version is coming from hadoop-client:2.0.0-mr1-cdh4.2.0. I excluded hsqldb from this and checked in dependency tree and the old version is not showing up. But still I am getting the error at runtime.
You almost certainly have a dependency mismatch.
Make sure you know which version of hsqldb you expect to be using.
Check the list of dependencies that are in use by the app, by that I mean the actual JAR files in the built application, not the list of maven dependencies.
Most likely you have either the wrong version of the hsqldb jar or multiple different versions (ie the right version and a wrong version).
This can be caused by unexpected transitive dependencies being pulled in
To identify where the transitive dependencies are coming from, you can use the maven dependency:tree goal:
E.g.
mvn dependency:tree -Dverbose -Dincludes=hsqldb
Where hsqldb is the name of the artifact you are looking for.
http://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html
Oncer you have identified where the multiple versions are coming from, you can exclude from those dependencies, e.g.:
<dependency>
<groupId>sample.ProjectA</groupId>
<artifactId>Project-A</artifactId>
<version>1.0</version>
<scope>compile</scope>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>sample.ProjectB</groupId>
<artifactId>Project-B</artifactId>
</exclusion>
</exclusions>
</dependency>
More details here: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
I had this same error, and was
I was able to get this to work using gt-epsg-wkt instead of hsql.
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-epsg-wkt</artifactId>
<version>${geotools.version}</version>
</dependency>