vmassol     2004/03/17 07:19:46

  Added:       jetty    plugin.properties plugin.jelly .cvsignore
                        project.properties project.xml
               jetty/xdocs changes.xml properties.xml navigation.xml
                        goals.xml .cvsignore index.xml
  Log:
  First cut at a jetty plugin. It currently supports:

  - generation of jetty xml config file

  - jetty execution
  
  Revision  Changes    Path
  1.1                  maven-plugins/jetty/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  # -------------------------------------------------------------------
  # Copyright 2004 The Apache Software Foundation.
  # 
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  # 
  #      http://www.apache.org/licenses/LICENSE-2.0
  #  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  # -------------------------------------------------------------------
  
  # Port on which Jetty will be started.
  maven.jetty.port = 8080
  
  # (optional) Specify a custom Jetty XML config file. If this property
  # is not defined the config file will be generated automatically by
  # the plugin
  # ex: maven.jetty.config.xml = conf/jetty.xml
  
  
  
  1.1                  maven-plugins/jetty/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  <?xml version="1.0"?>

  

  <!-- 

  /*

   * Copyright 2004 The Apache Software Foundation.

   * 

   * Licensed under the Apache License, Version 2.0 (the "License");

   * you may not use this file except in compliance with the License.

   * You may obtain a copy of the License at

   * 

   *      http://www.apache.org/licenses/LICENSE-2.0

   * 

   * Unless required by applicable law or agreed to in writing, software

   * distributed under the License is distributed on an "AS IS" BASIS,

   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

   * See the License for the specific language governing permissions and

   * limitations under the License.

   */

  -->

  

  <project

    xmlns:j="jelly:core"

    xmlns:ant="jelly:ant"

    xmlns:x="jelly:xml">

  

    <goal name="jetty" description="Run Jetty" prereqs="jetty:run"/>

  

    <goal name="jetty:prepare-filesystem">

  

        <ant:mkdir dir="${maven.build.dir}/jetty"/>

  

    </goal>

    

    <goal name="jetty:config" prereqs="jetty:prepare-filesystem"

        description="Generate a Jetty configuration file">

  

      <!-- Only generate if the maven.jetty.config.xml property is not set. This

           allows for custom fine-grained configurations -->

      <j:if test="${context.getVariable('maven.jetty.config.xml') == null}">

  

        <j:set var="maven.jetty.config.xml"

            value="${maven.build.dir}/jetty.xml"/>

            

        <j:file name="${maven.jetty.config.xml}" prettyPrint="true" 

            xmlns="jetty">

  

          <x:doctype name="Configure" publicId="-//Mort Bay Consulting//DTD Configure 
1.2//EN" systemId="http://jetty.mortbay.org/configure_1_2.dtd"/>

  

          <Configure class="org.mortbay.jetty.Server">

            <Call name="addListener">

              <Arg>

                <New class="org.mortbay.http.SocketListener">

                   <Set name="Port">${maven.jetty.port}</Set>

                </New>

              </Arg>

            </Call>

  

            <!-- If current project is a WAR project add the war -->

            <j:if test="${context.getVariable('maven.jetty.project.type') == 'war'}">

              <Call name="addWebApplication">

                <!-- Note: We need to go through a variable. Otherwise 

                     outputting directly <Arg>/${dep.artifactId}/*</Arg>

                     leads to a space between the "/" and the context 

                     name -->

                <j:set var="context" value="/${pom.artifactId}/*"/>

                <Arg>${context}</Arg>

                <j:set var="artifact" 
value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.build.dir')}/${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.final.name')}"/>

                <Arg>${artifact}</Arg>

              </Call>

            </j:if>          

                       

            <!-- Add dependencies to Jetty config. -->

            <j:forEach var="lib" items="${pom.artifacts}">

              <j:set var="dep" value="${lib.dependency}"/>      

              <j:if test="${dep.getProperty('jetty.bundle')=='true'}">

  

                <!-- Handle WARs -->

                <j:if test="${dep.type == 'war'}">

  

                  <Call name="addWebApplication">

                    <!-- Note: We need to go through a variable. Otherwise 

                         outputting directly <Arg>/${dep.artifactId}/*</Arg>

                         leads to a space between the "/" and the context 

                         name -->

                    <j:set var="context" value="/${dep.artifactId}/*"/>

                    <Arg>${context}</Arg>

                    <Arg>${lib.path}</Arg>

                  </Call>

  

                </j:if>

                

              </j:if>

            </j:forEach>

  

          </Configure>

          

        </j:file>

  

      </j:if>

      

    </goal>

    

    <goal name="jetty:run" description="Run Jetty" prereqs="jetty:config">

  

      <ant:java classname="org.mortbay.jetty.Server" fork="true">

        <ant:arg value="${maven.jetty.config.xml}"/>      

        <ant:classpath>

          <ant:pathelement 
location="${plugin.getDependencyPath('jetty:org.mortbay.jetty')}"/>

          <ant:pathelement 
location="${plugin.getDependencyPath('servletapi:servletapi')}"/>

          <ant:pathelement 
location="${plugin.getDependencyPath('tomcat:jasper-compiler')}"/>

          <ant:pathelement 
location="${plugin.getDependencyPath('tomcat:jasper-runtime')}"/>

        </ant:classpath>

      </ant:java>

  

    </goal>

  

    <goal name="jetty:run-war" prereqs="war:war"

        description="Run Jetty on the current war project">

  

      <j:set var="maven.jetty.project.type" value="war"/>

      <attainGoal name="jetty:run"/>        

        

    </goal>

    

  </project>

  
  
  
  1.1                  maven-plugins/jetty/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  target
  velocity.log
  maven.log
  build.properties
  .classpath
  .project
  
  
  
  1.1                  maven-plugins/jetty/project.properties
  
  Index: project.properties
  ===================================================================
  # -------------------------------------------------------------------
  # Copyright 2004 The Apache Software Foundation.
  # 
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  # 
  #      http://www.apache.org/licenses/LICENSE-2.0
  #  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  # -------------------------------------------------------------------
  
  # -------------------------------------------------------------------
  # P R O J E C T  P R O P E R T I E S
  # -------------------------------------------------------------------
  maven.xdoc.date=left
  maven.xdoc.version=${pom.currentVersion}
  maven.license.licenseFile=${basedir}/../LICENSE.txt
  
  
  
  
  1.1                  maven-plugins/jetty/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <!-- 
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  
  <project>
    <extend>../project.xml</extend>
    <pomVersion>3</pomVersion>
    <id>maven-jetty-plugin</id>
    <name>Maven Jetty plugin</name>
    <currentVersion>1.0-SNAPSHOT</currentVersion>
    <shortDescription>Run Jetty</shortDescription>
    <url>http://maven.apache.org/reference/plugins/jetty/</url>
    
<issueTrackingUrl>http://jira.codehaus.org/BrowseProject.jspa?id=xxx</issueTrackingUrl>
    <siteDirectory>/www/maven.apache.org/reference/plugins/jetty/</siteDirectory>
    <repository>
      <connection>scm:cvs:pserver:[EMAIL 
PROTECTED]:/home/cvspublic:maven-plugins/jetty/</connection>
      <developerConnection>scm:cvs:ext:[EMAIL 
PROTECTED]:/home/cvs:maven-plugins/jetty/</developerConnection>
      <url>http://cvs.apache.org/viewcvs/maven-plugins/jetty/</url>
    </repository>
    <versions>
      <version>
        <id>1.0</id>
        <name>1.0</name>
        <tag>HEAD</tag>
      </version>
    </versions>
    <developers>
      <developer>
        <name>Vincent Massol</name>
        <id>vmassol</id>
        <email>[EMAIL PROTECTED]</email>
        <organization>Pivolis</organization>
        <roles>
          <role>Creator</role>
          <role>Java Developer</role>
        </roles>
      </developer>
    </developers>
    <dependencies>
      <dependency>
        <groupId>jetty</groupId>
        <artifactId>org.mortbay.jetty</artifactId>
        <version>4.2.17</version>
        <url>http://jetty.mortbay.org</url>
      </dependency>
      <dependency>
        <groupId>servletapi</groupId>
        <artifactId>servletapi</artifactId>
        <version>2.3</version>
      </dependency>
      <dependency>
        <groupId>tomcat</groupId>
        <artifactId>jasper-compiler</artifactId>
        <version>4.0.4</version>
      </dependency>
      <dependency>
        <groupId>tomcat</groupId>
        <artifactId>jasper-runtime</artifactId>
        <version>4.0.4</version>
      </dependency>
    </dependencies>
    <reports>
      <report>maven-changes-plugin</report>
      <report>maven-changelog-plugin</report>
      <report>maven-file-activity-plugin</report>
      <report>maven-developer-activity-plugin</report>
      <report>maven-file-activity-plugin</report>
      <report>maven-license-plugin</report>
      <report>maven-linkcheck-plugin</report>
    </reports>
  </project>
  
  
  
  1.1                  maven-plugins/jetty/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <!-- 
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  
  <document>
    <properties>
      <title>Jetty plugin changes</title>
      <author email="[EMAIL PROTECTED]">Vincent Massol</author>
    </properties>
    <body>
      <release version="1.0" date="in CVS">
        <action dev="vmassol" type="add">
          Plugin creation.
        </action>
      </release>
    </body>
  </document>
  
  
  
  1.1                  maven-plugins/jetty/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <!-- 
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  
  <document>
  
    <properties>
      <title>Jetty plugin properties</title>
      <author email="[EMAIL PROTECTED]">Vincent Massol</author>
    </properties>
  
    <body>
      <section name="Jetty plugin properties">
        <table>
          
<tr><th>Property</th><th>Optional?</th><th>Description</th><th>Default</th></tr>
          <tr>
            <td>maven.jetty.port</td>
            <td>Yes</td>
            <td>
              Port on which Jetty will be started.
            </td>
            <td>
              8080
            </td>
          </tr>
          <tr>
            <td>maven.jetty.config.xml</td>
            <td>Yes</td>
            <td>
              Custom Jetty XML configuration file.
            </td>
            <td>
              No default. By default this file is generated by the plugin.
            </td>
          </tr>
        </table>
      </section>
    </body>
  
  </document>
  
  
  
  1.1                  maven-plugins/jetty/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
    <!-- 
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  
  <project name="Maven Jetty plugin">
  
    <title>Maven Jetty plugin</title>
  
    <body>
      <links>
        <item name="Maven"      href="http://maven.apache.org/"/>
      </links>
      <menu name="Overview">
        <item name="Goals"      href="/goals.html" />
        <item name="Properties" href="/properties.html" />
      </menu>
    </body>
  </project>
  
  
  
  1.1                  maven-plugins/jetty/xdocs/goals.xml
  
  Index: goals.xml
  ===================================================================
  <?xml version="1.0"?>
  
    <!-- 
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  
  <document>
  
    <properties>
      <title>Maven Jetty plugin goals</title>
      <author email="[EMAIL PROTECTED]">Vincent Massol</author>
    </properties>
  
    <body>
      <section name="Goals">
        <table>
          <tr><th>Goal</th><th>Description</th></tr>
          <tr>
            <td>jetty</td>
            <td>
              Run Jetty.
            </td>
          </tr>
          <tr>
            <td>jetty:run</td>
            <td>
              Run Jetty.
            </td>
          </tr>
          <tr>
            <td>jetty:run-war</td>
            <td>
              Run Jetty, adding the current WAR project to the contexts.
            </td>
          </tr>
          <tr>
            <td>jetty:config</td>
            <td>
              Generate a Jetty XML configuration file.
            </td>
          </tr>
        </table>
      </section>
   </body>
  </document>
  
  
  
  1.1                  maven-plugins/jetty/xdocs/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  stylesheets
  
  
  
  1.1                  maven-plugins/jetty/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0"?>
  
    <!-- 
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  
  <document>
  
    <properties>
      <title>Maven Jetty plugin</title>
      <author email="[EMAIL PROTECTED]">Vincent Massol</author>
    </properties>
  
    <body>
      <section name="Maven Jetty plugin">
        <p>
          This plugin starts Jetty on the J2EE modules specified as
          dependencies.
        </p>
      </section>
   </body>
  
  </document>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to