Create jar from pom

0

I have a project where when executing the mvn clean install command it creates the corresponding war of the project, but now I also need to have the jar of the project where the project is divided into different layers.

I have added the corresponding plugin to the pom

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>test-jar-no-fork</goal>
                    </goals>

                </execution>
            </executions>
        </plugin>

But when I run maven I can not create the jar, I also get the following notification by console:

  

--- maven-source-plugin: 3.0.1: test-jar-no-fork (attach-sources)   No sources in project. Archive not created.

It may be missing something define?

    
asked by Gustavo 25.11.2016 в 19:40
source

1 answer

0

To create the .jar of the project it is only necessary to execute the following:

$ mvn package
    
answered by 25.11.2016 в 20:26