19

I switched to a SNAPSHOT version of a plugin I use, and declared the corresponding snapshot repository in the POM like this:

<project> <!-- ... --> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-maven-plugin</artifactId> <version>2.3.0-SNAPSHOT</version> </plugin> </plugins> </pluginManagement> </build> <repositories> <repository> <id>apache.snapshots</id> <name>Apache Snapshot Repository</name> <url>http://repository.apache.org/snapshots</url> <releases> <enabled>false</enabled> </releases> </repository> </repositories> </project> 

Now Maven keeps complaining about not being able to download the plugin from our corporate repository (which does not mirror anything on the internet) - it just ignores the repository defined in the POM.

1 Answer 1

36

I forgot (again) that Maven distinguishes between repositories and pluginRepositories. The following code works fine:

<project> <!-- ... --> <pluginRepositories> <pluginRepository> <id>apache.snapshots</id> <name>Apache Snapshot Repository</name> <url>http://repository.apache.org/snapshots</url> <releases> <enabled>false</enabled> </releases> </pluginRepository> </pluginRepositories> </project> 
Sign up to request clarification or add additional context in comments.

1 Comment

For some reasons, plugins are picked from <repositories> of current module but only from <pluginRepositories> of parent.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.