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 ?