I need new third party jar for reading csv in maven based project. So, I did entry in pom.xml for same as below.
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.0</version>
</dependency>
But when I run mvn install or mvn package command, It does not download newly added dependency and just build project and generate war.
I am trying to get the issue! Please share solution if anybody face this earlier!
Regards
If you run Maven and it fails to download your required dependencies it's likely to be caused by your local firewall & HTTP proxy configurations. See the Maven documentation for details of how to configure the HTTP proxy.
Try running a forced update:
mvn clean install -U
The -U (uppercase U) forces maven to look at all dependencies and try to update them.
If the dependency is defined in a <dependencies>
block that is within a <dependencyManagement>
block, adding it without the version number to a <dependencies>
block that is outside <dependencyManagement>
may fix the problem.
This is because the purpose of <dependencyManagement>
block is to manage dependency versions, and not to install the dependencies. See this other article: Differences between dependencyManagement and dependencies in Maven
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With