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