Skip to content

Instantly share code, notes, and snippets.

View johnament's full-sized avatar

John Ament johnament

View GitHub Profile
@johnament
johnament / build.gradle
Created November 24, 2014 23:39
How to configure gradle w/ CDI capabilities
apply plugin: 'java'
apply plugin: 'idea'
apply plugin:'application'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
@johnament
johnament / request
Created November 10, 2017 19:54
whoami
GET /auth/admin/master/console/whoami HTTP/1.1
Host: mycompany
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Accept: application/json
Authorization: bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGbEhyZ1cwdU1XS2FhVnFtbHVRMERmT01adFlaOW9qTFJDTDNKRjdjOWhVIn0.eyJqdGkiOiJjOTRkY2EwZC04ZmZlLTRjN2EtOThjOS0zZjEyZDk3N2Q0MzkiLCJleHAiOjE1MTAzNDM4MTEsIm5iZiI6MCwiaWF0IjoxNTEwMzQzNTExLCJpc3MiOiJodHRwczovL3FhLnN0cmF0YXMubmV0L2F1dGgvcmVhbG1zL21hc3RlciIsImF1ZCI6InNlY3VyaXR5LWFkbWluLWNvbnNvbGUiLCJzdWIiOiI3OTEyMmI0NC1hOTViLTRhOWMtOGQ0MS0wZWFlMWFiY2M4NTMiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJzZWN1cml0eS1hZG1pbi1jb25zb2xlIiwibm9uY2UiOiI1M2Q4ZTZiZC0wNDRkLTQ1MWEtYTQzNS1mMWE4NTEyZTE0NjUiLCJhdXRoX3RpbWUiOjE1MTAzNDM1MTAsInNlc3Npb25fc3RhdGUiOiJmNDEyMzhkOS0wNzk3LTQzNGMtYjc2My01NGMyNTFlZDZiZjAiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbXSwicmVzb3VyY2VfYWNjZXNzIjp7fSwicHJlZmVycmVkX3VzZXJuYW1lIjoia2V5Y2xvYWstYWRtaW4ifQ.MvhWoze2kW0-zb_hQqC9yVGhLMcZAXesdHgwzgxpmtuwyfyCCJOVkw48-qDKMZ0MPMeP5C4WwB9MbODPPMGrV3Jvuf-YT-SaX5y5ItY
<?xml version="1.0" encoding="UTF-8"?>
<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>org.eclipse.microprofile</groupId>
<artifactId>microprofile-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
@johnament
johnament / Async.java
Created March 8, 2016 01:54
A really simple Async CDI extension
import javax.interceptor.InterceptorBinding;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Inherited
@InterceptorBinding
@Retention(RetentionPolicy.RUNTIME)
@johnament
johnament / features.xml
Created November 14, 2013 12:38
features.xml error with karaf
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="my-feature">
<feature name="my-feature" version="1.0.0-SNAPSHOT" description="Some Connector">
<details>My Company's awesome OSGi module</details>
<bundle>wrap:mvn:com.mycomapny.anotherproj/a-shaded-jar/1.0.0-SNAPSHOT</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io/1.4_3</bundle>
<bundle>mvn:org.apache.camel/camel-core/2.10.6</bundle>
<bundle>mvn:org.slf4j/slf4j-api/1.6.1</bundle>
<bundle>wrap:mvn:com.sun.xml.bind/jaxb-impl/2.2.5</bundle>
<bundle>mvn:org.apache.camel/camel-jms/2.10.6</bundle>
yum install ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/takehironet/CentOS_CentOS-6/x86_64/git-1.8.3.4-1.1.x86_64.rpm ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/takehironet/CentOS_CentOS-6/x86_64/perl-Git-1.8.3.4-1.1.x86_64.rpm
@johnament
johnament / file-1
Last active December 27, 2015 02:18
[DEBUG] Output directory: C:\Users\john.ament\Documents\GitHub\hawtio\hawtio-web\target\classes
[DEBUG] CompilerReuseStrategy: reuseCreated
[DEBUG] Classpath:
[DEBUG] C:\Users\john.ament\Documents\GitHub\hawtio\hawtio-web\target\classes
[DEBUG] C:\Users\john.ament\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar
[DEBUG] C:\Users\john.ament\.m2\repository\org\jolokia\jolokia-core\1.1.4\jolokia-core-1.1.4.jar
[DEBUG] C:\Users\john.ament\.m2\repository\com\googlecode\json-simple\json-simple\1.1\json-simple-1.1.jar
[DEBUG] C:\Users\john.ament\.m2\repository\io\hawt\hawtio-core\1.2-SNAPSHOT\hawtio-core-1.2-SNAPSHOT.jar
[DEBUG] C:\Users\john.ament\.m2\repository\org\slf4j\slf4j-api\1.6.6\slf4j-api-1.6.6.jar
[DEBUG] C:\Users\john.ament\.m2\repository\io\hawt\hawtio-git\1.2-SNAPSHOT\hawtio-git-1.2-SNAPSHOT.jar
package foo;
import org.junit.Test;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.runner.RunWith;
@johnament
johnament / ArquillianTest.java
Created September 23, 2013 20:37
Some CDI events playing around
package com.tad.arquillian.wls.hibernate.test;
import javax.enterprise.event.Event;
import javax.inject.Inject;
import junit.framework.Assert;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;