2

我正在尝试将 maven1 project.xml 转换为 maven 2 pom.xml。

maven one:convert 插件将 project.xml 转换为 pom.xml。

试过步骤

  • 安装的maven 2
  • cd project-dir (里面有我的 project.xml)
  • mvn -e 一:转换

maven-one-plugin-1.2.jar$MAVEN_HOME/lib

Settings.xml具有以下本地存储库设置

<localRepository>path_to_mavenhome/lib</localRepository>
<offline>true</offline>
<pluginGroups>
    <pluginGroup>org.apache.maven.plugins:maven-one-plugin</pluginGroup>
</pluginGroups>
<profile>
    <id>central</id>
    <repositories>
        <repository>
            <id>local</id>
            <url>file://pathtomavenhome\lib</url>
            <layout>default</layout>
        </repository>
    </repositories>
</profile>

收到此错误消息

[INFO] Searching repository for plugin with prefix: 'one'.
[INFO] org.apache.maven.plugins:maven-one-plugin: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins:maven-one-plugin' could not be retrieved from repository: central due to an error: Error transferring file: Connection timed out: connect
[INFO] Repository 'central' will be blackliste

d

它不连接到本地存储库。目录中没有Settings.xml文件$M2_HOME/.m2

4

4 回答 4

3

我不认为你需要在settings.xml这里。从您的主目录中删除它并尝试:

mvn one:convert

这应该绰绰有余。

如果您处于离线状态,则无法使用此功能,除非您的本地存储库中已经有 Maven one 插件。您的 settings.xml 不太正确,目前使您的任务过于复杂。

于 2011-07-05T07:47:53.763 回答
2

你的步骤是正确的。

该错误表明您的互联网有问题。请验证网络可用性。

[警告] 存储库元数据:'org.apache.maven.plugins:maven-one-plugin' 无法从存储库中检索:中央由于错误:传输文件时出错:连接超时:连接

按照此链接供您参考 1. http://maven.apache.org/guides/mini/guide-m1-m2.html 2. http://maven.apache.org/plugins/maven-one-plugin/

于 2012-05-09T11:00:24.833 回答
1

尝试mvn maven-one-plugin:convert

于 2011-09-27T23:11:51.990 回答
0

只需创建新的 Settings.xml,在此处查看此示例Sample settings.xml for maven它通常位于您的用户目录中的某个位置,名为 .m2 的隐藏文件夹

于 2010-12-28T10:00:34.267 回答