1

I have installed the Nexus Repository Manager OSS 3.6.1-02 locally and deployed some 3rd party libraries to a new repository I created - myrepo - by

mvn deploy:deploy-file -DgroupId=com.test -DartifactId=testfile -Dversion=1.0.0 -Dpackaging=jar -Dfile=testfile.jar -DrepositoryId=myrepo -Durl=http://localhost:8080/repository/myrepo/

Everything looks fine in Nexus. I'm seeing the 3rd party libraries deployed with their corresponded pom files created in myrepo. The problem is that when I tried to download those libraries as dependencies of a project, executing the install goal it says:

The POM for com.test:testfile:jar:1.0.0 is missing, no dependency information available
Failed to execute goal on project testproyect: Could not resolve dependencies for project com.test:testproyect:war:1.0.0: The following artifacts could not be resolved: com.test:testfile:jar:1.0.0: Could not find artifact com.test:testfile:jar:1.0.0 in myrepo (http://localhost:8080/repository/myrepo/) -> [Help 1]

My project's pom has:

<dependencies>
    <dependency>
        <groupId>com.test</groupId>
        <artifactId>testfile</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>
<repositories>
    <repository>
      <id>myrepo</id>
      <name>local repository</name>
      <url>http://localhost:8080/repository/myrepo/</url>
    </repository>    
</repositories>

What am I missing?

jmann
  • 375
  • 1
  • 5
  • 17
  • The url you have used in the deploy-file command should contain something like this `releases/..`? Why are you using deploy-file instead of `mvn deploy`? – khmarbaise Dec 13 '17 at 07:15
  • Did you try `mvn -U` ? See https://stackoverflow.com/questions/4701532/force-maven-update – Pierre B. Dec 13 '17 at 10:34
  • @khmarbaise I uploaded the jars to the /maven-releases repository of Nexus, but I still get the same error. By the way, is Nexus OSS 3.6.1-02. I use deploy-file because these are 3rd party jars, don't have any pom file – jmann Dec 13 '17 at 20:30
  • @Pierre B. I tried 'mvn clean install -U' and get the same result.. maven don't find the pom and the jar in nexus – jmann Dec 13 '17 at 20:32
  • First if these are 3rd party jars you should create a separate repository in Nexus for such jar's. If you don't have a pom file you have to create one otherwise it's not possible to use them... – khmarbaise Dec 14 '17 at 08:56
  • Try to navigate with your browser at `http://localhost:8080/repository/myrepo/.../com/test/testfile` Does your artifact exists? – Pierre B. Dec 14 '17 at 09:31
  • @Pierre B. thank you for your response.. I had a proxy issue. Taked out and maven could find the artifacts – jmann Dec 15 '17 at 15:08
  • 1
    Great, you can post that as an answer to explain how you solved it – Pierre B. Dec 15 '17 at 17:19

0 Answers0