tiebin-zhang / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

Can not build using Maven dependency on powermock-mockito-release-full #386

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Maven can't find file for powermock-mockito-release-full.

This is the part of interest from my pom.xml file:

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-mockito-release-full</artifactId>
            <version>1.4.12</version>
        </dependency>

The error I get is:

... Could not find artifact 
org.powermock:powermock-mockito-release-full:jar:1.4.12 in central 
(http://repo1.maven.org/maven2) -> [Help 1]

A closer examination of what Maven is doing gave me the following:

Downloading: 
http://repo1.maven.org/maven2/org/powermock/powermock-mockito-release-full/1.4.1
2/powermock-mockito-release-full-1.4.12.jar

However this is not the file, it has been changing name to 
powermock-mockito-release-full-1.4.12-full.jar!
(note the trailing '-full' before the '.jar').

if I change my dependency, adding -final (shown below), I get the following:

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-mockito-release-full</artifactId>
            <version>1.4.12-final</version>
        </dependency>

Then Maven tries to fetch the following file:

http://repo1.maven.org/maven2/org/powermock/powermock-mockito-release-full/1.4.1
2-full/powermock-mockito-release-full-1.4.12-full.jar

The file name is now correct but note how the version gets '-full' before the 
'/powermock-mockito-release...' part.

Either way I can not build my project with Maven anymore.

Solution: add powermock-mockito-release-full-1.4.12-full.jar to the local 
repository.
Download the file, and then type the following command: 

mvn install:install-file -Dfile=powermock-mockito-release-full-1.4.12-full.jar 
-DgroupId=org.powermock -DartifactId=powermock-mockito-release-full 
-Dversion=1.4.12 -Dpackaging=jar

I would appreciate if you could fix either the file name (as it was 
previously), or the file path. :-)

Original issue reported on code.google.com by zherkezhi on 15 May 2012 at 12:41

GoogleCodeExporter commented 9 years ago
You should never depend on this artifact, it's for the PowerMock release 
procedure only.

Original comment by johan.ha...@gmail.com on 16 May 2012 at 7:38