IntelliJ, Maven and Spring to try to generate a Runnable jar

1

First of all, thank you very much for the help. I comment, I'm starting to use this programming environment, but I have problems to generate the Jar and run my program out of the environment. I explain, the program works when I run the class with the main as follows:

Of course when I try to generate the jar, it does not work. I think what's wrong is how I'm doing or running the maven commands or how I'm configuring the Pom. I show you my program structure is as follows:

I commented to you my main program is in NoticiasApp and I am trying to compile it with Maven and the IntelliJ interface. I do the mvn install, package, etc and the resulting jar of the process does not work.

Apart from that, I enclose a little information about my pom.

 <build>
    <finalName>NoticiasApp</finalName>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <configuration>
                <mainClass>NoticiasApp</mainClass>
            </configuration>
        </plugin>
<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.12.4</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>appassembler-maven-plugin</artifactId>
            <version>1.2.2</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>assemble</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <programs>
                    <program>
                        <mainClass>NoticiasApp</mainClass>
                        <name>NoticiasApp</name>
                    </program>
                </programs>
            </configuration>
        </plugin>
    </plugins>
</build>
    
asked by user3547469 27.01.2017 в 12:14
source

0 answers