Maven package task not finding code in previously installed .jar

First, this works locally on my command line. This is an extension to a previous question that went unanswered.

Here is what my tasks look like:

1. mvn package the jar.

2. mvn install the jar.

3. mvn package the war.

the package step fails due to compilation errors not finding classes that are in the jar.

Is my approach using 3 tasks wrong?

I did try separating this into 2 stages and having the .jar added as an artifact but I don't think that this is necessary. Since tasks execute serially, the jar should be in the bamboo mvn repo when the war is compiled.

2 answers

1 accepted

I had two issues. first, the install step was extranneous so i combined steps 1 and 2. I now do:

mvn install the .jar.

mvn package the .war.

The second problem i had was in the pom (i never showed it here). I had:







Removing the test scope and leaving it to default resolved the issue.

Does anybody from Atlassian read these? What I am trying to do doesn't seem all that out of the ordinary but i have not found an example. I am putting a data model in a jar and then building the jar into a war. Seems commonplace. The war packaging simply cannot find the .jar previously built and installed.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,821 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you