是否有一种简单的方法将maven 1转换为maven 3

时间:2012-07-07 23:14:06

标签: maven-3 eclipse-juno

我正在使用Eclipse Juno 4.2,maven Embedded是3.0.4。我不是maven的专家,并试图通过Stackoverflow帮助解决问题。我一直在使用maven与eclipse,因为maven 1我猜,现在必须将它转换为maven 3才能使它工作。我使用maven-one-plugin尝试转换。我跑'mvn one:converter'并且收到了这个错误...

[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to      Central (http://repo1.maven.org/): No connector available to access repository Central  (http://repo1.maven.org/) of type  using the available factories  WagonRepositoryConnectorFactory
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to Central (http://repo1.maven.org/): No connector available to access repository Central (http://repo1.maven.org/) of type  using the available factories WagonRepositoryConnectorFactory
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.917s
[INFO] Finished at: Sat Jul 07 18:51:30 EDT 2012
[INFO] Final Memory: 5M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'one' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/Dev/.m2/repository), Central (http://repo1.maven.org/), ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2)] -> [Help 1]
[ERROR]

我认为主要问题是“没有连接器可用”警告的一部分导致所有这些。我尝试使用Eclipse Juno上的mvn:install进行构建,并且因为“No Connector available”出现类似的错误,如下所示......

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project Belfast: Unable to generate classpath: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information for org.apache.maven.surefire:surefire-junit3:jar:2.10: Failed to retrieve POM for org.apache.maven.surefire:surefire-junit3:jar:2.10: Could not transfer artifact org.apache.maven.surefire:surefire-junit3:pom:2.10 from/to Central (http://repo1.maven.org/): No connector available to access repository Central (http://repo1.maven.org/) of type  using the available factories AsyncRepositoryConnectorFactory, WagonRepositoryConnectorFactory
[ERROR] org.apache.maven.surefire:surefire-junit3:jar:2.10

我到底错过了什么?是否需要Maven 3的一些连接器,我在POM上没有? 我的POM如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>MYProj</groupId>
    <artifactId>MYProj</artifactId>
<packaging>war</packaging>
<version>1.0.1</version>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>1.3.1</version>
            <configuration>
                <includesList>com.mysite</includesList>
                <generateBackupPoms>false</generateBackupPoms>
                <allowSnapshots>true</allowSnapshots>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.bluestemsoftware.open.maven.plugin</groupId>
            <artifactId>release-plugin</artifactId>
            <version>1.0.0.2</version>
            <configuration></configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <warSourceExcludes> **/.svn/** </warSourceExcludes>
            </configuration>
        </plugin>
    </plugins>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>
</build>
<repositories>
    <repository>
        <id>maven2</id>
        <url>http://repo1.maven.org/maven2</url>
    </repository>
</repositories>
<pluginRepositories>
</pluginRepositories>
<dependencies>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts-core</artifactId>
        <version>1.3.10</version>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts-tiles</artifactId>
        <version>1.3.10</version>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts-taglib</artifactId>
        <version>1.3.10</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.9</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk</artifactId>
        <version>[1.3.3,)</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.13</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate</artifactId>
        <version>3.2.7.ga</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-c3p0</artifactId>
        <version>3.3.2.GA</version>
    </dependency>
    <dependency>
        <groupId>org.imgscalr</groupId>
        <artifactId>imgscalr-lib</artifactId>
        <version>4.2</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.mortennobel</groupId>
        <artifactId>java-image-scaling</artifactId>
        <version>0.8.5</version>
    </dependency>
    <dependency>
        <groupId>com.drewnoakes</groupId>
        <artifactId>metadata-extractor</artifactId>
        <version>2.4.0-beta-1</version>
    </dependency>
    <dependency>
        <groupId>com.sun.mail</groupId>
        <artifactId>javax.mail</artifactId>
        <version>1.4.4</version>
    </dependency>
    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.2-beta1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.2-beta1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.2-beta1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.tika</groupId>
        <artifactId>tika-core</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.9.4</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.4</version>
    </dependency>
</dependencies>

感谢任何帮助。

0 个答案:

没有答案