Maven configuring setting XML explanation (Part 1)

Chen Bucheng I 2022-06-24 07:44:09 阅读数:547

mavenconfiguringsettingxmlexplanation

Top elements

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers/>
<mirrors/>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>

LocalRepository

effect : This value represents the path to build the local repository of the system . Its default value :~/.m2/repository.

<localRepository>${user.home}/.m2/repository</localRepository>

InteractiveMode

effect : Express maven Whether you need to interact with the user to get input . If maven You need to interact with the user to get input , Set to true, On the contrary, it should be false. The default is true.

<interactiveMode>true</interactiveMode>

UsePluginRegistry

effect :maven Is it necessary to use plugin-registry.xml File to manage plug-in versions . If you need to maven Working with files ~/.m2/plugin-registry.xml To manage plug-in versions , Set to true. The default is false.

<usePluginRegistry>false</usePluginRegistry>

Offline

effect : Express maven Need to run in offline mode . If the construction system needs to run in offline mode , Then for true, The default is false. When due to network settings or security factors , When the build server cannot connect to the remote warehouse , This configuration is very useful .

<offline>false</offline>

PluginGroups

effect : When plugins are organized id(groupId) When not explicitly provided , For search plug-in organization Id(groupId) A list of . The element contains a pluginGroup List of elements , Each child element contains an organization Id(groupId). When we use a plug-in , And there's no command behavior in its offering organization Id(groupId) When ,Maven The list will be used . By default, the list contains org.apache.maven.plugins and org.codehaus.mojo.

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<pluginGroups>
<!--plugin Organization Id(groupId) -->
<pluginGroup>org.codehaus.mojo</pluginGroup>
</pluginGroups>
...
</settings>
copyright:author[Chen Bucheng I],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/175/20210628191924050o.html