9

我正在尝试为 spring batch 2.1.6 构建示例应用程序。(即 spring-batch-2.1.6.RELEASE/samples/spring-batch-samples)使用 maven,但由于缺少插件而出现此错误:

[错误] 插件 com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE 或其依赖项之一无法解析:未能找到 com.springsource.bundlor:com.springsource.bundlor.maven:http://repo1.maven.org/maven2中的jar:1.0.0.RELEASE被缓存在本地仓库中,直到 Central 的更新间隔已过或强制更新后才会重新尝试解析 ->

我可以设置另一个存储库来获取此插件吗?收到这个错误我有点惊讶,因为这是春季批次的最新发布版本。

这是下载时来自 pom 的存储库部分:

<repositories>
    <repository>
        <id>com.springsource.repository.bundles.external</id>
        <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle External</name>
        <url>http://repository.springsource.com/maven/bundles/external</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
4

4 回答 4

5

项目的父 pom 有一个bootstrap配置文件,其中包含必要的存储库定义。使用命令构建项目,mvn test -P bootstrap它将下载依赖项。

PS 这在自述文件的说明中解释了如何构建 Spring Batch。如果他们也能在使用示例的说明中说明如何操作,那就太好了——也许您可以提交错误报告?

于 2011-06-10T12:19:49.877 回答
1

我正在使用 maven3 并且能够通过将其添加到我的 pom 来解决这个问题:

<pluginRepositories>
    <pluginRepository>
        <id>plugin.repo.maven.central2</id>
        <url>http://objectstyle.org/maven2/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>
于 2012-03-01T22:44:56.180 回答
0

Spring 批处理管理示例构建肯定被破坏了。至少从今天开始。-Pbootstrap 没有帮助,并且在我的本地设置中的该配置文件中添加存储库也没有帮助。

当我尝试构建 spring-batch-admin-sample 时,我发现我缺少 spring batch 的依赖项!所以我去建造那个。在那里我发现我缺少 org.neo4j:neo4j-cypher-dsl-1.9.M04 和 gemfire.7.0.1.jar。由于 maven2/3 不兼容问题,添加 repos 无济于事。

因此,解决此问题的可靠方法是转到每个 repo,下载缺少的 dep 和 mvn install-file 它们。

所以在这里获取neo4j:http: //m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-cypher-dsl/1.9.M04/

从这里获取 gemfire 一个: https ://repo.springsource.org/gemstone-release-cache/com/gemstone/gemfire/gemfire/7.0.1/

然后我遇到了我在这里找到的foundrylogic.vpp依赖项:http://objectstyle.org/maven2/foundrylogic/vpp/vpp/2.2.1/ 不要 忘记获取相应的poms以保持它的清洁和得到所有的传递,如果有的话。

使用此处描述的 mvn install-file 插件将所有三个部门获取到本地存储库。 http://maven.apache.org/plugins/maven-install-plugin/usage.html

现在 spring-batch 应该构建干净。

现在如果你去构建 spring-batch-admin 它仍然会失败,因为它依赖于 spring-batch-core-2.2.3.BUILD-SNAPSHOT 而我们刚刚构建的是版本 3.0.0.BUILD-SNAPSHOT。

所以去 spring-batch-admin-parent 的 pom 并像这样修改 pom:

 <!-- <spring.batch.version>2.2.3.BUILD-SNAPSHOT</spring.batch.version> -->
 <spring.batch.version>3.0.0.BUILD-SNAPSHOT</spring.batch.version>

然后回到 spring-batch-admin 和 mvn clean install 应该构建示例。

希望这对某人有帮助!

于 2013-10-10T21:52:01.880 回答
0

我安装了maven 3.2.1并且可以正常工作。

于 2014-03-27T16:49:09.777 回答