Maven 尝试从端口 8081 上的 localhost 下载包/依赖项。这种连接 url 接管是不需要的,我以前没有发生过。
正常运行后mvn clean install
会发生这种情况:
Downloading:
http://192.168.10.46:8081/nexus/content/groups/public/org/codehaus/plexus/plexus-io/1.0/plexus-io-1.0.jar
Downloading:
http://192.168.10.46:8081/nexus/content/groups/public/org/codehaus/plexus/plexus- archiver/1.0/plexus-archiver-1.0.jar
Downloading: http://192.168.10.46:8081/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.enonic.kurs:my-plugin:1.0.0-SNAPSHOT (/Users/xx yy/Documents/Enonic plugins/project/project/pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin com.enonic.cms.tools:maven-cms-plugin:1.0.0 or one of its dependencies could not be resolved
从指定存储库下载依赖项之前的所有时间。我的 pom.xml 中的存储库:
<pluginRepositories>
<pluginRepository>
<id>enonic</id>
<name>Enonic Plugin Repository</name>
<url>http://repo.enonic.com/maven</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.enonic.cms</groupId>
<artifactId>cms-api</artifactId>
<version>4.4.10</version>
<scope>provided</scope>
</dependency>
.........
---------
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.enonic.cms.tools</groupId>
<artifactId>maven-cms-plugin</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
编辑:我想我已经找到了问题,但还没有解决方案。在构建插件内部com.enonic.cms.tools:maven-cms-plugin
有对 的依赖plexus-utils
,plexus-io
并且plexus-archiver
看起来这些有连接问题,这会强制本地存储库查找。
调试信息:
[INFO] Scanning for projects...
[DEBUG] com.enonic.cms.tools:maven-cms-plugin:jar:1.0.0:
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-model:jar:2.0.9:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.1:compile
[DEBUG] org.apache.maven:maven-artifact:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-project:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-profile:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG] junit:junit:jar:3.8.1:compile
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG] org.apache.maven:maven-archiver:jar:2.4.1:compile
[DEBUG] org.codehaus.plexus:plexus-archiver:jar:1.0:compile
[DEBUG] org.codehaus.plexus:plexus-io:jar:1.0:compile
[DEBUG] org.codehaus.plexus:plexus-interpolation:jar:1.13:compile
[DEBUG] org.apache.maven.shared:maven-osgi:jar:0.2.0:compile
[DEBUG] biz.aQute:bndlib:jar:0.0.203:compile
[DEBUG] Verifying availability of /Users/geir nygard/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar from [nexus (http://192.168.10.46:8081/nexus/content/groups/public, releases+snapshots)]
[DEBUG] Verifying availability of /Users/geir nygard/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0/plexus-archiver-1.0.jar from [nexus (http://192.168.10.46:8081/nexus/content/groups/public, releases+snapshots)]
[DEBUG] Verifying availability of /Users/geir nygard/.m2/repository/org/codehaus/plexus/plexus-io/1.0/plexus-io-1.0.jar from [nexus (http://192.168.10.46:8081/nexus/content/groups/public, releases+snapshots)]
设置.xml:
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://192.168.10.46: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>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
编辑settings.xml
更改mirrorOf
内容 后,*,!enonic
我收到此错误:
ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-install-plugin' from the repositories [local (/Users/xx yy/.m2/repository), enonic (http://repo.enonic.com/maven), nexus (http://192.168.10.46:8081/nexus/content/groups/public)]: Plugin not found in any plugin repository -> [Help 1]