Skip to content

Instantly share code, notes, and snippets.

Avatar

Andres Almiray aalmiray

View GitHub Profile
@aalmiray
aalmiray / build.gradle
Last active Sep 8, 2020
Aggregated Jacoco reports in a multi-project Gradle build
View build.gradle
// ****************************************************************************
// The `org.kordamp.gradle.jacoco` plugin takes care of mane aspects shown here
// http://kordamp.org/kordamp-gradle-plugins/#_org_kordamp_gradle_jacoco
//
// The code shown here is obsolete. Use it at your own risk
// ****************************************************************************
allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
@aalmiray
aalmiray / consumer1-pom-enforced.xml
Last active Aug 13, 2020
Maven Enforcer plugin examples
View consumer1-pom-enforced.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>consumer1</artifactId>
<version>0.0.0</version>
<dependencies>
<dependency>
<groupId>com.acme</groupId>
@aalmiray
aalmiray / db.groovy
Last active Aug 10, 2020
Groovy/JBang
View db.groovy
@Grab('com.oracle.database.jdbc:ojdbc8:19.7.0.0')
@Grab('com.oracle.database.jdbc:ucp:19.7.0.0')
import java.sql.Connection
import java.sql.SQLException
import java.sql.Statement
import java.sql.ResultSet
import oracle.ucp.jdbc.PoolDataSourceFactory
import oracle.ucp.jdbc.PoolDataSource
PoolDataSource pds = PoolDataSourceFactory.poolDataSource.with(true) {
View Application.java
package com.acme.sample;
public class Application {
static {
System.setProperty("oracle.net.tns_admin",
System.getProperty("user.dir") + File.separator + "wallet");
}
public static void main(String[] args) {
// ...
@aalmiray
aalmiray / DataSourceConfig.java
Last active Jul 31, 2020
SpringBoot + Oracle JDBC
View DataSourceConfig.java
package com.acme.ucp;
import oracle.ucp.jdbc.PoolDataSource;
import oracle.ucp.jdbc.PoolDataSourceFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import javax.sql.DataSource;
@aalmiray
aalmiray / build.gradle
Last active Jul 16, 2020
Helidon SE Gradle starter
View build.gradle
plugins {
id 'com.github.johnrengelman.shadow'
id 'java'
id 'application'
}
application {
mainClassName = 'com.acme.example.helidon.Main'
}
@aalmiray
aalmiray / app.go
Last active Jul 1, 2020
OJDBC + Go sqlx
View app.go
package main
import (
"fmt"
"log"
_ "github.com/godror/godror"
"github.com/jmoiron/sqlx"
)
View consuming-bom-pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>example</artifactId>
<version>0.0.0</version>
<properties>
<oracle.jdbc.version>19.7.0.0</oracle.jdbc.version>
</properties>
@aalmiray
aalmiray / consumer1-pom.xml
Last active Jun 15, 2020
Mastering Maven 08
View consumer1-pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>consumer1</artifactId>
<version>0.0.0</version>
<dependencies>
<dependency>
<groupId>com.acme</groupId>
@aalmiray
aalmiray / consumer1-pom.xml
Last active Jun 3, 2020
Mastering Maven 07
View consumer1-pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>consumer1</artifactId>
<version>0.0.0</version>
<dependencies>
<dependency>
<groupId>com.acme</groupId>
You can’t perform that action at this time.