简体   繁体   中英

maven 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

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.

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/

试试mvn maven-one-plugin:convert

只需创建新的Settings.xml,在此处查看此示例,即可查看示例settings.xml的Maven,它通常位于用户目录中的某个隐藏文件夹(称为.m2)中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM