I have created an application using the Liberty boilerplate. I have added GIT to create and populate repository for the app. I need to add an additional .jar file to my application. However, when I go to the GIT repository and look at the files structure I don't see the WEB-INF directory.
How can I add .jar files to my project so that the files end up in the WEB-INF/lib directory of my application?
Please advice.
Yes, you are right, the structure of the app repository has changed as it seems that the build has been changed from ant to maven based. If you want to add a jar to the standard java web app structure which expects the jar to be located in the WEB-INF/lib folder you need to define a dependency which will point to the jar. All maven dependencies need to come from a repository so before you can define a dependency for your jar you need to declare a local repository which holds the jar. Here are steps you can follow:
In the pom.xml file add the following:
<repositories>
<repository>
<id>ProjectRepo</id>
<name>ProjectRepo</name>
<url>file://${project.basedir}/repo</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.mycomp.myproject</groupId>
<artifactId>thejar</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.mycomp.myproject</groupId>
<artifactId>thejar</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
Commit and push the changes. Your should see in the war WEB-INF/lib/thejar.jar I hope it helps. Please let me know how does it work for you. Good luck. Kris