Posts tagged with maven

  • Optional files in Maven archetypes

    Sep 7, 2019

    This post shows how to create a Maven archetype that can conditionally include or exclude files while generating a project.

  • Automatically upgrade parent pom

    Feb 16, 2019

    TL;DR: I wrote a script that discovers git repositories with an outdated parent pom and then it creates a pull request on each repository to set the parent pom version to latest and greatest.

  • YAML schema validation with Maven

    Nov 28, 2018

    Sometimes it feels we’re reinventing the wheel, but with different names. Back in the days, XML was the cool thing. We had XPath as a query language. We had XSLT to transform XML documents into different shapes. We had XSD to validate the schema of XML. We had code generation and validation. We could generate web service clients and servers with WSDL.

  • Publishing git tags for Maven projects in Bitbucket Pipelines

    Oct 30, 2018

    Update 2018-11-24: I’ve put together a maven plugin that can also publish git tags in Bitbucket Cloud, plus it checks there are no gaps in a semver sequence. It’s available here.

  • Merging Swagger files

    Oct 28, 2018

    Consider the following scenario. You have a few microservices and they’re all developed independently: they don’t share code, they don’t share data and they don’t share schema. They’re all exposing their own REST API. To make things a bit simple, their API is defined in a swagger file.

  • Code coverage on integration tests?

    Aug 11, 2018

    Should you collect and measure code coverage on integration tests or only unit tests? In this post I’ll share some thoughts on this topic.

  • Swagger and MapStruct

    Apr 29, 2018

    I’ve been working lately on a project with a few services (or microservices, if you like to play buzzword bingo). I wanted to share some thoughts on how using Swagger together with MapStruct can make things easier.

  • Using swagger code generator with maven

    Apr 21, 2018

    Following up the previous post about swagger, in this post I’m using the maven plugin version of swagger code generator.

  • Exclude class from JaCoCo coverage

    Apr 21, 2018

    JaCoCo’s exclude configuration works with classes, so the .class extension is relevant in specifying the path.

  • Building a REST API with Swagger and Spring Boot

    Apr 15, 2018

    In this post, I’ll be using Swagger to build a REST API with Java and Spring Boot. Swagger is an API framework. It uses a YAML-based language to define an API and it has a code generator that supports multiple languages.

  • Validate filename conventions with Maven Enforcer plugin

    Apr 17, 2017

    In this post I’m using the Maven Enforcer plugin to break the build when certain files don’t follow the expected naming convention. It’s always a good idea to take the time and implement these checks inside the build pipeline. The alternative is hoping that code reviewers will spot the problems, which is a manual, tedious and error prone approach. Automate all the things!

  • Publishing my first Maven package with Travis

    Mar 29, 2017

    A little bit more than a month ago, I created an improved Maven archetype project. Similar to the default quickstart archetype, but for Java 8 and with recent jUnit dependency. In order for someone to use it, they’d have to clone the repo, as I had not published it in Maven. After a bit of studying, I figured out what is needed to make the package public. More importantly, I implemented the process in Travis, so that a new version gets published automatically.

  • Debugging Docker with IntelliJ IDEA

    Mar 26, 2017

    In this post we’ll create a small Java application, run it inside a Docker container, and use IntelliJ IDEA to debug. This is a rather large post, so take your time.

  • Linting with Checkstyle

    Mar 12, 2017

    Code is going to be written once but read many times. A consistent coding style across the entire code base is important to increase readability and maintainability. Luckily, there are tools that can help to define and enforce such styling rules. From mere cosmetics up to nasty code smells, static code analysis can help increase the quality of your code. I wrote some posts on static code analysis in JavaScript a bit more than a year ago (which in the JavaScript world means the tools are now different, ESLint instead of JSCS/JSHint). In this post we’ll see the Checkstyle tool in the Java world, how to use it with TeamCity and IntelliJ and finally a few words about SonarQube.

  • Code Coverage with JaCoCo

    Mar 12, 2017

    Code Coverage is a useful set of metrics that show you how much of your code you’re impacting during testing. It doesn’t say much about the quality of your tests (you can read more in the old post What is code coverage?), but a 30% coverage is definitely worse than 90%. Let’s see how we can use JaCoCo to see our code coverage in the Java world. We’ll check a few options to use it, such as using it manually, using it within a CI, breaking the build with it, etc. The assumption is we’re working with a Maven project.

  • A quickstart Maven archetype for Java 8

    Feb 25, 2017

    As a Maven rookie, I often use the quickstart archetype from Maven when I want to create a new Maven project. Unfortunately, that archetype is a bit outdated, which means I have to tweak some details before I can actually use it. I guess I got a bit tired of this and I thought I could create my own archetype that is ready to use.

  • How to create a simple web app with maven

    Sep 18, 2016

    This post shows how to create a simple web application with maven. I have the relevant commits as well in GitHub for reference, in case you want to see in more details.

  • Maven Tips

    Jun 14, 2015

    I started using Maven at work recently. Being a newbie, I find myself googling constantly (even though the answer is always on StackOverflow) about basic things. For reference, these are my most needed actions so far:

This site uses third party cookies from Google Analytics and Google AdSense Accept and close popup