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:

<dependency>

<groupId>com.blah</groupId>

<artifactId>jpa-data-access</artifactId>

<version>1.0</version>

<scope>test</scope>

</dependency>

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 Join to answer
Community showcase
Renan Battaglin
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,066 views 0 5
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot