Maven finds artifact but cannot compile

2019-08-22 04:36发布

问题:

When I run a mvn compile I get a list of errors from the compilation that all say a package is missing that I have as a dependency in my pom.xml.

Pom.xml

`<dependency>
        <groupId>com.fortysevendeg.android</groupId>
        <artifactId>swipelistview</artifactId>
        <version>1.0-SNAPSHOT</version>
        <type>apklib</type>
 </dependency>`

Error
error: package com.fortysevendeg.swipelistview does not exist

I would really appreciate some help on this one. I have been banging my head against this for a while now.

回答1:

Looks like MVN is not able to pull your package ( com.fortysevendeg.swipelistview ) from your repository. To figure out, I would check-out the package from code repository ( i.e SVN, GitHub ) to your work space. Recheck the pom.xml for exact name & do MVN install.

link: Read

Downloading from a Remote Repository

Downloading in Maven is triggered by a project declaring a dependency that is not present in the local repository (or for a SNAPSHOT, when the remote repository contains one that is newer). 

By default, Maven will download from the central repository.

During MVN compile it look first in your local workspace & if doesn't find then it will pull it from repository configured to.