0

I am getting a BUILD FAILURE when I try to run the project, if I do a clean and build there is no error.

Where do I have to add this -X or -e parameter to see where is the problem? My POM doesn't have any plugin defined.

------------------------------------------------------------------------
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>
FiruzzZ
  • 661
  • 1
  • 6
  • 21
  • `mvn clean package -X` is how you provide `-X` flag. Can you provide your pom.xml? – Giorgi Tsiklauri Aug 27 '20 at 13:55
  • but that command just build it, there is no error building, the problem is when I try to RUN it – FiruzzZ Aug 27 '20 at 14:00
  • You have some custom dependencies which I can't have in my project. Like SAOS-Backend. – Giorgi Tsiklauri Aug 27 '20 at 14:04
  • yes, that is the backend, where most @entity and DAO are, this project of for testing a Webservice `saos-validador` like you can see too. I just want to know where do I have to add IN netbeans the `-X` – FiruzzZ Aug 27 '20 at 14:07
  • Ah. you don't have build problems? but you were asking for `-X` and `-e` flags and said initially, that you were getting a *Build Problem*. Please edit your question and specify what exactly is a problem. – Giorgi Tsiklauri Aug 27 '20 at 14:09
  • yes, but even if it's not, the project works, the status of the WS is part of the testing to check – FiruzzZ Aug 27 '20 at 14:14

2 Answers2

0

The problem is with the org.codehaus.mojo:exec-maven-plugin

  1. Be sure that you use the latest version of the plugin (3.0.0 I think)
  2. Check out Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli)
Onur Baştürk
  • 715
  • 5
  • 15
  • I tried that but got another exception, `Command execution failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404) at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)` .... .... `BUILD FAILURE Total time: 2.896 s Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project validadorCliente: Command execution failed.: ` – FiruzzZ Aug 27 '20 at 19:27
  • Why do you use that plugin? Is it required? – Onur Baştürk Aug 27 '20 at 19:54
  • It is how Netbeans runs every Maven java SE desktop app – FiruzzZ Aug 27 '20 at 21:29
  • Ok, I see. Check out these solutions https://stackoverflow.com/questions/20077870/maven-wont-run-my-project-failed-to-execute-goal-org-codehaus-mojoexec-maven – Onur Baştürk Aug 28 '20 at 05:47
  • thanks, but I know that post, I gave some comments in the most voted answer a year ago ;), in those comments I mention how to change the plugin version, because every release of Netbeans update it by default and give some problems (that's why I still use 1.2.1, because always worked for me until now) – FiruzzZ Aug 28 '20 at 11:26
  • I see. I'm using IntelliJ IDEA and never having build or run problems related with IDE. I was using NetBeans before, still using for databases. But for development I think IntelliJ is the best. However I will check out with one of my JavaFX projects! What's your Netbeans version? – Onur Baştürk Aug 28 '20 at 12:02
  • 1
    the latest 12.0, I created a new project, the problem is when I create the WS Client, 2 of 4 ways that NB gives to create those throws a weird exception and after the WSDL and jaxws generated source is created the project doesn't RUN any more, but I can't see what it is failing, that's why I wanted to know where to add the `-X`. I will give it a try to IntellJ – FiruzzZ Aug 28 '20 at 16:31
  • Well I installed Netbeans 12 and tried one of its own demo projects DVDStoreAdmin (Maven+Swing+Hibernate). It doesn't even build because of very old library versions etc. But the most important thing is that I see that there is an nbactions.xml file which runs those goals. Then I created a new Swing app from a maven archetype (org.codehaus.griffon) which doesn't have that nbactions.xml file. And it runs without any error. Did you try to delete that nbactions.xml or remove those goals from your run configuration? – Onur Baştürk Aug 29 '20 at 09:02
  • Another solution: add that -X to the nbactions.xml as shown in https://www.mojohaus.org/exec-maven-plugin/usage.html – Onur Baştürk Aug 29 '20 at 09:09
  • tried to add in nbactions.xml `-X ...` but I got **The -X options are non-standard and subject to change without notice** so I removed the file, I am still trying to define a Goal in the POM to run the project but notice that I wouldn't be able to use the debugger from the IDE this way – FiruzzZ Aug 31 '20 at 13:42
  • finally could ran with -e -X but nothing useful came up [log](https://snipboard.io/yXR9cQ.jpg) – FiruzzZ Sep 01 '20 at 02:06
0

In Properties > Actions > in the field Execute goals: -e -X

If you want to do it through Maven: mvn -e -X "-Dexec.args= ....."

PD: My problem had nothing to do with the IDE or Maven, I have a NPE and I was ignoring the exception

 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);
    }
}

thank you Onur and Giorgi for your time

FiruzzZ
  • 661
  • 1
  • 6
  • 21