Maven 设置.xml
我正在尝试将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为您不需要在这里拥有
settings.xml
。将其从您的主目录中删除并尝试:这应该足够了。
如果您处于离线状态,则无法执行此操作,除非您的本地存储库中已经有 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: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.
你的步骤是正确的。
该错误表明您的互联网有问题。请验证网络可用性。
请点击此链接以获取您的信息参考
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.
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/
尝试 mvn maven-one-plugin:convert
Try
mvn maven-one-plugin:convert
只需创建新的 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