Stephan van Hulst wrote:
Adrian Cordoba wrote:This happens because MavenLibraryTest-1.0-SNAPSHOT.jar is not included inside the application's jar.
No, jars shouldn't ever be inside each other. In this case, your library jar should be in the same directory as your application jar. If you want your library to be in some other location, you should use <manifest><classpathPrefix> to specify the path that comes before all your classpath entries. I usually have ../lib/ as I distribute my application in MyApplication/bin and the referenced libraries in MyApplication/lib.
I don't have a quick tutorial. You can check out the Maven POM Reference, and work from there. For deploying applications, check out the Oracle tutorial on deployment.
Stephan van Hulst wrote:ItDoesntWorkIsUseless. Please tell us what you've done, what error message you get, and show us the content of the generated manifest. You see can see the manifest by opening the jar with an unzipper.
Stephan van Hulst wrote:Try:
If you have any other queries regarding the manifest, check out the link I posted earlier, there is a lot of useful documentation there.
Stephan van Hulst wrote:You shouldn't modify the effective POM. You should modify the real POM. If you overwrite the configuration section of the related plugin, it will also appear in the effective POM.
Stephan van Hulst wrote:Actually, you don't need <manifestEntries>, the maven archiver has a special element for that. So you could use this for your maven-jar-plugin configuration:
E Armitage wrote:You can use the maven-assembly-plugin to create the executable jar. See the last section of the docs here
Ulf Dittmer wrote:You seem to assume that lines 11 and 12 of the DecrementThread and IncrementThread are executed atomically, but they're not. It's perfectly possible (likely, in fact), that threads are switched between lines 11 and 12.
Decrement thread: value = 8385
Increment thread: value = 8388
Increment thread: value = 8385
Increment thread: value = 8386
Increment thread: value = 8387
Decrement thread: value = 8384
Increment thread: value = 8388
Decrement thread: value = 1989
Decrement thread: value = 1988
Decrement thread: value = 1987
Decrement thread: value = 1986
Increment thread: value = 1990
Decrement thread: value = 1985
Decrement thread: value = 1985
Decrement thread: value = 1984