简体   繁体   中英

Artifact Name not matching the maven repo URL path

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

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM