Maven2

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
Resin 3.1 has a Maven2 snapshot repository at http://caucho.com/m2-snapshot
 
Resin 3.1 has a Maven2 snapshot repository at http://caucho.com/m2-snapshot
  
The Resin Maven plugin supports the following command:
+
The Resin Maven plugin supports the following commands:
  
 
   mvn resin:run
 
   mvn resin:run
 +
  mvn resin:jspc
  
Which starts a Resin instance pointing to your build directory
+
resin:run starts a Resin instance pointing to your build directory
 +
 
 +
resin:jspc compiles JSP files in the build directory
  
 
== Pointing Resin to the build directory ==
 
== Pointing Resin to the build directory ==
Line 11: Line 14:
 
Resin can point a web-app directly to the Maven build directory, letting you deploy automatically without involving any extra maven plugins.  The resin.conf configuration looks like:
 
Resin can point a web-app directly to the Maven build directory, letting you deploy automatically without involving any extra maven plugins.  The resin.conf configuration looks like:
  
 +
<code><pre>
 
  <resin xmlns="http://caucho.com/ns/resin">
 
  <resin xmlns="http://caucho.com/ns/resin">
 
     ...
 
     ...
Line 20: Line 24:
 
                             root-directory="/home/ferg/maven/my-webapp/target/my-webapp"/>
 
                             root-directory="/home/ferg/maven/my-webapp/target/my-webapp"/>
 
         ...
 
         ...
 +
</pre></code>
  
 
You can also grab a generated .war file directly and have it expand into your own Resin workspace, by setting the 'archive-path' attribute of a <web-app> defined in the resin.conf:
 
You can also grab a generated .war file directly and have it expand into your own Resin workspace, by setting the 'archive-path' attribute of a <web-app> defined in the resin.conf:
  
 +
<code><pre>
 
   <resin ...
 
   <resin ...
 
       ...
 
       ...
Line 30: Line 36:
 
                             archive-path="/home/ferg/maven/my-webapp/target/my-webapp.war"/>
 
                             archive-path="/home/ferg/maven/my-webapp/target/my-webapp.war"/>
 
       ...
 
       ...
 +
</pre></code>
 +
 
== Adding Resin plugin to pom.xml ==
 
== Adding Resin plugin to pom.xml ==
  
 
To add Resin plugins to your maven build, modify the pom.xml as follows:
 
To add Resin plugins to your maven build, modify the pom.xml as follows:
  
 +
<code><pre>
 
  <project ...>
 
  <project ...>
 
   ...
 
   ...
Line 59: Line 68:
 
     </build
 
     </build
 
  </project>
 
  </project>
 +
</pre></code>
  
 
== resin:run ==
 
== resin:run ==

Revision as of 19:03, 3 February 2008

Resin 3.1 has a Maven2 snapshot repository at http://caucho.com/m2-snapshot

The Resin Maven plugin supports the following commands:

 mvn resin:run
 mvn resin:jspc

resin:run starts a Resin instance pointing to your build directory

resin:jspc compiles JSP files in the build directory

Contents

Pointing Resin to the build directory

Resin can point a web-app directly to the Maven build directory, letting you deploy automatically without involving any extra maven plugins. The resin.conf configuration looks like:

 <resin xmlns="http://caucho.com/ns/resin">
    ...
    <cluster id="">
      ...
      <host id="">
        ...
        <web-app id="my-webapp" 
                            root-directory="/home/ferg/maven/my-webapp/target/my-webapp"/>
        ...

You can also grab a generated .war file directly and have it expand into your own Resin workspace, by setting the 'archive-path' attribute of a <web-app> defined in the resin.conf:

  <resin ...
      ...
      <host id="">
      ...
         <web-app id="/my-webapp" root-directory="my-webapp-dir"
                             archive-path="/home/ferg/maven/my-webapp/target/my-webapp.war"/>
      ...

Adding Resin plugin to pom.xml

To add Resin plugins to your maven build, modify the pom.xml as follows:

 <project ...>
   ...
 
    <pluginRepositories>
      <pluginRepository>
        <id>caucho-snap</id>
        <name>Caucho Snapshots</name>
        <url>http://caucho.com/m2-snapshot</url>
      </pluginRepository>
    </pluginRepositories>
 
   ...
 
    <build>
      ...
      <plugins>
        <plugin>
          <groupId>caucho.com</groupId>
          <artifactId>resin-maven-plugin</artifactId>
          <version>3.1-SNAPSHOT</version>
        </plugin>
      </plugins>
 
    </build
 </project>

resin:run

On the command line, you can then use

 mvn resin:run

resin:run will start a new Resin instance based on your maven build area. You can then browse the instance directly to verify your code.

resin:jspc

The resin:jspc plugin will precompile any JSP files in your project, putting the compiled classes in the usual WEB-INF/work.

Personal tools