I have successfully built my Spring MVC project with mvn clean package
by following this tutorial.
Now I am trying to run the service with:
mvn clean package && java -jar target/gs-serving-web-content-0.1.0.jar
But I get this error:
Failed to load Main-Class manifest attribute from target/gs-serving-web-content-0.1.0.jar
Am I missing something?
If you are working with Spring Boot this will solve your problem:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.2.5.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
Reference Guide | Spring Boot Maven Plugin
You might be missing Spring Boot Maven Plugin.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With