I am having an issue in which IntelliJ is not recognising the mysql-connector dependency in my pom.xml file. It appears as red and displays 'Dependency 'mysql:mysql-connector-java:8.0.25' not found'. I don't have to download anything, do I? Is declaring the dependency in pom.xml enough? I am also getting the same for the maven-failsafe-plugin.
My pom.xml file dependency:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.25</version>
<scope>compile</scope>
</dependency>
If anyone has any suggestions, they would be greatly appreciated.
Related
I'm facing some strange problem.
During maven build I'm getting package io.rsocket.core does not exist.
My pom.xml contains following dependencies
<dependency>
<groupId>io.rsocket</groupId>
<artifactId>rsocket-core</artifactId>
<version>1.0.0-RC6</version>
</dependency>
<dependency>
<groupId>io.rsocket</groupId>
<artifactId>rsocket-transport-netty</artifactId>
<version>1.0.0-RC6</version>
</dependency>
Analyzing reactor-core jar file showes that there is no core package in that jar. Did I missed some dependencies?
Thanks
Package is found in the artifact (spring-cloud-function-rsocket) Add this to your pom:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-rsocket</artifactId>
<version>3.1.0-SNAPSHOT</version>
</dependency>
I have seen many solutions in Stack Overflow but none of them worked for me.
So I am getting this exception. My pom.xml code is here
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
I have added jar file in tomcat/lib folder also. But nothing is working for me.
You should rebuild your Maven project after adding new dependencies, either directly on Eclipse if you have the m2e built-in support (which you should, as explained and recommended in this question),
By right-clicking on the project name and then doing Maven->Update project (as #BackSlash suggests)
Also, looking at your pom.xml you are not nesting that <dependency> inside the <dependencies> tag, my db connector (postgress) looks something like this:
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.0.0.jre7</version>
</dependency>
... more <dependency> here...
</dependencies>
You can check this great link that explains how to write pom.xml files when creating and building Java projects with Maven.
Edit:
Remember to call the driver exactly like "com.mysql.jdbc.Driver", with capital 'd'.
Could anyone please give me suggestion how can i solve this issue?
Maven Version : 4.0.0
maven-compiler-plugin:3.5.1
Add selenium dependencies in your pom.xml
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>2.53.0</version>
</dependency>
You don't seem to have a dependency for org.openqa.selenium
Try adding dependency for org.openqa.selenium in your pom.xml
In my maven-project there are three dependencies corresponding to RichFaces:
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
</dependency>
And in the root of my eclipse project MavenDependencies branch contains richfaces-api/ui/core -3.3.3. How can I change the pom to upload latest available version? The thing is there is no version defined anywhere in the pom.
There has to be a version defined otherwise it would not work. Eclipse will tell you what version you're using and where to find the definition if you hover over the dependency.
I Think there's a bom dependency somehwere in your pom such as this
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>BOM-VERSION</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Update the BOM-VERSION part to something new such as "4.3.7.Final".
I am new to Maven and am trying to set up one of my first POMs. My application will cache using EhCache. Going to Maven Central Repo (link here) I copy-n-pasted the <dependency> tag and copy it into my pom.xml like so:
...many dependencies above this point
<dependency>
<scope>compile</scope>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<scope>compile</scope>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<scope>compile</scope>
<groupId>jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>3.5.3</version>
</dependency>
...many dependencies below this point
When I save the changes, Eclipse builds the workspace and gives me an error on the opening <dependency> tag for EhCache 2.5:
Missing artifact net.sf.ehcache:ehcache:jar:2.5.0
So I figured that perhaps v.2.5.0 has something wrong with it, and repeated the same for 2.4.7 (the last 2.4.x release before 2.5.0). Same deal.
Since I'm so new to Maven, I don't even know where to begin looking. I tried Project >> Clean and even restarted Eclipse to see if it was just a typical Eclipse "quirk". Nope.
I am thinking:
Could EhCache be publishing bad JARs to the Maven repo?
Could Maven Repo have something wrong with it?
Could this be due to something else configured wrong in my pom.xml?
Could this be a "JAR hell" issue where I have a conflict somewhere on my dependency graph?
How would SO start tackling this problem? Thanks in advance!
It is usually safer to refer to search.maven.org. Dependency from there:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.5.0</version>
<type>pom</type>
</dependency>
Mind type pom. From module's pom:
This is a pom artifact to pull in ehcache-core and ehcache-terracotta
for clustering. Make sure to set 'type' to 'pom' in your dependency.
Aparently when someone does not need terracotta, ehcache-core will do perfectly fine as other answer states.
They use ehcache-core in the official documentation. Maven Central does not have a jar artifact for ehcache 2.5 which explains your error message.
Using ehcache-core changes the dependency to:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.5.0</version>
</dependency>
Which successfully downloads on my machine (ehcache does not).
I dropped this into IntelliJ and it found it. I suspect there is something wrong with your settings. Try creating a project with only this dependency in it. If it fails to download, I would check your setting. e.g. .m2/settings.xml Are you using a Nexus server or maven proxy/cache?
BTW: A simpler way to search for JARs is to use http://mvnrepository.com/ which will find all the available versions and show you the XML you need to add.