另一种方法是监听EventSpy
然后注入项目级别设置,在我们可以定义自定义存储库的范围内。
例如,
在${basedir}/.mvn/extensions.xml
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>com.github.gzm55.maven</groupId>
<artifactId>project-settings-extension</artifactId>
<version>0.1.1</version>
</extension>
</extensions>
在${basedir}/.mvn/settings.xml
<settings>
<mirrors>...</mirrors>
<profiles>
<profile>
<repositories/>
</profile>
</profiles>
</settings>