Skip to content

Instantly share code, notes, and snippets.

@ricston-git
ricston-git / build.gradle
Created May 11, 2016 14:39
Gist for "Java Build Tools, JavaScript Package Managers and Task Runners (Part 1)" blog-post.
/* The plugins that our project will use */
apply plugin: 'java'
apply plugin: 'findbugs'
apply plugin: 'pmd'
version = '1.0'
repositories {
mavenCentral()
}
@ricston-git
ricston-git / pom.xml
Created May 11, 2016 14:38
Gist for "Java Build Tools, JavaScript Package Managers and Task Runners (Part 1)" blog-post.
<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/maven-v4_0_0.xsd">
<!-- POM properties -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.ricston</groupId>
<artifactId>JavaBuildToolsExample</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<!-- The dependencies required by our project. -->
<dependencies>
@ricston-git
ricston-git / build.xml
Created May 11, 2016 14:37
Gist for "Java Build Tools, JavaScript Package Managers and Task Runners (Part 1)" blog-post.
<project name="JavaBuildToolsExample" default="jar" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Ant properties: Sub-directories are resolved with respect to the "basedir" attribute above. -->
<property name="src.dir" value="src"/>
<!-- Renamed the build directory as "/build-ant" so that it is distinguishable from "/build", created by Gradle. -->
<property name="build.dir" value="build-ant"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="lib.dir" value="lib" />
@ricston-git
ricston-git / ivy.xml
Created May 11, 2016 14:35
Gist for "Java Build Tools, JavaScript Package Managers and Task Runners (Part 1)" blog-post.
<ivy-module version="2.0">
<info organisation="com.ricston" module="JavaBuildToolsExample"/>
<!-- Dependencies are illustrated next. -->
<dependencies>
<dependency org="junit" name="junit" rev="4.12"/>
</dependencies>
</ivy-module>
@Override
public Object transformMessage(MuleMessage message, String outputEncoding)
throws TransformerException {
FileInputStream stream = (FileInputStream) message.getPayload();
DatumReader<AvroPoc> dwDatumReader = new SpecificDatumReader<AvroPoc>(
AvroPoc.class);
List<AvroPoc> allUsers = new ArrayList<AvroPoc>();
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:servlet="http://www.mulesoft.org/schema/mule/servlet" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/servlet http://www.mulesoft.org/schema/mule/servlet/current/mule-servlet.xsd">
<flow name="tomcat-demo-ce-3.5Flow">
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<context-param>
<param-name>org.mule.config</param-name>
<param-value>names_of_your_flow_configs.xml</param-value>
</context-param>
<listener>
@SuppressWarnings("unchecked")
@Override
public List<Serializable> allKeys() throws ObjectStoreException {
String allKeysQuery = this.getAllKeysQuery();
List<String> result = (List<String>) this.query(allKeysQuery, this.listHandler);
return new ArrayList<Serializable>(result);
}
@ricston-git
ricston-git / MyMojo.java
Last active August 29, 2015 14:27
How to create a Maven plugin to search and replace
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.LifecyclePhase;
@Mojo(name = "searchreplace", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
public class MyMojo
extends AbstractMojo
{
@Parameter(property = "outputDirectory", defaultValue = "${project.build.directory}")
private File outputDirectory;
*******************************************************************************************************
* - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *
*******************************************************************************************************
* mule-https-example-3.7.x * default * DEPLOYED *
*******************************************************************************************************
INFO 2015-08-19 23:39:45,136 [[mule-https-example-3.7.x].httpServerConnector.worker.01] org.mule.api.processor.LoggerMessageProcessor: sending request from https client to https server (one way ssl)...
INFO 2015-08-19 23:39:45,374 [[mule-https-example-3.7.x].httpsServerConnectorOneWaySSL.worker.01] org.mule.api.processor.LoggerMessageProcessor: accessed https server successfully - via one way ssl!
INFO 2015-08-19 23:39:52,907 [[mule-https-example-3.7.x].httpServerConnector.worker.01] org.mule.ap