- Revision
- 69
- Author
- mward
- Date
- 2007-05-22 22:58:29 -0500 (Tue, 22 May 2007)
Log Message
added JRuby example module ... which is a work in progress
Modified Paths
Added Paths
- trunk/examples/jruby-example/
- trunk/examples/jruby-example/jruby-example.iml
- trunk/examples/jruby-example/pom.xml
- trunk/examples/jruby-example/resources/
- trunk/examples/jruby-example/resources/index.html
- trunk/examples/jruby-example/src/
- trunk/examples/jruby-example/src/main/
- trunk/examples/jruby-example/src/main/java/
- trunk/examples/jruby-example/src/main/java/org/
- trunk/examples/jruby-example/src/main/java/org/codehaus/
- trunk/examples/jruby-example/src/main/java/org/codehaus/waffle/
- trunk/examples/jruby-example/src/main/java/org/codehaus/waffle/example/
- trunk/examples/jruby-example/src/main/java/org/codehaus/waffle/example/jruby/
- trunk/examples/jruby-example/src/main/java/org/codehaus/waffle/example/jruby/JRubyRegistrar.java
- trunk/examples/jruby-example/src/main/webapp/
- trunk/examples/jruby-example/src/main/webapp/WEB-INF/
- trunk/examples/jruby-example/src/main/webapp/WEB-INF/web.xml
- trunk/examples/jruby-example/src/test/
- trunk/examples/jruby-example/src/test/java/
- trunk/examples/jruby-example/src/test/java/org/
- trunk/examples/jruby-example/src/test/java/org/codehaus/
- trunk/examples/jruby-example/src/test/java/org/codehaus/waffle/
- trunk/examples/jruby-example/src/test/java/org/codehaus/waffle/example/
- trunk/examples/jruby-example/src/test/java/org/codehaus/waffle/example/jruby/
- trunk/examples/jruby-example/src/test/java/org/codehaus/waffle/example/jruby/RubyRegistrarTest.java
Diff
Modified: trunk/core/pom.xml (68 => 69)
--- trunk/core/pom.xml 2007-05-23 03:24:33 UTC (rev 68) +++ trunk/core/pom.xml 2007-05-23 03:58:29 UTC (rev 69) @@ -86,5 +86,4 @@ </plugins> </build> - </project>
Property changes: trunk/examples/jruby-example
Name: svn:ignore
+ exploded
target
Added: trunk/examples/jruby-example/jruby-example.iml (0 => 69)
--- trunk/examples/jruby-example/jruby-example.iml (rev 0) +++ trunk/examples/jruby-example/jruby-example.iml 2007-05-23 03:58:29 UTC (rev 69) @@ -0,0 +1,182 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module relativePaths="true" type="J2EE_WEB_MODULE" version="4"> + <component name="AppServerSpecificValidatorsManager" /> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="" /> + <exclude-output /> + <exploded url="" /> + <exclude-exploded /> + <output-test url="" /> + <content url="" + <sourceFolder url="" isTestSource="false" /> + <sourceFolder url="" isTestSource="true" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="library" name="Groovy from GroovyJ 0.1.8 (Demetra)" level="application" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module" module-name="core" exported="" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntryProperties /> + </component> + <component name="WebModuleBuildComponent"> + <setting name="EXPLODED_URL" value="file://$MODULE_DIR$/exploded" /> + <setting name="EXPLODED_ENABLED" value="true" /> + <setting name="JAR_URL" value="file://" /> + <setting name="JAR_ENABLED" value="false" /> + <setting name="BUILD_MODULE_ON_FRAME_DEACTIVATION" value="false" /> + <setting name="BUILD_EXTERNAL_DEPENDENCIES" value="false" /> + <setting name="RUN_JASPER_VALIDATION" value="true" /> + </component> + <component name="WebModuleProperties"> + <containerElement type="module" name="core"> + <attribute name="method" value="5" /> + <attribute name="URI" value="/WEB-INF/lib/core.jar" /> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> + <url>jar://$APPLICATION_HOME_DIR$/lib/j2ee.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="0" /> + <attribute name="URI" value="/WEB-INF/lib/asm-2.2.3.jar" /> + <url>jar://$M2_REPOSITORY$/asm/asm/2.2.3/asm-2.2.3.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="0" /> + <attribute name="URI" value="/WEB-INF/lib/backport-util-concurrent-3.0.jar" /> + <url>jar://$M2_REPOSITORY$/backport-util-concurrent/backport-util-concurrent/3.0/backport-util-concurrent-3.0.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/paranamer-1.0-RC-3-SNAPSHOT.jar" /> + <url>jar://$M2_REPOSITORY$/com/thoughtworks/paranamer/paranamer/1.0-RC-3-SNAPSHOT/paranamer-1.0-RC-3-SNAPSHOT.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/jmock-1.2.0.jar" /> + <url>jar://$M2_REPOSITORY$/jmock/jmock/1.2.0/jmock-1.2.0.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/junit-4.0.jar" /> + <url>jar://$M2_REPOSITORY$/junit/junit/4.0/junit-4.0.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/ognl-2.6.9.jar" /> + <url>jar://$M2_REPOSITORY$/ognl/ognl/2.6.9/ognl-2.6.9.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/hamcrest-api-1.0.jar" /> + <url>jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-api/1.0/hamcrest-api-1.0.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/hamcrest-library-1.0.jar" /> + <url>jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-library/1.0/hamcrest-library-1.0.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/jmock-junit4-2.0.0.jar" /> + <url>jar://$M2_REPOSITORY$/org/jmock/jmock-junit4/2.0.0/jmock-junit4-2.0.0.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/jmock-2.0.0.jar" /> + <url>jar://$M2_REPOSITORY$/org/jmock/jmock/2.0.0/jmock-2.0.0.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="0" /> + <attribute name="URI" value="/WEB-INF/lib/jruby-1.0RC2.jar" /> + <url>jar://$M2_REPOSITORY$/org/jruby/jruby/1.0RC2/jruby-1.0RC2.jar!/</url> + </containerElement> + <containerElement type="library" level="module"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/lib/picocontainer-1.2.jar" /> + <url>jar://$M2_REPOSITORY$/org/picocontainer/picocontainer/1.2/picocontainer-1.2.jar!/</url> + </containerElement> + <containerElement type="library" name="Groovy from GroovyJ 0.1.8 (Demetra)" level="application"> + <attribute name="method" value="0" /> + <attribute name="URI" value="/WEB-INF/lib" /> + </containerElement> + <containerElement type="library" name="servlet-api" level="module"> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> + </containerElement> + <containerElement type="library" name="velocity" level="module"> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> + </containerElement> + <containerElement type="library" name="velocity-dep" level="module"> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> + </containerElement> + <containerElement type="library" name="velocity-tools-view" level="module"> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> + </containerElement> + <deploymentDescriptor name="web.xml" url="" optional="false" version="2.4" /> + <webroots> + <root url="" relative="/" /> + <root url="" relative="/WEB-INF" /> + </webroots> + </component> + <component name="WeblogicWebModuleProperties" /> +</module> +
Added: trunk/examples/jruby-example/pom.xml (0 => 69)
--- trunk/examples/jruby-example/pom.xml (rev 0) +++ trunk/examples/jruby-example/pom.xml 2007-05-23 03:58:29 UTC (rev 69) @@ -0,0 +1,77 @@ +<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"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.codehaus.waffle</groupId> + <artifactId>waffle-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <artifactId>waffle-jruby-example</artifactId> + <packaging>war</packaging> + <name>Waffle JRuby Example</name> + + <dependencies> + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>waffle</artifactId> + <version>${pom.version}</version> + </dependency> + <dependency> + <groupId>org.jruby</groupId> + <artifactId>jruby</artifactId> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>2.0</version> + <configuration> + <warName>${pom.artifactId}</warName> + <webResources> + <resource> + <directory>${basedir}/resources</directory> + </resource> + </webResources> + </configuration> + </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>deploy-webapp</id> + <phase>install</phase> + <configuration> + <tasks> + <echo>Deploying webapp</echo> + <copy file="target/${pom.artifactId}.war" todir="${webapp.deploy.dir}" verbose="true" + overwrite="true"/> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>
Added: trunk/examples/jruby-example/resources/index.html (0 => 69)
--- trunk/examples/jruby-example/resources/index.html (rev 0) +++ trunk/examples/jruby-example/resources/index.html 2007-05-23 03:58:29 UTC (rev 69) @@ -0,0 +1,14 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <title></title> +</head> +<body> + <h1>Waffle JRuby example</h1> +<p> + <a href="" default method (index) on the Ruby Controller</a><br/> + <a href="" the 'bar' method on the Ruby Controller</a><br/> +</p> +</body> +</html> \ No newline at end of file
Added: trunk/examples/jruby-example/src/main/java/org/codehaus/waffle/example/jruby/JRubyRegistrar.java (0 => 69)
--- trunk/examples/jruby-example/src/main/java/org/codehaus/waffle/example/jruby/JRubyRegistrar.java (rev 0) +++ trunk/examples/jruby-example/src/main/java/org/codehaus/waffle/example/jruby/JRubyRegistrar.java 2007-05-23 03:58:29 UTC (rev 69) @@ -0,0 +1,35 @@ +package org.codehaus.waffle.example.jruby; + +import org.codehaus.waffle.registrar.AbstractRegistrar; +import org.codehaus.waffle.registrar.Registrar; +import org.codehaus.waffle.registrar.pico.PicoRegistrar; +import org.codehaus.waffle.registrar.pico.RubyScriptComponentAdapter; +import org.jruby.Ruby; +import org.picocontainer.ComponentAdapter; + +public class JRubyRegistrar extends AbstractRegistrar { + private PicoRegistrar picoRegistrar; + Ruby runtime = Ruby.getDefaultInstance(); + + public JRubyRegistrar(Registrar delegate) { + super(delegate); + picoRegistrar = (PicoRegistrar) delegate; + } + + @Override + public void application() { + + String script = + "class Foo\n" + + " def index\n" + + " 'HELLO WORLD from the index method'\n" + + " end\n" + + " def bar\n" + + " 'HELLO WORLD'\n" + + " end\n" + + "end\n"; + + ComponentAdapter componentAdapter = new RubyScriptComponentAdapter("Foo", script); + picoRegistrar.registerComponentAdapter(componentAdapter); + } +}
Added: trunk/examples/jruby-example/src/main/webapp/WEB-INF/web.xml (0 => 69)
--- trunk/examples/jruby-example/src/main/webapp/WEB-INF/web.xml (rev 0) +++ trunk/examples/jruby-example/src/main/webapp/WEB-INF/web.xml 2007-05-23 03:58:29 UTC (rev 69) @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<web-app version="2.4" + xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + + <display-name>Waffle JRuby Example</display-name> + + <!-- 1. This is how an application registers its custom Registrar --> + <context-param> + <param-name>org.codehaus.waffle.registrar.Registrar</param-name> + <param-value>org.codehaus.waffle.example.jruby.JRubyRegistrar</param-value> + </context-param> + + <!-- Ruby Specifics components --> + <context-param> + <param-name>org.codehaus.waffle.context.ContextContainerFactory</param-name> + <param-value>org.codehaus.waffle.context.pico.RubyAwarePicoContextContainerFactory</param-value> + </context-param> + <context-param> + <param-name>org.codehaus.waffle.bind.DataBinder</param-name> + <param-value>org.codehaus.waffle.bind.RubyDataBinder</param-value> + </context-param> + <context-param> + <param-name>org.codehaus.waffle.controller.ControllerDefinitionFactory</param-name> + <param-value>org.codehaus.waffle.controller.RubyControllerDefinitionFactory</param-value> + </context-param> + + <listener> + <listener-class>org.codehaus.waffle.context.pico.PicoWaffleContextListener</listener-class> + </listener> + + <!-- 4. Waffle request filter (responsible for request level context) --> + <filter> + <filter-name>WaffleRequestFilter</filter-name> + <filter-class>org.codehaus.waffle.context.WaffleRequestFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>WaffleRequestFilter</filter-name> + <url-pattern>*.waffle</url-pattern> + </filter-mapping> + + <!-- 5. Register Waffle's FrontController servlet --> + <servlet> + <servlet-name>waffle</servlet-name> + <servlet-class>org.codehaus.waffle.servlet.WaffleServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>waffle</servlet-name> + <url-pattern>*.waffle</url-pattern> + </servlet-mapping> +</web-app>
Added: trunk/examples/jruby-example/src/test/java/org/codehaus/waffle/example/jruby/RubyRegistrarTest.java (0 => 69)
--- trunk/examples/jruby-example/src/test/java/org/codehaus/waffle/example/jruby/RubyRegistrarTest.java (rev 0) +++ trunk/examples/jruby-example/src/test/java/org/codehaus/waffle/example/jruby/RubyRegistrarTest.java 2007-05-23 03:58:29 UTC (rev 69) @@ -0,0 +1,106 @@ +package org.codehaus.waffle.example.jruby; + +import junit.framework.TestCase; +import org.jruby.Ruby; +import org.jruby.RubyArray; +import org.jruby.javasupport.JavaUtil; +import org.jruby.runtime.builtin.IRubyObject; + +import java.util.Map; + +public class RubyRegistrarTest extends TestCase { + + /* + + Need to create an interface that sets the PicoContainer instance onto the Ruby Controller + + WaffleRubyControllerProxy.__setWaffleContext(...PicoContainer...) + + An associated module will be mixed in with the controller + + module Waffle + module Controller + def __waffle_context=(waffle_context) + @@__waffle_context = waffle_context + end + + def method_missing + check the waffle context ... + end + + .. params, request, response + end + + end + + class FoobarController + + def index + + end + + end + + */ + + // sandbox test for figuring out JRuby + public void testJRuby() { + Ruby runtime = Ruby.getDefaultInstance(); + + String script = "class Foo\n" + + " attr_accessor :salmon\n" + + " def initialize\n" + + " @salmon = 'fish'\n" + + " end\n" + + " def bar\n" + + " return \"HELLO #{salmon}!\"\n" + + " end\n" + + "end\n"; + + runtime.evalScript(script); + + IRubyObject foo = runtime.evalScript("foo = Foo.new()"); + foo.callMethod(runtime.getCurrentContext(), "bar"); + IRubyObject salmon = runtime.evalScript("foo.salmon"); + + RubyArray rubyArray = (RubyArray) runtime.evalScript("foo.instance_variables"); + assertEquals("@salmon", rubyArray.get(0)); + + Map iVars = foo.getInstanceVariables(); + assertEquals(JavaUtil.convertJavaToRuby(runtime, "fish"), iVars.get("@salmon")); + + assertEquals("HELLO fish!", runtime.evalScript("foo.bar").toString()); + foo.callMethod(runtime.getCurrentContext(), "salmon=", JavaUtil.convertJavaToRuby(runtime, "shark")); + assertEquals("HELLO shark!", runtime.evalScript("foo.bar").toString()); + + script = + "class Foo\n" + + " def bar\n" + + " \"GOODBYE\"\n" + + " end\n"+ + "end"; + runtime.evalScript(script); + assertEquals("GOODBYE", runtime.evalScript("foo.bar").toString()); + + String module = + "module Calculator\n" + + "def one\n" + + " \"xxxx [EMAIL PROTECTED]"\n" + + "end\n" + + "end\n" + + "\n" + + "Calculator # return the created Module"; + + IRubyObject the_module = runtime.evalScript(module); + foo.callMethod(runtime.getCurrentContext(), "extend", the_module); + runtime.evalScript("p foo.one"); + + Object javaX = JavaUtil.convertRubyToJava(rubyArray); + Object javaObj = JavaUtil.convertRubyToJava(salmon); + + System.out.println("x = " + javaX); + System.out.println("javaObj = " + javaObj); + } + + +}
Modified: trunk/examples/paranamer-example/pom.xml (68 => 69)
--- trunk/examples/paranamer-example/pom.xml 2007-05-23 03:24:33 UTC (rev 68) +++ trunk/examples/paranamer-example/pom.xml 2007-05-23 03:58:29 UTC (rev 69) @@ -1,93 +1,94 @@ <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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.codehaus.waffle</groupId> - <artifactId>waffle-parent</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> - <artifactId>waffle-paranamer-example</artifactId> - <packaging>war</packaging> - <name>Waffle Paranamer Example</name> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.codehaus.waffle</groupId> + <artifactId>waffle-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <artifactId>waffle-paranamer-example</artifactId> + <packaging>war</packaging> + <name>Waffle Paranamer Example</name> - <dependencies> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>waffle</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>com.thoughtworks.paranamer</groupId> - <artifactId>paranamer</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jstl</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>taglibs</groupId> - <artifactId>standard</artifactId> - <scope>runtime</scope> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>waffle</artifactId> + <version>${pom.version}</version> + </dependency> + <dependency> + <groupId>com.thoughtworks.paranamer</groupId> + <artifactId>paranamer</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <scope>runtime</scope> + </dependency> + </dependencies> - <build> - <plugins> - <plugin> - <groupId>com.thoughtworks.paranamer</groupId> - <artifactId>paranamer-maven-plugin</artifactId> - <configuration> - <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory> - <outputDirectory>${basedir}/src/main/resources</outputDirectory> - </configuration> - <executions> - <execution> - <id>generate</id> - <goals> - <goal>generate</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <version>2.0</version> - <configuration> - <warName>${pom.artifactId}</warName> - <webResources> - <resource> - <directory>${basedir}/resources</directory> - </resource> - </webResources> - </configuration> - </plugin> - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>deploy-webapp</id> - <phase>install</phase> - <configuration> - <tasks> - <echo>Deploying webapp</echo> - <copy file="target/${pom.artifactId}.war" todir="${webapp.deploy.dir}" verbose="true" overwrite="true" /> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> + <build> + <plugins> + <plugin> + <groupId>com.thoughtworks.paranamer</groupId> + <artifactId>paranamer-maven-plugin</artifactId> + <configuration> + <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory> + <outputDirectory>${basedir}/src/main/resources</outputDirectory> + </configuration> + <executions> + <execution> + <id>generate</id> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>2.0</version> + <configuration> + <warName>${pom.artifactId}</warName> + <webResources> + <resource> + <directory>${basedir}/resources</directory> + </resource> + </webResources> + </configuration> + </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>deploy-webapp</id> + <phase>install</phase> + <configuration> + <tasks> + <echo>Deploying webapp</echo> + <copy file="target/${pom.artifactId}.war" todir="${webapp.deploy.dir}" verbose="true" + overwrite="true"/> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project>
To unsubscribe from this list please visit:
