1

我使用的是 Eclipse Juno 4.2,而 maven Embedded 是 3.0.4。我不是 maven 专家,并尝试通过 Stackoverflow 帮助来解决问题。我猜自 maven 1 以来我一直在使用 maven 和 eclipse,现在必须将其转换为 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 进行构建,并且收到类似“无可用连接器”的错误,如下所示...

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

任何帮助表示赞赏。

4

0 回答 0