2

我正在尝试按照此站点上的说明进行操作:

http://trac.erichseifert.de/warp/wiki/DeveloperGuide

我已经获得了所有源代码 - 并且在 mpqparser 和 vectorgraphics2d 上都完成了 mvn install - 然后我进入 gral 文件夹 - 并尝试运行它,我遇到了这个错误:

> $ mvn install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
de.erichseifert.gral:GRAL:jar:0.8
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-
changelog-plugin is missing. @ line 143, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GRAL Graphing Library 0.8
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for de.erichseifert.vectorgraphics2d:VectorGraphics2D:jar:0.6
is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.329s
[INFO] Finished at: Sun Apr 22 00:18:13 BST 2012
[INFO] Final Memory: 3M/122M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project GRAL: Could not resolve dependencies f
or project de.erichseifert.gral:GRAL:jar:0.8: Failure to find de.erichseifert.ve
ctorgraphics2d:VectorGraphics2D:jar:0.6 in http://repo.maven.apache.org/maven2 w
as cached in the local repository, resolution will not be reattempted until the
update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException

我认为它正在尝试加载刚刚在 vectorgraphics2D 文件夹中构建的 jar - 但我不确定 wiki 说明是否缺少步骤,或者是否需要设置某些内容。

gral 的 pom.xml 具有以下作为其依赖关系的声明:

<dependencies>
        <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.8.1</version>
                <scope>test</scope>
                <optional>true</optional>
        </dependency>
        <dependency>
                <groupId>de.erichseifert.vectorgraphics2d</groupId>
                <artifactId>VectorGraphics2D</artifactId>
                <version>0.6</version>
        <optional>true</optional>
        </dependency>
  </dependencies>

请有人可以帮助我解决这个问题 - 这是我第一次体验 Maven!

4

2 回答 2

2

正如 siegl 在评论中所说,听起来您没有安装 VectorGraphics2D 0.6 版 - 如果您安装了,该 jar 应该已经出现在目录中~/.m2/repository/de/erichseifert/vectorgraphics2d/VectorGraphics2D/0.6。您也有一个目录的事实~/.m2/repository/de/erichseifert/vectorgraphics2d/VectorGraphics2D/0.9-SNAPSHOT听起来很可疑,这就是您构建和安装的目录。

maven 的 repo 很容易理解 - 目录只是由组和工件 ID 和版本组成。

以上是有道理的——你给出的指令告诉你构建 VectorGraphics2D 的主干,它可能不再是 0.6。

所以你有两个选择——要么在 gral pom 中将依赖项更改为 0.9-SNAPSHOT 并尝试链接到它,要么查看并构建 VectorGraphics2D 的 0.6 版本。我建议做后者,因为它更有可能按预期工作(0.9 中的 API 可能已经改变)。

http://trac.erichseifert.de/vectorgraphics2d/browser#tags看起来你想要:

rm vectorgraphics2d
svn co svn://erichseifert.de/vectorgraphics2d/tags/0.6 vectorgraphics2d

然后像以前一样继续。

于 2012-04-22T11:39:53.647 回答
1

关键是 GRAL 来自一个标签,这意味着它是一个稳定的版本。这意味着您需要将 mpqparser 和 vectorgraphics2d 的依赖关系更改为适当的版本(...-SNAPSHOT)并再次尝试...但在您需要先删除 .m2/repository/erichseifert/... 文件夹之前...

于 2012-04-22T09:39:23.070 回答