Maven 设置.xml

发布于 2024-10-09 13:54:34 字数 1475 浏览 0 评论 0原文

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

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

尝试了以下步骤

  • Installed maven 2
  • cd project-dir (which has my project.xml)
  • mvn -e one:convert

我在 $MAVEN_HOME/lib 中有 maven-one-plugin-1.2.jar

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

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

I am trying to convert maven1 project.xml to maven 2 pom.xml.

maven one:convert plugin converts project.xml to pom.xml.

Tried the steps

  • Installed maven 2
  • cd project-dir (which has my project.xml)
  • mvn -e one:convert

I had maven-one-plugin-1.2.jar in $MAVEN_HOME/lib

Settings.xml had the following local repository settings

<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>

Got this error message

[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

It does not connect to local repository.
No Settings.xml file in $M2_HOME/.m2 dir

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

孤独难免 2024-10-16 13:54:34

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

mvn one:convert

这应该足够了。

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

I don't see the need for you to have a settings.xml here. Remove it from your home directory and try:

mvn one:convert

This should be more than sufficient.

If you're offline, there is no way for this to work, unless you already have the Maven one plugin in your local repository. Your settings.xml is not quite right and over-complicates your task at the moment.

雨落□心尘 2024-10-16 13:54:34

你的步骤是正确的。

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

<块引用>

[警告] 由于错误,无法从存储库检索“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/

Your steps are correct.

The error indicates that you have problem with your internet. Please verify the network availability.

[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

Follow this links to for your reference
1. http://maven.apache.org/guides/mini/guide-m1-m2.html
2. http://maven.apache.org/plugins/maven-one-plugin/

舞袖。长 2024-10-16 13:54:34

尝试 mvn maven-one-plugin:convert

Try mvn maven-one-plugin:convert

醉生梦死 2024-10-16 13:54:34

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

Just create new Settings.xml, check this example here Sample settings.xml for maven its usually located somewhere in your user dir, hidden folder called .m2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文