Tag: Maven
-
Jenkins: Getting Karma Generated Test Results to Appear in Maven Project Job
PROBLEM Jenkins, for some reason, does not pick up Karma generated JUnit test reports even though they are created in the right directory… and apparently, it is a known problem. While Freestyle project job allows us to manually publish these JUnit reports, my intention is to rely on Maven project job to do the same… Read More…
-
Maven: Plugin Execution Not Covered by Lifecycle Configuration
PROBLEM When running a Maven project in Eclipse or Spring Tool Suite (STS), we get an exception that is similar to this:- SOLUTION This problem stems from m2eclipse (m2e) plugin, which provides Maven support in Eclipse-based IDEs. STEP 1: Suppress the Error Message The simplest solution is to instruct m2e to silently ignore the plugin… Read More…
-
Maven: Unable to Execute Spock Specs
PROBLEM When running mvn clean test, Maven Surefire Plugin doesn’t pick up *Spec.groovy test files. SOLUTION By default, Maven Surefire Plugin is configured to execute test files with the following patterns: **/Test*.java, **/*Test.java and **/*TestCase.java. To fix this, we need to modify the inclusion list for this plugin. Since both Java and Groovy files get… Read More…
-
Maven + Jetty: Enabling SSL on Jetty Maven Plugin
PROBLEM In order to run our web application using HTTPS, we need to enable SSL first on Jetty. SOLUTION #1: Generating Certificate on the Fly One clean solution by @PascalThivent is to recreate the certificate whenever Jetty starts. Not to steal any credits from him, but here’s a slightly modified configuration using more recent plugin… Read More…
-
Maven: Deploying Java Sources to Nexus
By default, mvn deploy will only package and deploy class JAR to Nexus. To deploy the source code too, we need to add the following plugin into pom.xml:- Now, mvn deploy will deploy both class JAR and source code JAR to Nexus:- In IntelliJ, when jumping into a class from the JAR, we are given… Read More…
-
Maven JAR Plugin: Excluding Package(s) from JAR
Let’s assume we want to exclude com.choonchernlim.epicapp.scratch package when we create the JAR file. Add the following in pom.xml:- The key here is to specify the execution ID called default-jar. Read More…