Looking for information about developer tools to use with WebSphere Liberty? Start here…
As developers we hold the tools we use near and dear to our hearts. The debugger is one of my most essential tools, and my use of Eclipse goes back to VisualAge (yikes) for its debugger! We believe that the Liberty ecosystem of tools that you use to create and build your applications is as important as the server itself.
This article discusses some of the tools you can use with Liberty. We would love to hear what other tools you are using that are crucial to your development experience.
WebSphere Developer Tools
The WebSphere Developer Tools (WDT) are lightweight tools, running in Eclipse, for developing, assembling, and deploying applications to WebSphere Application Server Liberty and traditional servers. You can download Eclipse and WDT for free. WDT can help you develop many applications types:
- Enterprise applications
- Web applications
- Apache Maven projects
- Gradle projects
- Web service applications
- OSGi applications
The power of WDT shines during development with:
- Control over the Liberty server with support for start, stop, debug, view logs, and more
- Incremental application publishing with minimal restarts so that you can write and test your changes locally without having to go through a build/publish cycle or restart the server
- Debug support so that you can easily step through your applications
- Content-assist for server configuration. Server configuration is minimal, but the tools help you find what you need and identify finger-checks, etc
The Liberty Maven plug-in (ci.maven) provides goals for managing a Liberty runtime within a Maven project. Our most common use cases focus on Maven projects using the
liberty-assembly packaging types. In the latest versions (2.0 and later) of the Liberty Maven plug-in, we focus on simplifying POMs, improving WDT integration, and improving the overall experience.
We also made significant updates to the latest versions of WDT and the Liberty Maven plug-in to improve your WDT experience when working with Liberty servers managed by the Liberty Maven plug-in. Be sure to grab the latest versions of WDT and the
liberty-maven-plug-in. When your Maven web and ear application project installs a Liberty server, the Eclipse tools can automatically recognize and add the server and runtime to the workbench for easier server interactions.
WAR and EAR projects
For Maven WAR and EAR projects, you can do things like build your Liberty server within the target of the project, install Liberty features, install your application as an archive file or as a loose application (more on that later), and create a server archive ready for deployment. Using the
ear packaging types, your archive file is deployed to the local Maven repository and is available to other projects as a dependency.
Liberty assembly projects
You can do similar things when using the
liberty-assembly packaging type. You typically install the Liberty server, install additional features if needed, install application EAR or WAR files from other dependent projects, and create a server package that is installed to your local Maven repository. You can also include application code in a liberty-assembly project if you want. Starting in the Version 2.0 release of the plug-in, we have bound more goals to the default lifecycle for liberty-assembly projects.
One of the most significant improvements to the Liberty Maven 2.0 plug-in is loose applications WAR support. Loose application EAR support came in version 2.1. While developing your application, you can install it as a loose application so that you don’t have to constantly repackage the archive file. Instead, you simply re-compile your code or update files, and your running application is updated! When you are using WDT and your files are automatically compiled, you just change the Java source and your application is updated. From the command line, a simple
mvn compile gets the job done. Check out the
looseApplication parameter for the
In addition to loose application support we have also added:
- The ability to copy a configuration directory rather than one file which is useful if you are using included configuration files.
test-stop-servergoals that honor common skip test mechanisms.
- The ability to easily update your Liberty license to a production license.
liberty-archetype-webapparchetype to create a new sample web project.
liberty-archetype-eararchetype to create a new sample ear project.
liberty-maven-app-parentparent POM that binds commonly used
liberty-maven-plugingoals to the default lifecycle.
liberty-assemblyautomatically binds more goals to simplify your POM.
Also, many of the samples in https://github.com/WASdev/ already use version 2.0 or 2.1 of the
liberty-maven-plugin. Some examples use the parent POM and illustrate POM simplification using the parent. Others include the needed bindings directly in the project POM.
Get the latest Liberty Maven Plug-in release from the Maven central repository.
The ci.gradle project provides a Liberty Gradle plug-in with tasks for managing Liberty servers and applications. We have added significant functional improvements to the Gradle plug-in as well as WDT integration support. If Gradle is your build tool of choice, you can use this plug-in manage to your environment with tasks like:
- Install the Liberty runtime with options to update your license
- Install and uninstall Liberty features to the runtime
- Create Liberty servers with improved configuration options
- Start, stop, run, package, dump, debug, check status for Liberty servers
- Install application support for loose applications or archive files with the flexibility to install to the apps or dropping folders. The server can be stopped or started for this task.
- Deploy and undeploy applications to a running server
- Clean the server to remove logs, apps, and workarea files
- Package the Liberty server as an archive file
- Pre-compile JSP files from the src/main/webapp directory into the build/classes directory.
Most of the new capability previously added to the Maven plug-in is now available in the Gradle plug-in. Also, Gradle support was added to many of the samples in https://github.com/WASdev/ so you can build them using Maven or Cradle.
Get the latest Liberty Gradle Plug-in release from the Maven central repository.
The ci.ant project provides a collection of Ant tasks for managing WebSphere Application Server Liberty servers and applications. If you are writing Ant scripts, use this resource to manage Liberty. You can:
- Install a Liberty runtime
- Install and uninstall Liberty features to the runtime
- Issue Liberty server commands such as create, start, run, stop, package and more.
- Deploy and undeploy applications to a running server.
- Clean the server to remove logs, apps, and workarea files.
- Compile JSP files
Most of these ant tasks provide access to their equivalent Liberty command line functions. The Maven plug-in uses these tasks and adds more smarts derived from the Maven project structure and liberty-maven-plugin goals. The Gradle plug-in provides a wrapper to these Ant tasks.
Check out our downloads, videos, and additional information, and let us know how we can help.
Ask a question on Stack Overflow or on one of our Git repositories.
Downloads and Resources
- WebSphere Developer Tools downloads
- WebSphere Developer Tools for Eclipse Knowledge Center
- https://github.com/WASdev/ – A collection of samples to help you learn more about Liberty. It is also home of the following Git repositories including their documentation:
- Liberty app accelerator – Start building your own apps for WebSphere Liberty.
- WDT in Eclipse and Maven Integration
- Importing Liberty Maven plug-in projects into Eclipse
- Back to basics: Debug a Liberty app in Eclipse with WDT
- Getting started using the Liberty app accelerator
- Get started with a Hello World app on Liberty using IntelliJ IDEA
- Creating a Hello World app with Spring MVC on Liberty
- Writing tests for Liberty apps