1
我有一個項目,它有一個名爲repo
的目錄,其中存儲了工件。當我用maven構建它時,nexus表示依賴不能解決;當我從maven設置中刪除nexus時,它可以找到工件。配置nexus首先從本地存儲庫查看工作目錄
我想讓maven在詢問nexus之前查看這個目錄,或者像那樣,這樣我就可以在沒有每次激活連接的情況下創建它。我怎樣才能做到這一點?我目前的Maven的設置(〜/ .m2目錄/ settings.xml中):
<settings>
<localRepository>/home/a/.m2/repository</localRepository>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<!--<url>http://nexus.yourdomain.nl/content/groups/public</url> -->
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<!-- if you want to be able to switch to the defaultprofile profile put this in the active profile -->
<profile>
<id>defaultprofile</id>
<repositories>
<repository>
<id>maven.default</id>
<name>default maven repository</name>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>maven.snapshot</id>
<name>Maven snapshot repository</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>defaultprofile</activeProfile>
</activeProfiles>
</settings>
其中'repo'配置命名的本地倉庫?我沒有在'settings.xml'中看到它。它在'pom.xml'中嗎? –
它不在'settings.xml'和'pom.xml'中。 – SonOfSun