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

pom.xml中的Maven.m2编译器错误

华昕
2023-03-14

我需要编译我的项目,但它在我的pom.xml中失败了。第一个错误是:

生命周期配置不包括的插件执行:org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile(执行:default-compile,phase:compile)

第二个:

生命周期配置不包括的插件执行:org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testcompile(执行:default-testCompile,phase:test-compile)

我在settings.xml中尝试了太多东西。

2)maven=>user Settings.指向apache maven 2.2.1的正确settings.xml。并且y删除了M2/Repository中的所有文件夹。

3)我尝试将maven离线,因为我有jar,所以我不需要使用存储库。

4)我尝试过update=>Maven prject=>force更新快照/发布,脱机和不脱机。这两种情况都没用。

6)我试着在pom.xml中添加这些插件,这些插件说明控制台错误,但也没用。

7)我的settings.xml代理标记正确

<proxies>
    <proxy>
        <active>?</active>
        <host>?</host>
        <port>?</port>

        <nonProxyHosts>?</nonProxyHosts>
    </proxy>
</proxies>

我不知道我还能做什么。请给我一个建议或信息。

<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

<!--    <parent> -->
<!--        <groupId>es.chx</groupId> -->
<!--        <artifactId>parent-pom</artifactId> -->
<!--        <version>2.0-SNAPSHOT</version> -->
<!--    </parent> -->

    <groupId>es.chx.gestionEnvios</groupId>
    <artifactId>gestionEnvios</artifactId>
    <version>1.0</version>
    <name>gestionEnvios</name>

    <properties>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <org.springframework-version>2.5</org.springframework-version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>es.chx</groupId>
            <artifactId>arq-chx</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

<!--        <dependency> -->
<!--            <groupId>es.chx.web</groupId> -->
<!--            <artifactId>loginLiferayFromApp</artifactId> -->
<!--            <version>1.0-SNAPSHOT</version> -->
<!--        </dependency> -->

<!--        <dependency> -->
<!--            <groupId>es.chx.web</groupId> -->
<!--            <artifactId>commonWeb</artifactId>  -->
<!--            <version>1.0-SNAPSHOT</version> -->
<!--        </dependency> -->

<!-- -->        <dependency> 
<!-- -->            <groupId>es.chx.intranet</groupId> 
<!--  -->           <artifactId>commonIntranet</artifactId>
<!-- -->            <version>1.0</version> 
<!-- -->        </dependency> 

        <dependency>
            <groupId>displaytag</groupId>
            <artifactId>displaytag-doc</artifactId>
            <version>1.2</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>displaytag</groupId>
            <artifactId>displaytag</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>displaytag</groupId>
            <artifactId>displaytag-export-poi</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>

        <dependency>
            <groupId>org.ajaxtags</groupId>
            <artifactId>ajaxtags</artifactId>
            <version>1.3-beta-rc7</version>
        </dependency>

        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <version>2.2.3</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib-ext-spring</artifactId>
            <version>1.0.2</version>
        </dependency>

        <dependency>
            <groupId>es.chx.web</groupId>
            <artifactId>dwr</artifactId>
            <version>3.0</version>
        </dependency>

        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>2.2.2</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>

        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.2.0.Final</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
        </dependency>

        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
            <version>1.4.0</version>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.2.2</version>
        </dependency>

        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc14</artifactId>
            <version>10.2.0.2.0</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>2.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
            <version>1.3</version>
        </dependency>

    </dependencies>

    <repositories>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>nexus-chrono</id>
            <url>http://192.168.241.125:8081/nexus/content/groups/public/</url>
        </repository>
        <repository>
            <id>apache.snapshots</id>
            <name>Maven Plugin Snapshots</name>
            <url>http://repository.apache.org/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration></configuration>
            </plugin>

            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                    </additionalBuildcommands>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

生命周期配置不包括的插件执行:org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile(执行:default-testcompile,phase:test-compile)

共有1个答案

莘欣怿
2023-03-14

我想我已经解决了。最后我安装了STS(Spring Tools Suite),里面有M2E的最新插件。错误不再存在。然而,ive得到了其他错误,但它们来自我的存储库的权利。所以...解决方案是将STS作为IDE安装在我的计算机中。

 类似资料:
  • 我试图在pom.xml中将项目源和目标设置为Java1.8,结果发现这两种方法都可以: > 在属性标记中设置: 在插件中配置: 给我一个选择,我更喜欢选项1,因为它更短,但这两个之间的真正区别是什么?

  • 正如标题所强调的,我在Ubuntu的Java编译器方面遇到了麻烦。我重新安装了操作系统。几个月前,在卸载Ubuntu之前,Eclipse的Java编译器就像一个魅力一样工作。我按照同样的步骤...: 安装OpenJDK Java 7 Runtime(Ubuntu上最新的官方JDK,我以前使用过); 安装最新版本的Eclipse; 从我的主文件夹、我的文档、桌面、单独的HDD和单独的分区运行它...

  • 问题内容: 我在netbeans上编写了一个Maven代码,大约有2000多行。当我在netbeans上编译它时,一切都很好,但是如果我想在命令行上运行它,则会出现以下错误: 我尝试使用Java 1.3.1,编译器错误,但出现了更多错误。我从其他帖子中发现我应该修改pom.xml,但我不知道如何。这是我的pom.xml 如果您能帮助我,那就太好了。 问题答案: 请参阅配置页面以获取Maven编译器

  • 我用Netbeans编写了一些Maven代码,大约有2000多行。当我在Netbeans上编译它时,一切都很好,但如果我想在命令行上运行它,我会得到这些错误: 我尝试使用Java 1.3.1,编译器错误,但我得到更多的错误。我从其他帖子中发现我应该修改,但我不知道如何修改。下面是我的 如果你能帮我就太好了!

  • 问题内容: 以下代码块在1.8.11中可以正常编译,但在1.8.20中会引发错误 我得到的错误是java:找不到适合过滤器的方法(com.google.common.base.Predicate) 在更新8和20之间是否存在会影响此代码的更改?我在两种情况下都使用相同版本的guava 17.0(最新版本),唯一的变化是Java中的更新版本。 任何帮助是极大的赞赏。 编辑 显示错误的行是 问题答案: