Skip to content

Instantly share code, notes, and snippets.

Avatar

Andres Almiray aalmiray

View GitHub Profile
@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 / 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>
@aalmiray
aalmiray / consumer-pom.xml
Created May 28, 2020
Optional dependencies in Maven
View consumer-pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>consumer</artifactId>
<version>1.0.0</version>
@aalmiray
aalmiray / TodoResource.java
Last active May 19, 2020
Quarkus + Oracle JDBC
View TodoResource.java
package com.acme;
import io.agroal.api.AgroalDataSource;
import javax.inject.Inject;
import javax.inject.Named;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
You can’t perform that action at this time.