1029Coder
1029Coder

Reputation: 13

How to add plugins to .m2 repository (for those not found by pom.xml)

I'm trying to import via a pom.xml file the following plugin:

<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.1.0</version>

I looked inside the .m2 repository and this plugin wasn't present. I downloaded the jar and added it in the plugin folder inside the .m2 folder, but the pom.xml file still doesn't recognize (not found) this plugin.

Is there something I can try to make the pom.xml import this plugin in the project? This question applies for a couple of dependencies and plugins and can't seem to successfully import from the pom.xml files I have.

Thanks.

Upvotes: 0

Views: 1022

Answers (1)

sascha
sascha

Reputation: 26

Maven will download everything you specify in your POM from a repository on the internet (https://search.maven.org/) for you. As Alexandre mentioned.

There are a number of reasons why it might not work:

  1. You don't have a connection to the internet or you are behind a proxy.This happens mostly in companies.
  2. The dependency or plugin you want doesn't exist or you have a typo. I don't see that with you. https://search.maven.org/artifact/org.codehaus.mojo/properties-maven-plugin/1.1.0/maven-plugin
  3. Your IDE doesn't automatically triggers Maven to start the download after you have added something to the POM and saved the POM.

You might try to manually download the plugin via Maven:

  1. Open a terminal inside the directory of the POM.

  2. Try the following command:

    mvn -U dependency:sources dependency:resolve -Dclassifier=javadoc
    
  3. Does it work or do you get any errors?

PS: I don't have enough reputation to add a comment...so I misuse the answer.

Upvotes: 1

Related Questions