Running the example applications
This section explains how to setup the development environment to run the OSLC4J Bugzilla Adapter and the NinaCRM example application.
Environment Setup
Make sure your environment is set up for Lyo development as instructed on Eclipse Setup for Lyo-based Development. The tutorial requires JDK 8 to be used. The code may run on JDK 11 with the warnings, and certain parts may fail to run on JDK 17 as of 2022-05.
Bugzilla Setup
Unless you have a Bugzilla system (with admin access) you can integrate against, you need to setup a running Bugzilla system using Docker for the purposes of this tutorial.
Set up your Docker environment. This is beyond the scope of this tutorial. You should be able to use Rancher Desktop as well.
Launch the Bugzilla container that will be destroyed once you stop it:
docker run --rm -p 80:80 --name bugzilla-dev smarx008/bugzilla-dev-lyo
You can now browse to the Bugzilla homepage at http://localhost/bugzilla and use
admin:password
as admin credentials.
Importing the tutorial projects into Eclipse
The Lyo documentation Git repository contains the necessary code for this tutorial, while https://github.com/OSLC/lyo-adaptor-ninacrm contains the sample application, NinaCRM, which is used to demonstrate how a 3rd-party tool would integrate with a newly developed OSLC Server. The finished OSLC Server can be found under OSLC/lyo-adaptor-bugzilla
Clone the Lyo documentation Git repository
- In Eclipse, open the Git Repositories view. (Window → Show View → Other, search for
Git repo
and click OK.) - Click Clone a Git Repository.
- In the Clone Git Repository window, in the URI field paste the following https://github.com/eclipse/lyo.docs. The Host and Repository fields will autofill. Leave the Username and Password fields empty.
- Click Next.
- On the Branch Selection page, select master and click Next.
- For the Destination, select a folder for the files or accept the default of your Eclipse workspace.
- Click Finish.
lyo.docs
will appear in the Git Repositories view.
- In Eclipse, open the Git Repositories view. (Window → Show View → Other, search for
Next, import the tutorial projects into Eclipse
- In Eclipse, switch to the Java perspective. (Window → Perspective → Open Perspective → Java)
- Open the Project Explorer view. (Window → Show View → Project Explorer)
- Select File → Import...
- In the Import dialog that appears select Maven → Existing Maven Projects, and click Next.
- Browse to the root directory of the recently cloned git repository.
- Select the project ./lyo.docs/lyo-rest-workshop/Lab6 from the
lyo.docs
repo and click Finish. - Repeat the steps above for the ./lyo-adaptor-ninacrm project from the
lyo-adaptor-ninacrm
repo.
Configuring the Bugzilla adapter
Configure the Bugzilla adapter to point to your Bugzilla application.
- In the Project Explorer view, find and edit the file
src/main/resources/bugz.properties
in the Lab6 project. - Edit the
bugzilla_uri
property to the URL of your Bugzilla server. If you’re using the Bugzilla docker container, it will be:bugzilla_uri=http://localhost/bugzilla
- For the
admin
property, provide your Bugzilla user ID. - Save
bugz.properties
.
Update the applications
Update the project configurations for the projects.
In Eclipse, open the Package Explorer view. (Window → Show View → Package Explorer)
In the Package Explorer view, select the following packages:
- ninacrm
- oslc4j-bugzilla-sample-lab6
Right-click and select Maven → Update Project.
In the Update Maven Project window, verify that those projects are selected and click OK.
Running the sample applications
Starting the OSLC4J Bugzilla adapter:
- In the Package Explorer view, expand Lab6.
- Find the file pom.xml
- Right-click on pom.xml and select Run as → Maven Build....
- Enter jetty:run in the Goals field.
- Select Run
This will start the application. You will see a lot of messages in the Console view. The application will be running when you see this:
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.
In your web browser navigate to the OSLC Catalog at http://localhost:8080/OSLC4JBugzilla/services/catalog/singleton
Log in with your Bugzilla user ID and password.
Starting NinaCRM
- In the Package Explorer view, expand ninacrm.
- Find the file pom.xml
- Right-click on pom.xml and select Run as → Maven Build....
- Enter jetty:run in the Goals field.
- Select Run
This will start the application. You will see a lot of messages in the Console view. The application will be running when you see this:
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.
When the server starts, in your web browser navigate to http://localhost:8181/ninacrm to see the NinaCRM example.
Next: Part 1, turning Bugzilla into a provider of the Change Management OSLC specification