dependency not found maven

0

Good I have a problem I try to add a dependency, but this marks me 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

link

Well I'm really a rookie with maven, I've tried all the ways and I have not been able to add it, then I try the following, download the jar

link

and add it in the following way

link

I do not get any error, so I think it settled well.

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 can not install.

I try to add the jar and delete the dependency of the pom.xml file then I execute 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 he does not find the dependency in question.

I would appreciate any help you can give me.

    
asked by Kevin AB 14.03.2017 в 03:35
source

2 answers

1

Try adding an -U at the time of executing your compilation command. For example:

mvn clean package -U

The -U forces the update of dependencies, thus ensuring that the download is made.

It is possible that you had some previous problem in the download of the library and, in those cases, maven stores in the local repository a file of .lastUpdated extension for that library and does not perform the download again for a while. determined. To force the download, use the -U parameter.

On the other hand and as a suggestion, download version 1.0 (the one linked from your github), which will be more stable.

<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-text</artifactId>
  <version>1.0</version>
</dependency>
    
answered by 14.03.2017 / 08:14
source
1

The problem is because you can not find the dependency. If you are using Archiva or similar, you may be frisking. The dependency should be in the repository directory of maven. in my case ../.m2/repository/org/apache/commons/commons-text/1.0/commons-text-1.0-sources.jar If not, it could be due to a problem of permits, space, etc.

  • Try deleting the folder and doing a mvn clean install to see if it downloads the dependency.
answered by 14.03.2017 в 09:33