Home » Maven

Tag Archives: Maven

Jenkins: Automating your delivery pipeline

In this post, we are going to create a Jenkins pipeline for a Java Spring project using Maven and Git: Accessing Jenkins dashboard and configuring Maven in Jenkins: Click on “Manage Jenkins” and then in “Global Tool Configuration” Add a Maven installation and provide a name for it. Click on Save. Creation of our first build job in Jenkins for ...

Read More »

Testing using TestContainers

java-interview-questions-answers

Part of our everyday ci/cd tasks involve using containers in order for the tests to take effect.So what if you could control the containers you use through your tests and serve your scenarios better.Also what if you could do this in a more managed way? Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common ...

Read More »

All Your Tests Belong to You: Maintaining Mixed JUnit 4/JUnit 5 and Testng/JUnit 5 Test Suites

If you are seasoned Java developer who practices test-driven development (hopefully, everyone does it), it is very likely JUnit 4 has been your one-stop-shop testing toolbox. Personally, I truly loved it and still love: simple, minimal, non-intrusive and intuitive. Along with terrific libraries like Assertj and Hamcrest it makes writing test cases a pleasure. But time passes by, Java has ...

Read More »

Rebuild a Maven repository in 3 steps

In this blog post, I will show a way to very quickly rebuild a Maven repository without having to set up a project. Step 1: Delete all artifacts Cleanse your Maven repository by deleting the contents of the /.m2/repository directory. Ensure to delete the settings.xml file if so required. Step 2: Create a dummy POM file Create the simplest POM ...

Read More »

It is never enough of them: enriching Apache Avro generated classes with custom Java annotations

Apache Avro, along with Apache Thrift and Protocol Buffers, is often being used as a platform-neutral extensible mechanism for serializing structured data. In the context of event-driven systems, the Apache Avro‘s schemas play the role of the language-agnostic contracts, shared between loosely-coupled components of the system, not necessarily written using the same programming language. Probably, the most widely adopted reference ...

Read More »

How to publish jar to Maven central

You created your brand new project and you want to release it to maven central so people can use in their maven based project. It is not a really straightforward thing to accomplish so I wanted to write a step by step guide on it (based on his stackoverflow post).  –Create your jira account on sonatype -Login to your jira ...

Read More »

Test Coverage Reports For Maven Projects In SonarQube 8.3.x

Some years ago I write a blog post about how to generate test reports in SonarQube separate in test report for unit tests and for integration tests. Since SonarQube 6.2 the test report isn’t separate in these categories any more (see SonarQube’s blog post). SonarQube merges all test reports to one test report with an overall coverage. So how to ...

Read More »

Dependency management and Maven

Maven is great and mature. There is always a solution on almost everything. The main case you might stumble on organisation projects is dependency management. Instead of each project having it’s own dependencies you want a centralised way to inherit those dependencies. In those case you declare on the parent prom the managed dependencies. In my example I just want ...

Read More »

Maven Tutorial For Selenium Test Automation

While working on a project for test automation, you’d require all the Selenium dependencies associated with it. Usually these dependencies are downloaded and upgraded manually throughout the project lifecycle, but as the project gets bigger, managing dependencies can be quite challenging. This is why you need build automation tools such as Maven to handle them automatically. Maven can be more ...

Read More »