如何使用调试-X

问题描述

如果我尝试清理并生成没有错误,则尝试运行该项目时,我会遇到构建失败。

我必须在哪里添加-X-e参数,以查看问题出在哪里?我的POM没有定义任何插件

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time:  1.839 s
Finished at: 2020-08-27T10:54:32-03:00
 ------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project validadorCliente: Command execution Failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors,re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com</groupId>
    <artifactId>validadorCliente</artifactId>
    <version>1</version>
    <packaging>jar</packaging>
    <build>
        <resources>
            <resource>
                <targetPath>meta-inf</targetPath>
                <directory>src</directory>
                <includes>
                    <include>jax-ws-catalog.xml</include>
                    <include>wsdl/**</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.jvnet.jax-ws-commons</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <wsdlFiles>
                                <wsdlFile>localhost_8080/saos-validador/Validador310Service.wsdl</wsdlFile>
                            </wsdlFiles>
                            <packageName></packageName>
                            <vmArgs>
                                <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
                            </vmArgs>
                            <wsdlLocation>http://localhost:8080/saos-validador/Validador310Service?wsdl</wsdlLocation>
                            <staleFile>${project.build.directory}/jaxws/stale/Validador310Service.stale</staleFile>
                        </configuration>
                        <id>wsimport-generate-Validador310Service</id>
                        <phase>generate-sources</phase>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>javax.xml</groupId>
                        <artifactId>webservices-api</artifactId>
                        <version>2.0</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
                    <xnocompile>true</xnocompile>
                    <verbose>true</verbose>
                    <extension>true</extension>
                    <catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org</groupId>
            <artifactId>SAOS-backend</artifactId>
            <version>1</version>
        </dependency>
        <dependency>
            <groupId>com.toedter</groupId>
            <artifactId>jcalendar</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>org.swinglabs.swingx</groupId>
            <artifactId>swingx-all</artifactId>
            <version>1.6.5</version>
        </dependency>
        <dependency>
            <groupId>org.hotswapagent</groupId>
            <artifactId>hotswap-agent</artifactId>
            <version>1.3.0</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-spring-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-wildfly-el-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-tomcat-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-mojarra-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-jbossmodules-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-jersey1-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-jersey2-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-myfaces-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-owb-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-resteasy-registry-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-omnifaces-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-jetty-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-weld-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-zk-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-seam-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hotswapagent</groupId>
                    <artifactId>hotswap-agent-deltaspike-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.inject</groupId>
                    <artifactId>javax.inject</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    <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>
    </properties>
</project>

解决方法

问题出在org.codehaus.mojo:exec-maven-plugin

  1. 请确保使用最新版本的插件(我认为是3.0.0)
  2. 签出Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli)
,

在“属性”>“操作”> 执行目标-e -X

如果要通过Maven进行操作:mvn -e -X "-Dexec.args= ....."

PD:我的问题与IDE或Maven无关,我有NPE,却忽略了该异常

 public static void main(String[] args) {
    try {
        MainView vista = new MainView(null,true);
        vista.setVisible(true);
    } catch (Exception ex) {
        //ex.printStackTrace(); <--- HERE WAS THE PROBLEM
        System.exit(1);
    }
}

感谢Onur和Giorgi的时间