When working with Maven projects using IDEs such as Eclipse or IntelliJ, you will find that there are many files or folders created, for each individual IDE. In essence, the Maven project does not use these files, so we need to ignore them when pushing… Read More
After defining API specs with RAML, we can use Spring MVC-RAML Maven plugin to generate API contract. With API specs using OpenAPI Specification, you can use OpenAPI Generator Maven plugin to do this. How is it in detail? We will find out together in this… Read More
After defining API specs with RAML, we will proceed to implement this API specs. If your application is using the Spring framework then you can use Spring MVC-RAML Plugin to generate API contract with Spring framework and just add implementation code. How is it in… Read More
Open Liberty is also a Java Server runtime that helps us run Java web applications. Using the Liberty Maven plugin will help us quickly deploy the application to Open Liberty easily during development. In this tutorial, I will show you how to use this Liberty… Read More
Maven Archetype is a feature of Maven, you can understand it roughly, it allows us to quickly create a Maven project with a predefined structure. We just need to change values like Group Id, Artifact Id, and Version according to the value we want. I… Read More
Maven Shade Plugin is a Maven plugin that allows us to build uber-jars. In a nutshell, uber-jar are .jar files that, besides containing the source code of the application, also contain the dependencies that the application is using. From there, it helps us to build… Read More
When you develop an application with different Maven projects, we will often use a Maven parent project to manage these Maven projects. It will help us to centralize the version management of the dependencies used for the application, when we want to upgrade the version… Read More
Sometimes when working with Java applications, you will need to use Groovy code to solve your problems. In these cases, you’ll need to compile Groovy code so it can run with the application’s Java code. In this tutorial, I will show you how to install… Read More
Usually when you create any new Maven project, the src/main/java, src/test/java, src/main/resources, src/test/resources directories will be the default source and resources directory of the project. If you want to add a new source or resource directory from a directory in this project, for example, the… Read More
When working with Apache Maven in Eclipse, I am convinced that no one didn’t encountered an error as below when building the application:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project example: Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre1.8.0_101\..\lib\tools.jar -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
What is the cause? This is because by default Apache Maven will use the Maven Compiler Plugin plugin to compile the… Read More