Good, I have a problem, I try to add a dependency, but this marks the following
[ERROR] /root/evolplus/backendEvol/evolplus/icova/icova-service/src/main/java/com/applying/icova/service/IdeaServiceImpl.java:[10,42] package org.apache.commons.text.similarity does not exist
The dependency in question is commons-text
https://commons.apache.org/proper/commons-text/dependency-info.html
Well I am really a novice with maven, I have tried all the ways and I have not been able to add it, then I try the following, download the jar
http://www.java2s.com/Code/Jar/c/Downloadcommontext105jar.htm
and add it as follows
https://commons.apache.org/proper/commons-text/dependency-info.html
I don't get any errors, so I think it installed fine.
My directory tree is like this
./icova ./pom.xml
./icova/icova-service ./icova/pom.xml
It is this pom.xml file that contains the dependency that I am unable to install.
I try to add the jar and remove the dependency from the pom.xml file then run mvn clean package install
and its variants , and I get the following error.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project icova-service: Compilation failure
[ERROR] /root/evolplus/backendEvol/evolplus/icova/icova-service/src/main/java/com/applying/icova/service/IdeaServiceImpl.java:[10,42] package org.apache.commons.text.similarity does not exist
I guess it's because it doesn't find the dependency in question.
I would appreciate any help you can give me.
Try adding a -U when running your build command. For example:
The
-U
forces the update of dependencies, so you would ensure that the download is carried out.It is possible that you have had a previous problem downloading the library and, in those cases, maven stores an extension file
.lastUpdated
for that library in the local repository and does not download again until a certain time has elapsed. To force the download the -U parameter is used.On the other hand, and as a suggestion, it is better to download version 1.0 (the one linked from its github), which will be more stable.
The problem is because it doesn't find the dependency. If you are using Archiva or similar it may be caching. The dependency should be in the maven repository directory. in my case ../.m2/repository/org/apache/commons/commons-text/1.0/commons-text-1.0-sources.jar If it is not there, it could be due to a problem of permissions, space, etc.