maven - no main manifest attribute, in jar -
i trying run jar created maven shade plugin. configuring main class following way:
<project> ... <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-shade-plugin</artifactid> <version>2.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.manifestresourcetransformer"> <manifestentries> <main-class>org.comany.mainclass</main-class> <build-number>123</build-number> </manifestentries> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins>
...
but when try running jar using java -jar app.jar gives following error
"no main manifest attribute, in app.jar"
edit: checked contents of jar using jar tf app.jar , see manifest.mf file. not have entry main class. how make sure manifest file in jar has entry apart adding in shade plugin configuration?
don't forget add shade target:
mvn clean package shade:shade
Comments
Post a Comment