Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Maven package task not finding code in previously installed .jar

Jason Thiel August 1, 2013

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

0 votes
Answer accepted
Jason Thiel August 7, 2013

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.

0 votes
Jason Thiel August 6, 2013

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
TAGS
AUG Leaders

Atlassian Community Events