maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TenLeftFingers <>
Subject Re: Build is successful but can't run?
Date Thu, 06 Feb 2014 12:10:19 GMT
I added the maven-assembly-plugin as described here:
now the dependencies are bundled within the jar. Thanks for your help
much to learn, but I'm learning quite a bit about Maven.

On Thu, Feb 6, 2014 at 11:28 AM, Jarlath Reidy <>wrote:

> Cancel that. It does exist. And more importantly it exists in the
> target/lib folder.
> On Thu, Feb 6, 2014 at 11:11 AM, Jarlath Reidy <>wrote:
>> I have just noticed that the dependency it complains about does not exist
>> in my .m2 folder. I don't know how Eclipse is executing this project but I
>> would have expected mvn package to pull in that dependency to the local
>> repository.
>> On Thu, Feb 6, 2014 at 10:02 AM, Jarlath Reidy <>wrote:
>>> "You should specify the fully qualified main class eg:
>>> in the mainClass field/parameter to the plugin."
>>> "1. the main-class-name was supposed to be your main class"
>>> Let me clarify. The entry appears in the manifest as:
>>> mainClass:
>>> instead of
>>> Main-Class:
>>> I've changed it in the pom (I thought that the tag was a fixed keyword
>>> so I didn't change it there initially).
>>> "The classpathPrefix line sets where to look for additional JAR files. It
>>> is relative to where you are."
>>> So relative to where I execute my java -jar ... command from. Okay, I
>>> have that. I'm executing from the directory above (..) the target.
>>> "Maven compiles and packages your program into a JAR. It copies all of
>>> the supporting JAR files listed in your dependencies into target/lib.
>>> Before you run, make sure that target/lib exists and has all of the JAR
>>> files you need."
>>> Yep, they're all there. Including the jar which contains the class it
>>> says it can't load and I can see that that class is present in the jar.
>>> "The exec plugin ( as Wayne
>>> has mentioned is another way to accomplish this. This will help you run
>>> from within an IDE or by using mvn exec:exec, but it won't help you
>>> package and ship your code out for other users."
>>> Once I get this running from the command line, this will be an option
>>> that I want to use. I'm still getting ClassNotFoundException though. I'm
>>> guessing that since I _can_ see the dependencies that this line must be the
>>> culprit:
>>> "<classpathPrefix>target/</classpathPrefix>"
>>> I'm going to try target/lib now.
>>> This is a sample client so packaging isn't too important at this point.
>>> Good to know, thank you.
>>> On Wed, Feb 5, 2014 at 10:17 PM, Wayne Fay [via Maven] <
>>>> wrote:
>>>> > *Failed to load Main-Class manifest attribute from target/myApp.jar*
>>>> >
>>>> > I opened the manifest and the *Main-Class* attribute was entered as
>>>> > *mainClass.* So I changed it to the former and that got rid of that
>>>> error.
>>>> > But now  I *still *get the original error.
>>>> You should specify the fully qualified main class eg:
>>>> in the mainClass field/parameter to the plugin.
>>>> Wayne
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5783328&i=0>
>>>> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5783328&i=1>
>>>> ------------------------------
>>>>  If you reply to this email, your message will be added to the
>>>> discussion below:
>>>>  To unsubscribe from Build is successful but can't run?, click here<>
>>>> .
>>>> NAML<>

View this message in context:
Sent from the Maven - Users mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message