从maven antrun插件中的私有存储库请求自定义ant任务
我正在尝试执行一个自定义ant任务,它是在一个不在Maven Central下的jar中定义的,因此我为此创建了一个私有存储库 存储库是这样定义的,它还承载其他“私有”jar,这些jar被完全发现:从maven antrun插件中的私有存储库请求自定义ant任务,maven,ant,maven-antrun-plugin,Maven,Ant,Maven Antrun Plugin,我正在尝试执行一个自定义ant任务,它是在一个不在Maven Central下的jar中定义的,因此我为此创建了一个私有存储库 存储库是这样定义的,它还承载其他“私有”jar,这些jar被完全发现: <repositories> <repository> <id>repository.com</id> <name>repository.com</name>
<repositories>
<repository>
<id>repository.com</id>
<name>repository.com</name>
<url>http://repository.com/maven/</url>
</repository>
</repositories>
repository.com
repository.com
http://repository.com/maven/
现在问题是:
尽管在文档中,我只想在节中定义依赖项,但我发现我还需要在pom文件的泛型中定义依赖项
实际上是这样的,它复制了依赖项描述:
<dependencies>
<dependency>
<groupId>org.bitbucket.infinitekind</groupId>
<artifactId>appbundler</artifactId>
<version>1.0ea</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>local-install</id>
<phase>install</phase>
<configuration>
<target>
<taskdef name="appbundler" onerror="fail" classpathref="maven.plugin.classpath" classname="com.oracle.appbundler.AppBundlerTask"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.bitbucket.infinitekind</groupId>
<artifactId>appbundler</artifactId>
<version>1.0ea</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
org.bitbcket.infinekind
appbundler
1.0ea
maven antrun插件
1.7
本地安装
安装
跑
org.bitbucket.infinitekind
appbundler
1.0ea
这是预期的行为还是我遗漏了什么
编辑
即便如此,这种依赖性似乎也没有得到满足。
虽然我可以清楚地看到(由于通用依赖性),jar被下载并放置在~/.m2存储库中,但ant task仍然不理解它:
[ERROR]无法执行目标org.apache.maven.plugins:maven-antrun-plugin:1.8:run(本地安装)在项目cmmanager上:执行本地安装的目标org.apache.maven.plugins:maven antrun plugin:1.8:运行失败:plugin org.apache.maven.plugins:maven antrun plugin:1.8或其一个依赖项无法解决:在https://repo.maven.apache.org/maven2 缓存在本地存储库中,在经过central的更新间隔或强制更新之前,将不会重新尝试解析->[Help 1]
好吧,在进一步挖掘之后,我找到了答案。问题在于,插件依赖关系不是通过存储库部分解决的,而是通过pluginRepositories部分解决的。
因此,这将解决问题:
<pluginRepositories>
<pluginRepository>
<id>repository.com</id>
<url>http://repository.com/maven/</url>
</pluginRepository>
</pluginRepositories>
repository.com
http://repository.com/maven/