Skip to content

Instantly share code, notes, and snippets.

@mkristian
mkristian / gist:7115475
Created October 23, 2013 09:31
resty gwt - resource with query
Resource resource = new Resource(GWT.getModuleBaseURL(), new HashMap<String, String>());
resource = resource.addQueryParam("includeparam", "false");
try
{
resource.get().send( new RequestCallback() {
@Override
public void onResponseReceived( Request request, Response response )
{
// TODO Auto-generated method stub
@mkristian
mkristian / Mavenfile
Last active December 23, 2015 23:59
Mavenfile to use warbler to create the war file and replaces the maven artifact with that. the pom.xml is equivalent to the Mavenfile which got genreated by ruby-maven/tesla. This is a maven-like approach where are gems are declared as maven gem artifacts and maven installs the locally and executes warbler on the project specific gem-set. NOTE: …
gemfile
#parent 'parent.group:parent_artifact_id', '1.0'
#group_id 'my.group'
#artifact_id 'my_webapp'
#version '1.0.0'
# we want a war file
packaging :war
@mkristian
mkristian / Mavenfile
Last active December 23, 2015 23:59
Mavenfile to use warbler to create the war file and replaces the maven artifact with that. the pom.xml is equivalent to the Mavenfile which got genreated by ruby-maven/tesla.
packaging :war
phase :package do
plugin 'de.saumya.mojo:jruby-maven-plugin', '1.0.0-rc3' do
execute_goal( :jruby,
:id => 'pack-war with warbler',
:filename => 'warble',
:gemUseSystem => true )
execute_goal( :jruby,
:id => 'move war to maven build dir',
@mkristian
mkristian / pom.xml
Created September 24, 2013 17:37
sample pom.xml to pack a rails app as wer with maven
<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>rails</groupId>
<artifactId>dhammapada</artifactId>
<version>0.0.0</version>
<packaging>war</packaging>
<repositories>
<repository>
<id>rubygems-releases</id>
<url>http://rubygems-proxy.torquebox.org/releases</url>
@mkristian
mkristian / C.java
Created August 20, 2013 10:05
calling overloaded method from jruby
public class C {
public void m( String[] args, Object f ) {
System.out.println( "asd" );
}
public void m( String[] args ) {
System.out.println( args.length );
}
}
require 'maven/ruby/tasks'
# overwrite predefined task with custom maven
task :maven do
# the block is the POM for maven
maven do
# load data from gemspec
gemspec
inherit "io.tesla.polyglot:tesla-polyglot:0.0.1-SNAPSHOT"
@mkristian
mkristian / Rakefile
Created July 30, 2013 10:07
maven tasks for rake using pom.xml or pom.rb or Mavenfile as POM
require 'maven/ruby/tasks'
task :default => :build
@mkristian
mkristian / pom.xml
Created July 2, 2013 19:55
using rake-maven-plugin with jruby/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>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>1.7.5.dev</version>
<name><![CDATA[JRuby]]></name>
<packaging>jar</packaging>
<repositories>
<repository>
<id>localrepo</id>
@mkristian
mkristian / Gemfile
Created May 30, 2013 13:26
related to nexus-ruby-support #25
source 'http://localhost:4711/nexus/content/repositories/gemsproxy'
gem 'httparty'
@Json( style = Style.RAILS, name="sometype")
class SomeType
{
public String id;
public String name;
}