1

I have been trying to generate a site using mvn -s <path_to_settings.xml> site command but facing a problem. It says that unable to resolve plugin that is present in a private repository. The URL of the private repository is provided in the settings.xml using the <pluginRepository> tag.

In my settings.xml file I have

<pluginRepositories>
   <pluginRepository>
     <id>pluginRepo</id>
     <url>{URL Of the Repository}</url>
      <releases>
          <enabled>true</enabled>
      </releases>
      <snapshots>
          <enabled>true</enabled>
      </snapshots>
   </pluginRepository>
</pluginRepositories>

Initially I thought it might not be picking up the correct settings file, so I ran the command using -X flag and found that it is indeed picking up the correct settings.xml file and correct pluginRepository URL as well.

The relevant output of the debug logs is

[DEBUG] Reading global settings from <global-settings-path>\settings.xml
[DEBUG] Reading user settings from <my-settings-path>\settings.xml
[DEBUG] Repositories (plugins)     : [
  pluginRepo ({url of private repo}, default, releases+snapshots),
  central (https://repo.maven.apache.org/maven2, default, releases)]

But it gives me error that

Failure to find my-plugin:jar:version in https://repo.maven.apache.org/maven2

But when I define the <pluginRepositories> in pom.xml the command works fine. i.e. if I add the following in my pom.xml and run the same command mvn -s <path-to-settings.xml> -X site

<pluginRepositories>
   <pluginRepository>
     <id>pluginRepo1</id>
     <url>{URL Of the Repository}</url>
      <releases>
          <enabled>true</enabled>
      </releases>
      <snapshots>
          <enabled>true</enabled>
      </snapshots>
   </pluginRepository>
</pluginRepositories>

And in the debug logs, I have

[DEBUG] Repositories (plugins)     : [
  pluginRepo ({url of private repo}, default, releases+snapshots),
  pluginRepo1 ({url of private repo}, default, releases+snapshots),       
  central (https://repo.maven.apache.org/maven2, default, releases)]

My question is : Does mvn site command looks for plugins at the URL defined via pluginRepository in settings.xml ?

vdua
  • 1,281
  • 1
  • 14
  • 24
  • is it a custom plugin? did you add that groupId to the pluginGroups in settings.xml as well? – wemu Aug 26 '15 at 07:44
  • Yes, it is a custom plugin. I have added the pluginGroup that in the settings.xml as `{my plugin group id}` and using that in the project as `{my plugin group id}...` Everything is working fine when I run `mvn -s settings.xml clean install` but I am having problems only with `mvn -s settings.xml site` – vdua Aug 26 '15 at 08:12
  • so it is a reporting plugin? or one used for the build? Is the plugin configured as reporting plugin? is it bound to a wrong phase? the site life-cycle differs from the default life-cycle: https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference - what error do you get? – wemu Aug 26 '15 at 08:57
  • This is not a reporting plugin but packages my code into a zip file. The default phase of the plugin is package. It also defines a new type of packaging my-zip-pacakge using the steps mentioned in this [answer](http://stackoverflow.com/questions/1427722/how-do-i-create-a-new-packaging-type-for-maven). Failure to find my-plugin:jar:[unknown versions] in https://repo.maven.apache.org/maven2 – vdua Aug 26 '15 at 12:12

0 Answers0