Skip to content

Instantly share code, notes, and snippets.

@jdmwood
jdmwood / BindValue.java
Last active August 29, 2015 14:25
Immutables 2.0 and JDBI integration
/*
Copyright 2014 Immutables Authors and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.27.2</version>
<configuration>
<images>
<image>
<alias>my-service</alias>
<name>my-service</name>
<build>
<dependencies>
...
<!-- Required so we can dynamically inject the Jacoco jar into our container -->
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
<classifier>runtime</classifier>
<version>0.8.4</version>
<scope>test</scope>
</dependency>
<build>
<plugins>
...
<!-- Adds properties containing the path of Jar files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<!-- Make the jacoco agent Jar available to our test Docker containers by copying it to the
docker shared dir. -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<tasks>
<delete dir="${project.build.directory}/jacoco-it" failonerror="false"/>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<!-- Generate reports from coverage generated during integration tests. Note that this maven plugin
does NOT generate the coverage - that is done by adding the Jacoco agent to the Docker container -->
<execution>
<goals>
<goal>report-integration</goal>
@Entity
public class Customer {
@Id
public int id;
@Basic(optional=false)
public String name;
public Customer() {
@Entity
class Customer {
@Id
var id: Int = 0
@Basic(optional=false)
var name: String? = null
}
@Entity
class Customer(
@Id
var id: Int,
@Basic
var name: String
)
@jdmwood
jdmwood / pom.xml
Last active November 1, 2019 10:25
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<compilerPlugins>
<plugin>all-open</plugin>
<plugin>jpa</plugin>
</compilerPlugins>