0

Isn’t the artifact name under below URL wrong?

http://repo1.maven.org/maven2/org/powermock/powermock-mockito-release-full/1.5.1/

As per above URL, The name of the artifact should have been powermock-mockito-release-full-1.5.1.jar but what I see is powermock-mockito-release-full-1.5.1*-full*.jar. The additional –full is breaking my maven build (unable to find resource). Below is my dependency declaration and how different I should declare the POM dependency than below one.

<dependency>
    <groupId>org.powermock</groupId>
    <artifactId>powermock-mockito-release-full</artifactId>
    <version>1.5.1</version>
    <scope>test</scope>
</dependency>

Am I missing something?

Thanks

param83
  • 423
  • 2
  • 5
  • 16

2 Answers2

2

The last full in this repository is another dependency coordinate called classifier.

Try adding the classifier and you should download the dependency:

<dependency>
    <groupId>org.powermock</groupId>
    <artifactId>powermock-mockito-release-full</artifactId>
    <version>1.5.1</version>
    <classifier>full</classifier>
    <scope>test</scope>
</dependency>

I suggest to avoid classifier because their values are not standard and therefore their meaning and the way to use them is not always so clear.

taringamberini
  • 2,594
  • 18
  • 29
0

Looking at the mockito site you should include the dependency like so:

http://code.google.com/p/powermock/wiki/Mockito_maven

<properties>
    <powermock.version>1.5.4</powermock.version>
</properties>
<dependencies>
   <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
   </dependency>
   <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
   </dependency>
</dependencies>
cowls
  • 22,178
  • 6
  • 45
  • 76
  • +1 for specifying dependencies like this instead of using a jar with '-full' or '-all' in the name. Those jars often package some of the libraries they use (like Hamcrest) inside the jar where the dependency resolution process can't get at them. Then, if you need to use another version of Hamcrest for some reason, you can run into classpath problems. [Another Stackoverflow post](http://stackoverflow.com/questions/7869711/getting-nosuchmethoderror-org-hamcrest-matcher-describemismatch-when-running) gives an example. – user944849 Mar 20 '14 at 16:48