cancel
Showing results for 
Search instead for 
Did you mean: 

SDK 2.1 - Including Third Party JAR Libraries

sarah_jordison
Champ in-the-making
Champ in-the-making
Hi Folks,

I know this is going to be a silly fix and probably staring me right in the face. However, I have recently moved to the Alfresco 2.1 SDK, from ANT and am deploying new projects on Alfresco 5.0.d. I have installed and setup the all-in-one (aio) archetype using maven and all is working great (very nice project btw). RAD is working just fine (did have to change the maven filters to ignore JS and CSS), but cannot seem to figure out where to put my external JARs for importing into my Java classes.

In ANT I used to put them in a folder called "projects/third_party/lib", add them to my classpath, and then it would be exported with the project. In my maven project (using SDK 2.1), I add the external libraries to my classpath and it complies my Alfresco classes, picking up the imports. However, maven does not build and as you can see in the attachment, complains about not being exported.

My question is: how do I configure my project so that it will export the JARs with my AMP/build, is there a specific place I should be adding them?

Also, why does the all-in-one default archetype give me that server.xml error? Everything seems to work with it, but it is rather annoying Smiley Happy

Thanks for any help on this!

- Sarah
2 REPLIES 2

hardik1512
Star Contributor
Star Contributor
Hello Sarah,

You can try placing JARs at path src/main/amp/lib and then giving dependency in pom.xml as below

<dependency>
   <groupId>com.abc</groupId>
   <artifactId>xyz</artifactId>
   <scope>system</scope>
   <version>1.0</version>
   <systemPath>${project.basedir}/src/main/amp/lib/your-jar.jar</systemPath>
</dependency>

I see now, you need to add the dependency in maven. I'm new to maven, so this makes sense.

Thanks for your help!