Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no main manifest in jars #67

Closed
techmaurice opened this issue Jun 29, 2013 · 4 comments
Closed

no main manifest in jars #67

techmaurice opened this issue Jun 29, 2013 · 4 comments
Labels

Comments

@techmaurice
Copy link

After compiling the maven file in the root of the project on Windows XP, all jars fail to run, exiting with the message 'no main manifest attribute'.

Tried compiling with both mvn clean install and mvn clean package.

@peshkira
Copy link
Owner

Maven is a build system. mvn clean package/install is not supposed to
create runnable jars.

Please read the guide and use mvn assembly:assembly.

cheers


Please excuse if short or if it does not make any sense. Sent via my phone

On 29.06.2013, at 17:22, Maurice de Rooij notifications@github.com wrote:

After compiling the maven file in the root of the project on Windows XP,
all jars fail to run, exiting with the message 'no main manifest attribute'.

Tried compiling with both mvn clean install and mvn clean package.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/67
.

@techmaurice
Copy link
Author

Your dev guide tells to use mvn clean install
https://github.com/peshkira/c3po/wiki/Development-Guide

Additionally, isn't maven supposed to do just that, building runnable jars using maven-jar-plugin without additional assembly:assembly?

@peshkira
Copy link
Owner

The dev guide states both things - how to build and how to create an executable jar.
Building just compiles the resources into jars that are suitable as dependencies for other projects. Runnable jars should be created in another fashion.
From the link above:

"In order to package the command line app into an executable jar, navigate to the cmd project and run mvn
assembly:assembly. This will create a jar with dependencies in the target folder. Just run it with java -jar c3po-0.4.0-jar-with-dependencies.jar and you will get some usage info."

Also, no. Maven is not supposed to do just that. As I said maven is a build system and is supposed to generate packages that can be resolved automatically and used by other developers in their projects. The maven jar plugin is just one of many plugins that extends the core functionality of maven and allows you create different jars with more complex structures - so does the maven assembly plugin, which I use.

If you read the maven lifecycle here: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html,
you will see that install, for example, is supposed to create a package and put it in your local repository. If you use deploy, you can deploy the packages to maven central or bintray or other similar sites.

@peshkira
Copy link
Owner

I am closing this issue now.
INVALID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants