2

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

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
girh
  • 21
  • 1
  • 3

4 Answers4

3

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.

carlspring
  • 31,231
  • 29
  • 115
  • 197
2

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/

Prathap
  • 717
  • 2
  • 8
  • 25
1

Try mvn maven-one-plugin:convert

Stewart
  • 17,616
  • 8
  • 52
  • 80
0

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

Community
  • 1
  • 1
ant
  • 22,634
  • 36
  • 132
  • 182
  • I was able to resolve this..the plugin required some other files (like .pom) and dir structure (lib/org/apache....plugin.jar).Using proxy setting was able to download the plugins from net.However the one:convert plugin did not execute successfully. Got error [INFO] – girh Dec 28 '10 at 16:10
  • Trace org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-o ne-plugin:1.2:convert': Unable to load the mojo 'org.apache.maven.plugins:maven-one-plugin:1.2:convert' in the plugin 'org.apache.maven.plugi ns:maven-one-plugin'. A required class is missing: org/apache/maven/model/converter/ProjectConverterException at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:698) at org.apache.maven.lifec – girh Dec 28 '10 at 16:11