Home » Tag Archives: Apache Maven

Tag Archives: Apache Maven

How to create a Web Application Project with Java, Maven, Jetty

apache-maven-logo

In this article, we create a simple web application with the Maven Archetype plugin. We’ll run this web application in a Servlet container named Jetty, add some dependencies, write simple Servlets, and generate a WAR file. At the end of this article, you will also be able to deploy the service in Tomcat. System requirements Java SE Development Kit 8 ...

Read More »

Truly Unleashing the Power of Maven and Java EE

apache-maven-logo

Ambition and vision can be the undoing of great solutions, if they are too complex to use. While Maven and Java EE are technologies that are well established throughout the Java industry, it can be extremely tricky to get started with them and to architect projects using all the techniques and patterns that their authors intended you to use. How often do applications, ...

Read More »

Run java web apps in embedded containers with Maven, Jetty and Tomcat

java-interview-questions-answers

While developing java web applications is very practical to have quick feedback from a “real” environment. In this post I’ll explore how to run a java web application with Maven in an embedded container be it Jetty or Tomcat.  I’ll show how I have configured them for the development of podcastpedia project backing the Podcastpedia.org website. Prerequisites You should have Maven ...

Read More »

How to Debug Your Maven Build with Eclipse

eclipse-logo

When running a Maven build with many plugins (e.g. the jOOQ or Flyway plugins), you may want to have a closer look under the hood to see what’s going on internally in those plugins, or in your extensions of those plugins. This may not appear obvious when you’re running Maven from the command line, e.g. via: C:\Users\jOOQ\workspace>mvn clean install Luckily, ...

Read More »

Getting version string from a Maven based web application

apache-maven-logo

When you package a maven project, it will automatically generate a pom.properties file inside that will contains the version, artifactId and groupId information. These are handy to have and to display for your web application at runtime. One can use a method like following to retrive it. public class Application { private String version; public String getVersion() { if (version ...

Read More »

Java EE, Docker and Maven (Tech Tip #89)

docker-logo

Java EE applications are typically built and packaged using Maven. For example, github.com/javaee-samples/javaee7-docker-maven is a trivial Java EE 7 application and shows the Java EE 7 dependency: <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> </dependencies> And the two Maven plugins that compiles the source and builds the WAR file: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> ...

Read More »

Unit And Integration Test Reports For Maven Projects In SonarQube

apache-maven-logo

Since SonarQube 4.2. the test report isn’t generated by the Sonar Maven Plugin during a Maven build (see SonarQube’s blog post) . Therefore, the test report has to be generated by another plugin before Sonar Maven Plugin collects the information for the SonarQube server. Here, Jacoco Maven Plugin can help. It has the possibility to generate test report that are ...

Read More »

There is a Mojo in My Dojo (How to write a Maven plugin)

apache-maven-logo

I have been up to my armpits involved using Maven at work.  For good number of developers I will hear, “So what.”  The difference is that I normally work in environments where I do not have access to the Internet directly.  So when I say I have been using Maven a lot, it means something. Dependency Hell To be fair, ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.