Maven build succeeded but when I trying to run it fails with:
Error: Could not find or load main class app.jar
I have in resources/META-INF/MANIFEST.MF
with
Manifest-Version: 1.0
Main-Class: go.Application
All seems in place. What's wrong?
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
UPDATE1
Same story when building jar artifact with IntelliJ.
UPDATE2
OK, I managed to run it but now I have :
Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
UPDATE3
Got it working by adding to Application.java:
@Bean
public EmbeddedServletContainerFactory servletContainer() {
TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
return factory;
}