当前位置: 首页 > 知识库问答 >
问题:

Maven:插件或其依赖项之一无法解析

袁轶
2023-03-14

我试图清理并构建一个在另一台pc上运行良好的项目。我可以通过浏览器访问maven仓库,但是我认为iDE不能在build(netbeans)上做同样的事情。以下是错误:

插件 org.apache.maven.plugins:maven-clee-plugin: 2.5或其依赖项之一无法解决:无法读取 org.apache.maven.plugins的工件描述符:maven-clee-plugin:jar:2.5:无法传输工件 org.apache.maven.plugins:maven-clee-plugin:pom:2.5 from/to Central(https://repo.maven.apache.org/maven2):没有到主机的路由:connect-

这是我的pom文件:

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.webproject</groupId>
    <artifactId>webproject</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>webproject</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <jsp.version>2.2</jsp.version>
        <log4j.version>1.2.17</log4j.version>
        <servletApi.version>3.0.1</servletApi.version>
        <jstl.version>1.2</jstl.version>
        <checkStyle.version>2.6</checkStyle.version>
        <h2database.version>1.4.191</h2database.version>
        <junit.version>4.11</junit.version>
        <thymeleaf.version>2.1.4.RELEASE</thymeleaf.version>
        <spring.version>4.3.4.RELEASE</spring.version>
        <springMvc.version>4.3.4.RELEASE</springMvc.version>
        <hibernateCore.version>4.3.4.Final</hibernateCore.version>
        <hibernateAnnotations.version>3.5.6-Final</hibernateAnnotations.version>
        <spring.security.version>4.2.0.RELEASE</spring.security.version>
        <hibernate.validator.version>4.2.0.Final</hibernate.validator.version>
    </properties>
    <dependencies>
        <!-- Java Mail API -->
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.3</version>
        </dependency>
        <!-- Spring Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring.security.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring.security.version}</version>
        </dependency>
        <!-- jsp api -->
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>${jsp.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- log4j -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
        </dependency>   
        <!-- Servlet api -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servletApi.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- JSTL -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>${jstl.version}</version>
        </dependency>
        <!-- CheckStyle -->
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>${checkStyle.version}</version>
        </dependency>
        <!-- h2Database -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>${h2database.version}</version>
        </dependency>
        <!-- Junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Thymeleaf -->
        <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf-spring4</artifactId>
            <version>${thymeleaf.version}</version>
        </dependency>

        <!-- Spring framework -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!-- Spring MVC framework -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${springMvc.version}</version>
        </dependency>
        <!-- hibernate core -->
        <dependency>
            <groupId>com.intersult</groupId>
            <artifactId>jpa-fix</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernateCore.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>${hibernateAnnotations.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${hibernate.validator.version}</version>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.3.0.M2</version>
                <configuration>
                    <stopPort>9966</stopPort>
                    <stopKey>jetty-stop</stopKey>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
        </plugins>

    </build>
</project>

共有1个答案

裴浩歌
2023-03-14

您可以尝试在pom.xml文件的build标记中添加以下代码

<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>3.1.0</version>
</plugin>

希望它对你有用!

 类似资料: