Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add pom and Mavenfile and revised readme

  • Loading branch information...
commit 5d8bdc10287bce27b57dac6ab95207bab8eb41fd 1 parent adf968f
@mkristian authored
Showing with 610 additions and 11 deletions.
  1. +1 −0  demo/.gitignore
  2. +40 −0 demo/Mavenfile
  3. +22 −11 demo/README.textile
  4. +547 −0 demo/pom.xml
View
1  demo/.gitignore
@@ -3,3 +3,4 @@ db/*.sqlite3
log/*.log
tmp/**/*
Gemfile.lock
+Gemfile.files
View
40 demo/Mavenfile
@@ -0,0 +1,40 @@
+# -*- mode: ruby -*-
+properties["jruby.plugins.version"] = '0.25.0'
+
+jar('junit:junit', '3.8.2').scope 'test'
+
+jar('org.seleniumhq.selenium.client-drivers:selenium-java-client-driver', '1.0.1').scope 'test'
+
+plugin('org.mortbay.jetty:jetty-maven-plugin') do |jetty|
+ jetty.with(:stopKey => 'foo', :stopPort => 9999)
+ jetty.in_phase('pre-integration-test').execute_goal('run').with(:daemon => true)
+ jetty.in_phase('post-integration-test').execute_goal('stop')
+end
+
+plugin('org.codehaus.mojo:selenium-maven-plugin', '1.1') do |selenium|
+ selenium.in_phase('pre-integration-test').execute_goal("start-server").with(
+ {
+ :background => true,
+ :firefoxProfileTemplate => "${basedir}/src/test/resources/selenium"
+ })
+end
+
+plugin('surefire', '2.6') do |surefire|
+ # skip the test dring test phase
+ surefire.with :skip => true
+ # but execute them during integration-test phase
+ surefire.in_phase('integration-test').execute_goal('test').with :skip => false
+end
+
+execute_in_phase(:initialize) do
+ require 'fileutils'
+
+ if File.exists? 'pom.xml'
+ pom_xml = File.new "pom.xml"
+ pom = File.new "Gemfile.pom"
+ out_of_date = pom_xml.mtime < pom.mtime
+ else
+ out_of_date = true
+ end
+ FileUtils.cp("Gemfile.pom", "pom.xml") if out_of_date
+end
View
33 demo/README.textile
@@ -1,48 +1,59 @@
h1. Start the demo application
-h2. with maven3 (jetty)
+p. note: Gemfile.lock is not part of the git repository since it is platform dependent and can not be use for MRI and JRuby at the same time.
+
+h2. with maven3 (using jetty)
bc. mvn rails3:rake -Dargs="db:setup"
-mvn jetty:run -f Gemfile.pom
+mvn jetty:run
p. note: there is no need to have jruby, rubygems, rails installed !!!
-h2. with ruby-maven gem (jetty)
+h2. with ruby-maven gem (using jetty)
-bc. jruby -S gem install ruby-maven --pre
+bc. jruby -S gem install ruby-maven
rmvn rake db:setup
-rmvn jetty-run
+rmvn jetty:run
p. note: you need to have jruby installed but no rails or bundler !!!
-h2. with jruby (webrick)
+h2. with jruby (using webrick) without enforce-ssl
bc. jruby -S bundle install
jruby -S rake db:setup
jruby script/rails server
+p. or with ruby-maven
+
+bc. rmvn rake db:setup
+rmvn rails server
+
+p. enforce-ssl does not work since the server listens only on one port and it is kind of hacky to get SSL working
+
p. note: you to have jruby and bundler installed !!!
-h2. with ruby (webrick)
+h2. with ruby (using webrick) without enforce-ssl
bc. bundle install
rake db:setup
script/rails server
+p. enforce-ssl does not work since the server listens only on one port and it is kind of hacky to get SSL working
+
p. note: you to have bundler installed !!!
h1. Run the integration test (selenium)
-h2. with maven3 (jetty)
+h2. with maven3
bc. mvn rails3:rake -Dargs="db:setup"
-mvn integration-test -f Gemfile.pom
+mvn integration-test
p. note: there is no need to have jruby, rubygems, rails installed !!!
-h2. with ruby-maven gem (jetty)
+h2. with ruby-maven
-bc. jruby -S gem install ruby-maven --pre
+bc. jruby -S gem install ruby-maven
rmvn rake db:setup
rmvn integration-test
View
547 demo/pom.xml
@@ -0,0 +1,547 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>rails</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <name><![CDATA[demo - rails application]]></name>
+ <packaging>war</packaging>
+ <repositories>
+ <repository>
+ <id>rubygems-releases</id>
+ <url>http://gems.saumya.de/releases</url>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rails</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>actionmailer</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>actionpack</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activemodel</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activesupport</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>builder</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>i18n</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>erubis</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>abstract</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rack</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rack-mount</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rack-test</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>tzinfo</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>mail</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>mime-types</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>treetop</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>polyglot</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activerecord</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>arel</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activeresource</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>bundler</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>railties</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rake</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>thor</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activerecord-jdbc-adapter</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>jdbc-sqlite3</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>enforce-ssl</artifactId>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ <version>1.0.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jruby</groupId>
+ <artifactId>jruby-complete</artifactId>
+ <version>1.5.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jruby.rack</groupId>
+ <artifactId>jruby-rack</artifactId>
+ <version>1.0.7</version>
+ </dependency>
+ </dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>abstract</artifactId>
+ <version>1.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>actionmailer</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>actionpack</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activemodel</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activesupport</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>builder</artifactId>
+ <version>2.1.2</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>i18n</artifactId>
+ <version>0.4.2</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>erubis</artifactId>
+ <version>2.6.6</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rack</artifactId>
+ <version>1.2.1</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rack-mount</artifactId>
+ <version>0.6.13</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rack-test</artifactId>
+ <version>0.5.6</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>tzinfo</artifactId>
+ <version>0.3.23</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>mail</artifactId>
+ <version>2.2.9</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>mime-types</artifactId>
+ <version>1.16</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>treetop</artifactId>
+ <version>1.4.8</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>polyglot</artifactId>
+ <version>0.3.1</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activerecord</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>arel</artifactId>
+ <version>1.0.1</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activerecord-jdbc-adapter</artifactId>
+ <version>1.0.2</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activeresource</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>enforce-ssl</artifactId>
+ <version>0.1.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>jdbc-sqlite3</artifactId>
+ <version>3.6.14.2.056</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rails</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>bundler</artifactId>
+ <version>[1.0.0, 1.0.99999]</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>railties</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rake</artifactId>
+ <version>0.8.7</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>thor</artifactId>
+ <version>0.14.3</version>
+ <type>gem</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <properties>
+ <gem.home>${project.build.directory}/rubygems</gem.home>
+ <gem.path>${project.build.directory}/rubygems</gem.path>
+ <jetty.version>7.2.2.v20101205</jetty.version>
+ <jruby.plugins.version>0.25.0</jruby.plugins.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <rails.env>development</rails.env>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <configuration>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>in_phase_pre_integration_test</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>in_phase_post_integration_test</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <id>in_phase_pre_integration_test</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start-server</goal>
+ </goals>
+ <configuration>
+ <background>true</background>
+ <firefoxProfileTemplate>${basedir}/src/test/resources/selenium</firefoxProfileTemplate>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>in_phase_integration_test</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>de.saumya.mojo</groupId>
+ <artifactId>gem-maven-plugin</artifactId>
+ <version>${jruby.plugins.version}</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>in_phase_initialize</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>execute_in_phase</goal>
+ </goals>
+ <configuration>
+ <file>${basedir}/Mavenfile</file>
+ <phase>initialize</phase>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>de.saumya.mojo</groupId>
+ <artifactId>rails3-maven-plugin</artifactId>
+ <version>${jruby.plugins.version}</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>initialize</id>
+ <goals>
+ <goal>initialize</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>public</directory>
+ </resource>
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>app/**</include>
+ <include>config/**</include>
+ <include>lib/**</include>
+ <include>vendor/**</include>
+ <include>Gemfile</include>
+ </includes>
+ <targetPath>WEB-INF</targetPath>
+ </resource>
+ <resource>
+ <directory>${gem.path}</directory>
+ <targetPath>WEB-INF/gems</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>development</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ </profile>
+ <profile>
+ <id>test</id>
+ <activation>
+ <property>
+ <name>rails.env</name>
+ <value>test</value>
+ </property>
+ </activation>
+ </profile>
+ <profile>
+ <id>production</id>
+ <activation>
+ <property>
+ <name>rails.env</name>
+ <value>production</value>
+ </property>
+ </activation>
+ <properties>
+ <gem.home>${project.build.directory}/rubygems-production</gem.home>
+ <gem.path>${project.build.directory}/rubygems-production</gem.path>
+ </properties>
+ </profile>
+ <profile>
+ <id>war</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>${jetty.version}</version>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>run</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>${jetty.version}</version>
+ <configuration>
+ <connectors>
+ <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+ <port>8080</port>
+ </connector>
+ <connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
+ <port>8443</port>
+ <keystore>${project.basedir}/src/test/resources/server.keystore</keystore>
+ <keyPassword>123456</keyPassword>
+ <password>123456</password>
+ </connector>
+ </connectors>
+ <webAppConfig>
+ <overrideDescriptor>${project.build.directory}/jetty/override-${rails.env}-web.xml</overrideDescriptor>
+ </webAppConfig>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Please sign in to comment.
Something went wrong with that request. Please try again.