Configurando plugin maven do jetty via jetty.xml

2 respostas
W

Olá Pessoal

Eu crie um programa com o mvn archetype:generate, opção 20, que é um projeto seam com myfaces e que usa um plugin maven do jetty pra subir. Até aí tudo ótimo, sobe direitinho. Só que eu precisaria que o jetty, no momento que ele estivesse “subindo”, qdo executo o goal jetty:run, que ele fizesse o deploy de um outro arquivo war que que eu coloquei na pasta “/others_wars” a qual está na raiz do meu projeto maven. Esse outro war se chama bridge.war.
Portanto, eu preciso que quando o jetty terminasse de subir me disponibilizasse além do war do meu próprio programa maven, também esse outro bridge.war.

Pra resolver isso, dei uma pesquisada, e descobri que posso pedir pro plugin maven do jetty subir configurando o jetty via um arquivo xml, o jetty.xml.
Então, pra dizer pro plugin do jetty o usar o tal jetty.xml, usei a seguinte tag, dentro do meu pom.xml,

<jettyConfig>
					       jetty.xml
					</jettyConfig>

Eu lí, não lembro onde, que é através desse jetty.xml que eu peço pro jetty subir o meu outro war, que seria o meu bridge.war.

Conteúdo do meu jetty.xml ficou assim:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Call name="addLifeCycle">
  <Arg>
    <New class="org.mortbay.jetty.deployer.WebAppDeployer">
      <Set name="contexts"><Ref id="Contexts"/></Set>
      <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/others_wars</Set>
      <Set name="parentLoaderPriority">false</Set>
      <Set name="extract">true</Set>
      <Set name="allowDuplicates">false</Set>
      <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
    </New>
  </Arg>
</Call>

Não funcionou! O Jetty nem subiu.
Então tentei encontrei um jetty.xml “mais completo” que é o seguinte: (Vejam que eu configurei nesse outro jetty.xml o WebAppDeployer da mesma forma)

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

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

    <!-- =========================================================== -->
    <!-- Server Thread Pool                                          -->
    <!-- =========================================================== -->
    <Set name="ThreadPool">
      <New class="org.mortbay.thread.QueuedThreadPool">
        <!-- initial threads set to 10 -->
        <Set name="minThreads">10</Set>

        <!-- the thread pool will grow only up to 200 -->
        <Set name="maxThreads">200</Set>

        <!-- indicates that having 20 and below, the pool will be considered low on threads -->
        <Set name="lowThreads">20</Set>

        <!-- The number of queued jobs (or idle threads) needed before the thread pool is grown (or shrunk) -->
        <Set name="SpawnOrShrinkAt">2</Set>
      </New>
    </Set>



    <!-- =========================================================== -->
    <!-- Set connectors                                              -->
    <!-- =========================================================== -->

    <Call name="addConnector">
      <Arg>
          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
            <!-- the ip address or domain to bind -->
            <Set name="host"><SystemProperty name="jetty.host" /></Set>

            <!-- the port to use/bind, defaults to 8080 if property not set -->
            <Set name="port"><SystemProperty name="jetty.port" default="8090"/></Set>

            <!-- the time in milliseconds when a connection is considered idle -->
            <Set name="maxIdleTime">300000</Set>

            <!-- the number of acceptors (their job is to accept the connection and dispatch to thread pool) -->
            <Set name="Acceptors">2</Set>

            <!-- should the connection statistics be turned on? (Not advisable in production) -->
            <Set name="statsOn">false</Set>

            <!-- the confidential port -->
            <Set name="confidentialPort">8443</Set>

            <!-- indicates the minimum number of connections when the server is considered low on resources -->
	    <Set name="lowResourcesConnections">20000</Set>

            <!-- when low on resources, this indicates the maximum time (milliseconds) a connection must be idle to not be closed -->
	    <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>

    <!-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -->
    <!-- To add a HTTPS SSL connector                                    -->
    <!-- mixin jetty-ssl.xml:                                            -->
    <!--   java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml           -->
    <!-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -->

    <!-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -->
    <!-- To add a HTTP blocking connector                                -->
    <!-- mixin jetty-bio.xml:                                            -->
    <!--   java -jar start.jar etc/jetty.xml etc/jetty-bio.xml           -->
    <!-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -->


    <!-- =========================================================== -->
    <!-- Set handler Collection Structure                            -->
    <!-- =========================================================== -->
    <Set name="handler">
      <!-- the collection of handlers that will handle the request -->
      <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.mortbay.jetty.Handler">
           <!-- primarily handles the request and maps the request to a ContextHandler -->
           <Item>
             <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
           </Item>

           <!-- The default handler ... handles the request if not yet handled -->
           <Item>
             <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
           </Item>

           <!-- The handler for your request logs -->
           <Item>
             <New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
           </Item>
         </Array>
        </Set>
      </New>
    </Set>

    <!-- =========================================================== -->
    <!-- Configure the context deployer                              -->
    <!-- A context deployer will deploy contexts described in        -->
    <!-- configuration files discovered in a directory.              -->
    <!-- The configuration directory can be scanned for hot          -->
    <!-- deployments at the configured scanInterval.                 -->
    <!--                                                             -->
    <!-- This deployer is configured to deploy contexts configured   -->
    <!-- in the $JETTY_HOME/contexts directory                       -->
    <!--                                                             -->
    <!-- =========================================================== -->
    <Call name="addLifeCycle">
      <Arg>
        <New class="org.mortbay.jetty.deployer.ContextDeployer">
          <!-- the ContextHandlerCollection to modify once a webapp is added or removed (Allows Hot Deployment) -->
          <Set name="contexts"><Ref id="Contexts"/></Set>

          <!-- the directory which will contain your context.xml files -->
          <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>

          <!-- the interval in milliseconds to periodically scan the configurationDir -->
          <Set name="scanInterval">5</Set>
        </New>
      </Arg>
    </Call>

    <!-- =========================================================== -->
    <!-- Configure the webapp deployer.                              -->
    <!-- A webapp  deployer will deploy standard webapps discovered  -->
    <!-- in a directory at startup, without the need for additional  -->
    <!-- configuration files.    It does not support hot deploy or   -->
    <!-- non standard contexts (see ContextDeployer above).          -->
    <!--                                                             -->
    <!-- This deployer is configured to deploy webapps from the      -->
    <!-- $JETTY_HOME/webapps directory                               -->
    <!--                                                             -->
    <!-- Normally only one type of deployer need be used.            -->
    <!--                                                             -->
    <!-- =========================================================== -->


[color=red] 
<!-- MINHA NOVA TENTATIVA DE FAZER O JETTY SUBIR MEU bridge.war que esta na pasta /others_wars-->
<!-- MINHA NOVA TENTATIVA DE FAZER O JETTY SUBIR MEU bridge.war que esta na pasta /others_wars-->
<!-- MINHA NOVA TENTATIVA DE FAZER O JETTY SUBIR MEU bridge.war que esta na pasta /others_wars-->
    <Call name="addLifeCycle">
      <Arg>
        <New class="org.mortbay.jetty.deployer.WebAppDeployer">
          <!-- the ContextHandlerCollection to add the webapps to -->
          <Set name="contexts"><Ref id="Contexts"/></Set>

          <!-- the directory where all the webapps are located (can be exploded or packaged as war -->
          <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/others_wars</Set>

          <!-- indicates whether to lookup/load from the parent class loader first-->
	  <Set name="parentLoaderPriority">false</Set>

          <!-- indicates whether to extract the webapp if it is packaged as a war -->
	  <Set name="extract">true</Set>

          <!-- indicates whether a deployed webapp on a certain contextPath should have a duplicate webapp deployment -->
	  <Set name="allowDuplicates">false</Set>

          <!-- the default descriptor to use to be applied before a webapps' web.xml -->
          <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
        </New>
      </Arg>
    </Call>
[/color]




    <!-- =========================================================== -->
    <!-- Configure Authentication Realms                             -->
    <!-- Realms may be configured for the entire server here, or     -->
    <!-- they can be configured for a specific web app in a context  -->
    <!-- configuration (see $(jetty.home)/contexts/test.xml for an   -->
    <!-- example).                                                   -->
    <!-- =========================================================== -->
    <Set name="UserRealms">
      <Array type="org.mortbay.jetty.security.UserRealm">
        <Item>
          <!-- this realm uses a properties file to store/read the user/password/roles -->
          <New class="org.mortbay.jetty.security.HashUserRealm">
            <!-- the name of the realm -->
            <Set name="name">Test Realm</Set>

            <!-- the location of the property file to load from -->
            <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>

            <!-- the interval in seconds to periodically scan for any changes and refresh/reload if changed -->
            <Set name="refreshInterval">0</Set>
          </New>
        </Item>
      </Array>
    </Set>

    <!-- =========================================================== -->
    <!-- Configure Request Log                                       -->
    <!-- Request logs  may be configured for the entire server here, -->
    <!-- or they can be configured for a specific web app in a       -->
    <!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
    <!-- for an example).                                            -->
    <!-- =========================================================== -->
    <Ref id="RequestLog">
      <Set name="requestLog">
        <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
          <!-- the output file name of the log file. Name of the file will be date formatted -->
          <Set name="filename"><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Set>

          <!-- the date format -->
          <Set name="filenameDateFormat">yyyy_MM_dd</Set>

          <!-- the days to retain the log file -->
          <Set name="retainDays">90</Set>

          <!-- indicates if the new lines should be appended on an existing log file -->
          <Set name="append">true</Set>

          <!-- indicates if the lines logged to the file will be in extended format -->
          <Set name="extended">true</Set>

          <!-- Indicates if the cookie logs should be included in the log file -->
          <Set name="logCookies">false</Set>

          <!-- the timezone of the log -->
          <Set name="LogTimeZone">GMT</Set>
        </New>
      </Set>
    </Ref>

    <!-- =========================================================== -->
    <!-- extra options                                               -->
    <!-- =========================================================== -->

    <!-- Stops the server when ctrl+c is pressed (registers to Runtime.addShutdownHook)
    <Set name="stopAtShutdown">true</Set>

    <!-- send the server version in the response header? -->
    <Set name="sendServerVersion">true</Set>

    <!-- send the date header in the response header? -->
    <Set name="sendDateHeader">true</Set>

    <!-- allows requests(prior to shutdown) to finish gracefully -->
    <Set name="gracefulShutdown">1000</Set>

</Configure>

Não deu certo, o jetty nem subiu!

[color=red]
Minhas pergunta são as seguintes:

  1. Como eu configuro esse jetty.xml pro jetty subir?
  2. Como eu configuro esse jetty.xml pra fazer o jetty fazer o deploy do meu bridge.war?
    [/color]

Sou usuário novo do Jetty e manjo pouco desse jetty.xml.
Obrigado.


O - M E U - P O M - C O M P L E T O - É - E S S E :

<?xml version="1.0" encoding="UTF-8"?>
<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">

	<!-- 1 -->
	<modelVersion>4.0.0</modelVersion>
	<groupId>br.com.jwwm</groupId>
	<artifactId>igreja</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>A custom project using myfaces, facelets and seam.</name>
	<url>http://www.example.com</url>


	<build>
		<defaultGoal>install</defaultGoal>
		<finalName>igreja</finalName>

		<filters>
			<filter>jdbc.properties</filter>
		</filters>

		<resources>
			<resource>
				<directory>src/main/resources-filter</directory>
				<filtering>true</filtering>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>

		<testResources>
			<testResource>
				<directory>src/test/resources-filter</directory>
				<filtering>true</filtering>
			</testResource>
			<testResource>
				<directory>src/test/resources</directory>
			</testResource>
		</testResources>

		<plugins> <!-- =================================<build - plugins>============================ -->
		  <!--|
		    |   J E T T Y      P L U G I N    C O N F I G U R A T I O N
		    |   see jettyConfiguration.txt
		    |-->
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>maven-jetty-plugin</artifactId>
				<!-- version>6.0.1</version -->
				<version>6.1.6rc0</version>

				<configuration>
			        <!-- Configure the webapp -->
				        <contextPath>/igreja</contextPath>

 					<!-- tmpDir></tmpDir -->

					<!--					
					webDefaultXml Optional. 
					A webdefault.xml file to use instead of the supplied jetty default for the webapp
					<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
					-->

					<!--						
					? overrideWebXml Optional. 
					  A web.xml file which will be applied AFTER the webapp's web.xml. 
					  This file can be stored anywhere. 
					  It is used to add or modify the configuration of a web.xml for different
					  environments eg test, production etc.
 	 				  <overrideWebXml>src/main/resources/override-web.xml</overrideWebXml>
					-->

					<!-- isso nao ta funcionando...						
					<webApp>
					/media/devExt3/WORKING-SPACE/workspaces_maven/jwwm_projects/igreja/bridge.war
					</webApp>
					-->


					<!--		
					|
					|TODO fazer o jetty escanear uma pasta para fazer deploy
					|     dos wars que estiver dentro dela, um war necessario
					|     para subir he o bridge.war
					|-->
					<jettyConfig>
					jetty.xml
					</jettyConfig>
					


					<!-- JETTY-JNDI ENV CONFIGURATION
					 <jettyEnvXml>${jetty.env.file}</jettyEnvXml>
					-->
		
					
					<connectors>
						<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
							<port>8090</port>
							<host>0.0.0.0</host>
						</connector>
					</connectors>
					

				        <stopPort>9966</stopPort>
                                        <stopKey>nicolas1</stopKey>
					<scanIntervalSeconds>10</scanIntervalSeconds>
				</configuration>

           			<dependencies>
				</dependencies>
			</plugin>

			<plugin>
				<groupId>cz.softeu.seamgen</groupId>
				<artifactId>maven-seam-plugin</artifactId>
   <!--                         <version>1.0-SNAPSHOT</version> -->
				<configuration>
					<modelPackage>br.com.jwwm.model</modelPackage>
					<actionPackage>br.com.jwwm.action</actionPackage>
					<testPackage>br.com.jwwm.test</testPackage>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<inherited>true</inherited>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
					<encoding>utf-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-eclipse-plugin</artifactId>
				<configuration>
					<downloadSources>true</downloadSources>
					<downloadJavadocs>true</downloadJavadocs>
					<!-- wtpversion>1.0</wtpversion -->
					<wtpversion>2.0 R7</wtpversion>
				</configuration>
			</plugin>
			<plugin>
        			<groupId>org.codehaus.cargo</groupId>
			        <artifactId>cargo-maven2-plugin</artifactId>
				<!--  NAO ESTOU UTILIZANDO CARGO, PRECISO ESTUDAR EM QUE ELE REALMENTE ME AJUDA...
				<configuration>
				   <container>
     					<containerId>jetty6x</containerId>
					<type>embedded</type>
				   </container>
				 </configuration>
				-->
			</plugin>
		</plugins>
	</build>




	<reporting>
		<plugins>
			<plugin>
				<artifactId>maven-changes-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-checkstyle-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-jxr-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-pmd-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-report-plugin</artifactId>
			</plugin>
		</plugins>
	</reporting>



<!-- Project dependencies -->
	<dependencies>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
			<version>4.7</version>
			<scope>test</scope>
			<classifier>jdk15</classifier>
		</dependency>
<!-- url rewriter -->
		<dependency>
			<groupId>cz.softeu</groupId>
			<artifactId>softeu-rewriter</artifactId>
			<version>1.1</version>
			<scope>runtime</scope>
		</dependency>
<!-- SEAM -->
		<dependency>
			<groupId>jboss.seam.profiles</groupId>
			<artifactId>seam-facelets</artifactId>
			<version>${seam.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam.profiles</groupId>
			<artifactId>seam-ajax4jsf</artifactId>
			<version>${seam.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam</groupId>
			<artifactId>jboss-seam-debug</artifactId>
			<version>${seam.version}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam</groupId>
			<artifactId>jboss-seam-mail</artifactId>
			<version>${seam.version}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam.profiles</groupId>
			<artifactId>seam-drools</artifactId>
			<version>${seam.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam.profiles</groupId>
			<artifactId>seam-ejb</artifactId>
			<version>${seam.version}</version>
			<scope>compile</scope>
		</dependency>
	</dependencies>

	<repositories>
<!-- repository for tomahawk -->
		<repository>
			<id>apache-repo</id>
			<name>apache-repo</name>
			<url>http://myfaces.zones.apache.org/dist/maven-repository</url>
		</repository>
		<repository>
			<id>softeu-repo</id>
			<url>http://maven.softeu.cz</url>
		</repository>
	</repositories>


	<pluginRepositories>
		<pluginRepository>
			<id>softeu-repo</id>
			<url>http://maven.softeu.cz</url>
		</pluginRepository>

                <pluginRepository>
                        <id>codehaus-repo</id>
                        <url>http://repository.codehaus.org/</url>
                </pluginRepository>

<!-- jboss RichFaces plugins -->
		<pluginRepository>
		         <id>maven2-snapshots.jboss.com</id>
		         <name>Jboss Repository for Maven Snapshots</name>
		         <url>http://snapshots.jboss.org/maven2</url>
		     <releases>
		       <enabled>false</enabled>
		     </releases>
		     <snapshots>
       			<enabled>true</enabled>
		       <updatePolicy>always</updatePolicy>
		     </snapshots>
		</pluginRepository>

		<pluginRepository>
		         <releases>
        		    <enabled>true</enabled>
        		 </releases>
	        	 <snapshots>
        		    <enabled>false</enabled>
        		    <updatePolicy>never</updatePolicy>
        		 </snapshots>
        		 <id>repository.jboss.com</id>
        		 <name>Jboss Repository for Maven</name>
        		 <url>
		            http://repository.jboss.com/maven2/
		         </url>
		         <layout>default</layout>
		</pluginRepository>

	</pluginRepositories>
	<profiles>
<!--+
    | ========  Database profiles  =======
    +-->
		<profile>
			<id>hsqldb</id>
			<activation>
				<property>
					<name>database</name>
					<value>hsqldb</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>hsqldb</groupId>
					<artifactId>hsqldb</artifactId>
					<version>1.8.0.7</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<jdbc.driverClass>org.hsqldb.jdbcDriver</jdbc.driverClass>
				<hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
			</properties>
		</profile>
		<profile>
			<id>postgresql</id>
			<activation>
				<property>
					<name>database</name>
					<value>postgresql</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>postgresql</groupId>
					<artifactId>postgresql</artifactId>
					<version>8.2-504.jdbc3</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<jdbc.driverClass>org.postgresql.Driver</jdbc.driverClass>
				<hibernate.dialect>org.hibernate.dialect.PostgreSQLDialect</hibernate.dialect>
			</properties>
		</profile>
		<profile>
			<id>oracle</id>
			<activation>
				<property>
					<name>database</name>
					<value>oracle</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>ojdbc</groupId>
					<artifactId>ojdbc</artifactId>
					<version>14</version>
				</dependency>
			</dependencies>
			<properties>
				<jdbc.driverClass>oracle.jdbc.driver.OracleDriver</jdbc.driverClass>
				<hibernate.dialect>org.hibernate.dialect.OracleDialect</hibernate.dialect>
			</properties>
		</profile>
		<profile>
			<id>mysql</id>
			<activation>
				<property>
					<name>database</name>
					<value>mysql</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>mysql</groupId>
					<artifactId>mysql-connector-api</artifactId>
					<version>5.0.4</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<jdbc.driverClass>com.mysql.jdbc.Driver</jdbc.driverClass>
				<hibernate.dialect>org.hibernate.dialect.MySQLDialect</hibernate.dialect>
			</properties>
		</profile>
<!--+
    | ========  Container profiles  =======
    +-->
		<profile>
			<id>embedded-ejb</id>
			<activation>
				<property>
					<name>environment</name>
					<value>embedded-ejb</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>jboss.seam.profiles</groupId>
					<artifactId>seam-embedded-ejb</artifactId>
					<version>${seam.version}</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
				<jboss.datasource.class>org.jboss.resource.adapter.jdbc.local.LocalTxDataSource</jboss.datasource.class>
			</properties>
		</profile>
		<profile>
			<id>microcontainer</id>
			<activation>
				<property>
					<name>environment</name>
					<value>microcontainer</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>jboss.seam.profiles</groupId>
					<artifactId>seam-microcontainer</artifactId>
					<version>${seam.version}</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
				<jboss.datasource.class>org.jboss.seam.microcontainer.DataSourceFactory</jboss.datasource.class>
			</properties>
		</profile>
		<profile>
			<id>jboss</id>
			<activation>
				<property>
					<name>environment</name>
					<value>jboss</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>jboss-maven-plugin</artifactId>
						<configuration>
							<jbossHome>${env.JBOSS_HOME}</jbossHome>
							<port>8080</port>
						</configuration>
					</plugin>
				</plugins>
			</build>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
			</properties>
		</profile>
		<profile>
			<id>glassfish</id>
			<activation>
				<property>
					<name>environment</name>
					<value>glassfish</value>
				</property>
			</activation>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.SunONETransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
			</properties>
		</profile>
		<profile>
			<id>weblogic</id>
			<activation>
				<property>
					<name>environment</name>
					<value>weblogic</value>
				</property>
			</activation>
			<properties>
				<hibernate.dialect>org.hibernate.dialect.PointbaseDialect</hibernate.dialect>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.WeblogicTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
			</properties>
		</profile>
		<profile>
			<id>websphere</id>
			<activation>
				<property>
					<name>environment</name>
					<value>websphere</value>
				</property>
			</activation>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.WebSphereTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
			</properties>
		</profile>
	</profiles>
	<properties>
		<seam.version>1.2.1.GA</seam.version>
		<hibernate.hbm2ddl.auto>update</hibernate.hbm2ddl.auto>
		<hibernate.jdbc.batch_size>20</hibernate.jdbc.batch_size>
		<hibernate.show_sql>true</hibernate.show_sql>
		<hibernate.cache.use_second_level_cache>true</hibernate.cache.use_second_level_cache>
	</properties>
</project>

2 Respostas

W

Eu verifiquei que bastante gente visitou o meu post, mas ninguém deu uma força. Será que eu me expressei mal? Será que o minha pergunta não foi bem formulada? :cry:

W

Acabei conseguindo fazer!
Vou postar aqui como ficou o meu pom.xml e o meu jetty.xml para que, caso alguém queira fazer o mesmo, tenha uma referência. Não vou detalhar por falta de tempo mas se alguém se interessar estou a disposição pra dizer o que eu fiz detalhadamente.

O objetivo é o seguinte: Embutir o framework osgi equinox no jetty através daquele bridge.war. Assim, após o comando jetty:run o plugin sobe o meu aplicativo, mas sobe também o bridge.war. O meu war pretende direcionar requisições para o bridge.war e por isso ele tem que estar disponível.

t+

EIS MEU POM

<?xml version="1.0" encoding="UTF-8"?>
<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">

<!-- 
	|
	| 
	| este pom e exatamente depois daquele que postei no guj
	|eu trabalhei neste aqui na casa do pai... 
	|
	|
	|	
	-->

	<!-- 1 -->
	<modelVersion>4.0.0</modelVersion>
	<groupId>br.com.jwwm</groupId>
	<artifactId>igreja</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>A custom project using myfaces, facelets and seam.</name>
	<url>http://www.example.com</url>


	<build>
		<defaultGoal>install</defaultGoal>
		<finalName>igreja</finalName>

		<filters>
			<filter>jdbc.properties</filter>
		</filters>

		<resources>
			<resource>
				<directory>src/main/resources-filter</directory>
				<filtering>true</filtering>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>

		<testResources>
			<testResource>
				<directory>src/test/resources-filter</directory>
				<filtering>true</filtering>
			</testResource>
			<testResource>
				<directory>src/test/resources</directory>
			</testResource>
		</testResources>

		<plugins> <!-- =================================<build - plugins>============================ -->
		  <!--|
		    |   J E T T Y      P L U G I N    C O N F I G U R A T I O N
		    |   see jettyConfiguration.txt
		    |-->
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>maven-jetty-plugin</artifactId>
				<!-- version>6.0.1</version -->
				<version>6.1.6rc0</version>

				<configuration>
			        <!-- Configure the webapp -->
				        <contextPath>/igreja</contextPath>

 					<!-- tmpDir></tmpDir -->

					<!--					
					webDefaultXml Optional. 
					A webdefault.xml file to use instead of the supplied jetty default for the webapp
					<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
					-->

					<!--						
					? overrideWebXml Optional. 
					  A web.xml file which will be applied AFTER the webapp's web.xml. 
					  This file can be stored anywhere. 
					  It is used to add or modify the configuration of a web.xml for different
					  environments eg test, production etc.
 	 				  <overrideWebXml>src/main/resources/override-web.xml</overrideWebXml>
					-->

					<!-- isso nao ta funcionando...						
					<webApp>
					/media/devExt3/WORKING-SPACE/workspaces_maven/jwwm_projects/igreja/bridge.war
					</webApp>
					-->


					<!--		
					|
					|TODO fazer o jetty escanear uma pasta para fazer deploy
					|     dos wars que estiver dentro dela, um war necessario
					|     para subir he o bridge.war
					|-->
					<jettyConfig>
					<!-- jettyXmlCompletoQuePosteiNoGuj.xml -->
					jettyQueTrabalheiNaCasaDoPai.xml
					</jettyConfig>
					


					<!-- JETTY-JNDI ENV CONFIGURATION
					 <jettyEnvXml>${jetty.env.file}</jettyEnvXml>
					-->
		
					<!-- VOU CONFIGURAR O CONNECTOR VIA jetty.xml 
					<connectors>
						<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
							<port>8090</port>
							<host>0.0.0.0</host>
						</connector>
					</connectors>
					 -->

				        <stopPort>9966</stopPort>
                                        <stopKey>nicolas1</stopKey>
					<scanIntervalSeconds>10</scanIntervalSeconds>
				</configuration>

           			<dependencies>
				</dependencies>
			</plugin>

			<plugin>
				<groupId>cz.softeu.seamgen</groupId>
				<artifactId>maven-seam-plugin</artifactId>
   <!--                         <version>1.0-SNAPSHOT</version> -->
				<configuration>
					<modelPackage>br.com.jwwm.model</modelPackage>
					<actionPackage>br.com.jwwm.action</actionPackage>
					<testPackage>br.com.jwwm.test</testPackage>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<inherited>true</inherited>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
					<encoding>utf-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-eclipse-plugin</artifactId>
				<configuration>
					<downloadSources>true</downloadSources>
					<downloadJavadocs>true</downloadJavadocs>
					<!-- wtpversion>1.0</wtpversion -->
					<wtpversion>2.0 R7</wtpversion>
				</configuration>
			</plugin>
			<plugin>
        			<groupId>org.codehaus.cargo</groupId>
			        <artifactId>cargo-maven2-plugin</artifactId>
				<!--  NAO ESTOU UTILIZANDO CARGO, PRECISO ESTUDAR EM QUE ELE REALMENTE ME AJUDA...
				<configuration>
				   <container>
     					<containerId>jetty6x</containerId>
					<type>embedded</type>
				   </container>
				 </configuration>
				-->
			</plugin>
		</plugins>
	</build>




	<reporting>
		<plugins>
			<plugin>
				<artifactId>maven-changes-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-checkstyle-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-jxr-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-pmd-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-report-plugin</artifactId>
			</plugin>
		</plugins>
	</reporting>



<!-- Project dependencies -->
	<dependencies>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
			<version>4.7</version>
			<scope>test</scope>
			<classifier>jdk15</classifier>
		</dependency>
<!-- url rewriter -->
		<dependency>
			<groupId>cz.softeu</groupId>
			<artifactId>softeu-rewriter</artifactId>
			<version>1.1</version>
			<scope>runtime</scope>
		</dependency>
<!-- SEAM -->
		<dependency>
			<groupId>jboss.seam.profiles</groupId>
			<artifactId>seam-facelets</artifactId>
			<version>${seam.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam.profiles</groupId>
			<artifactId>seam-ajax4jsf</artifactId>
			<version>${seam.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam</groupId>
			<artifactId>jboss-seam-debug</artifactId>
			<version>${seam.version}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam</groupId>
			<artifactId>jboss-seam-mail</artifactId>
			<version>${seam.version}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam.profiles</groupId>
			<artifactId>seam-drools</artifactId>
			<version>${seam.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>jboss.seam.profiles</groupId>
			<artifactId>seam-ejb</artifactId>
			<version>${seam.version}</version>
			<scope>compile</scope>
		</dependency>
	</dependencies>

	<repositories>
<!-- repository for tomahawk -->
		<repository>
			<id>apache-repo</id>
			<name>apache-repo</name>
			<url>http://myfaces.zones.apache.org/dist/maven-repository</url>
		</repository>
		<repository>
			<id>softeu-repo</id>
			<url>http://maven.softeu.cz</url>
		</repository>
	</repositories>


	<pluginRepositories>
		<pluginRepository>
			<id>softeu-repo</id>
			<url>http://maven.softeu.cz</url>
		</pluginRepository>

                <pluginRepository>
                        <id>codehaus-repo</id>
                        <url>http://repository.codehaus.org/</url>
                </pluginRepository>

<!-- jboss RichFaces plugins -->
		<pluginRepository>
		         <id>maven2-snapshots.jboss.com</id>
		         <name>Jboss Repository for Maven Snapshots</name>
		         <url>http://snapshots.jboss.org/maven2</url>
		     <releases>
		       <enabled>false</enabled>
		     </releases>
		     <snapshots>
       			<enabled>true</enabled>
		       <updatePolicy>always</updatePolicy>
		     </snapshots>
		</pluginRepository>

		<pluginRepository>
		         <releases>
        		    <enabled>true</enabled>
        		 </releases>
	        	 <snapshots>
        		    <enabled>false</enabled>
        		    <updatePolicy>never</updatePolicy>
        		 </snapshots>
        		 <id>repository.jboss.com</id>
        		 <name>Jboss Repository for Maven</name>
        		 <url>
		            http://repository.jboss.com/maven2/
		         </url>
		         <layout>default</layout>
		</pluginRepository>

	</pluginRepositories>
	<profiles>
<!--+
    | ========  Database profiles  =======
    +-->
		<profile>
			<id>hsqldb</id>
			<activation>
				<property>
					<name>database</name>
					<value>hsqldb</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>hsqldb</groupId>
					<artifactId>hsqldb</artifactId>
					<version>1.8.0.7</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<jdbc.driverClass>org.hsqldb.jdbcDriver</jdbc.driverClass>
				<hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
			</properties>
		</profile>
		<profile>
			<id>postgresql</id>
			<activation>
				<property>
					<name>database</name>
					<value>postgresql</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>postgresql</groupId>
					<artifactId>postgresql</artifactId>
					<version>8.2-504.jdbc3</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<jdbc.driverClass>org.postgresql.Driver</jdbc.driverClass>
				<hibernate.dialect>org.hibernate.dialect.PostgreSQLDialect</hibernate.dialect>
			</properties>
		</profile>
		<profile>
			<id>oracle</id>
			<activation>
				<property>
					<name>database</name>
					<value>oracle</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>ojdbc</groupId>
					<artifactId>ojdbc</artifactId>
					<version>14</version>
				</dependency>
			</dependencies>
			<properties>
				<jdbc.driverClass>oracle.jdbc.driver.OracleDriver</jdbc.driverClass>
				<hibernate.dialect>org.hibernate.dialect.OracleDialect</hibernate.dialect>
			</properties>
		</profile>
		<profile>
			<id>mysql</id>
			<activation>
				<property>
					<name>database</name>
					<value>mysql</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>mysql</groupId>
					<artifactId>mysql-connector-api</artifactId>
					<version>5.0.4</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<jdbc.driverClass>com.mysql.jdbc.Driver</jdbc.driverClass>
				<hibernate.dialect>org.hibernate.dialect.MySQLDialect</hibernate.dialect>
			</properties>
		</profile>
<!--+
    | ========  Container profiles  =======
    +-->
		<profile>
			<id>embedded-ejb</id>
			<activation>
				<property>
					<name>environment</name>
					<value>embedded-ejb</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>jboss.seam.profiles</groupId>
					<artifactId>seam-embedded-ejb</artifactId>
					<version>${seam.version}</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
				<jboss.datasource.class>org.jboss.resource.adapter.jdbc.local.LocalTxDataSource</jboss.datasource.class>
			</properties>
		</profile>
		<profile>
			<id>microcontainer</id>
			<activation>
				<property>
					<name>environment</name>
					<value>microcontainer</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>jboss.seam.profiles</groupId>
					<artifactId>seam-microcontainer</artifactId>
					<version>${seam.version}</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
				<jboss.datasource.class>org.jboss.seam.microcontainer.DataSourceFactory</jboss.datasource.class>
			</properties>
		</profile>
		<profile>
			<id>jboss</id>
			<activation>
				<property>
					<name>environment</name>
					<value>jboss</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>jboss-maven-plugin</artifactId>
						<configuration>
							<jbossHome>${env.JBOSS_HOME}</jbossHome>
							<port>8080</port>
						</configuration>
					</plugin>
				</plugins>
			</build>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
			</properties>
		</profile>
		<profile>
			<id>glassfish</id>
			<activation>
				<property>
					<name>environment</name>
					<value>glassfish</value>
				</property>
			</activation>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.SunONETransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
			</properties>
		</profile>
		<profile>
			<id>weblogic</id>
			<activation>
				<property>
					<name>environment</name>
					<value>weblogic</value>
				</property>
			</activation>
			<properties>
				<hibernate.dialect>org.hibernate.dialect.PointbaseDialect</hibernate.dialect>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.WeblogicTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
			</properties>
		</profile>
		<profile>
			<id>websphere</id>
			<activation>
				<property>
					<name>environment</name>
					<value>websphere</value>
				</property>
			</activation>
			<properties>
				<hibernate.transaction.manager_lookup_class>org.hibernate.transaction.WebSphereTransactionManagerLookup</hibernate.transaction.manager_lookup_class>
				<hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class>
			</properties>
		</profile>
	</profiles>
	<properties>
		<seam.version>1.2.1.GA</seam.version>
		<hibernate.hbm2ddl.auto>update</hibernate.hbm2ddl.auto>
		<hibernate.jdbc.batch_size>20</hibernate.jdbc.batch_size>
		<hibernate.show_sql>true</hibernate.show_sql>
		<hibernate.cache.use_second_level_cache>true</hibernate.cache.use_second_level_cache>
	</properties>
</project>

E O MEU jetty.xml

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

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

  <!-- ###required configuration### -->
  <!-- connectors -->
  <!-- handlers -->
  <!-- webapps/contexts -->
<!-- adicionar lifecicle para configurar um realm para autenticacao? -->

  <!-- ###optional configuration### -->
  <!-- threadpool -->
  <!-- session id manager -->
  <!-- authentication realms -->
  <!-- request logs -->
  <!-- extra server options -->



    <!-- =========================================================== -->
    <!-- Server Thread Pool                                          -->
    <!--  CONFIGURACAO HE OPCIONAL E COMENTEI PORQUE ESTAVA DANDO ERRO
    <Set name="ThreadPool">
      <New class="org.mortbay.thread.QueuedThreadPool">
        <Set name="minThreads">2</Set>
        <Set name="maxThreads">50</Set>
        <Set name="lowThreads">5</Set>
        <Set name="SpawnOrShrinkAt">2</Set>
      </New>
    </Set>
    -->
    <!-- =========================================================== -->



    <!-- =========================================================== -->
    <!-- Set connectors                                              -->
    <!-- =========================================================== -->

    <Call name="addConnector">
      <Arg>
          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
            <!-- the ip address or domain to bind -->
            <Set name="host"><SystemProperty name="jetty.host" default="127.0.0.1" /></Set>

            <!-- the port to use/bind, defaults to 8080 if property not set -->
            <Set name="port"><SystemProperty name="jetty.port" default="8090"/></Set>

            <!-- the time in milliseconds when a connection is considered idle -->
            <Set name="maxIdleTime">300000</Set>

            <!-- the number of acceptors (their job is to accept the connection and dispatch to thread pool) -->
            <Set name="Acceptors">2</Set>

            <!-- should the connection statistics be turned on? (Not advisable in production) -->
            <Set name="statsOn">false</Set>

            <!-- the confidential port -->
            <Set name="confidentialPort">8443</Set>

            <!-- indicates the minimum number of connections when the server is considered low on resources -->
	    <Set name="lowResourcesConnections">20000</Set>

            <!-- when low on resources, this indicates the maximum time (milliseconds) a connection must be idle to not be closed -->
	    <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>

    <!-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -->
    <!-- To add a HTTPS SSL connector                                    -->
    <!-- mixin jetty-ssl.xml:                                            -->
    <!--   java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml           -->
    <!-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -->

    <!-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -->
    <!-- To add a HTTP blocking connector                                -->
    <!-- mixin jetty-bio.xml:                                            -->
    <!--   java -jar start.jar etc/jetty.xml etc/jetty-bio.xml           -->
    <!-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -->


    <!-- =========================================================== -->
    <!-- Set handler Collection Structure                            -->
    <!-- =========================================================== -->
    <Set name="handler">
      <!-- the collection of handlers that will handle the request -->
      <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.mortbay.jetty.Handler">
           <!-- primarily handles the request and maps the request to a ContextHandler -->
           <Item>
             <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
           </Item>

           <!-- The default handler ... handles the request if not yet handled -->
           <Item>
             <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
           </Item>

           <!-- The handler for your request logs -->
           <Item>
             <New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
           </Item>
         </Array>
        </Set>
      </New>
    </Set>

    <!-- =========================================================== -->
    <!-- Configure the context deployer                              -->
    <!-- A context deployer will deploy contexts described in        -->
    <!-- configuration files discovered in a directory.              -->
    <!-- The configuration directory can be scanned for hot          -->
    <!-- deployments at the configured scanInterval.                 -->
    <!--                                                             -->
    <!-- This deployer is configured to deploy contexts configured   -->
    <!-- in the $JETTY_HOME/contexts directory                       -->
    <!--                                                             -->
    <!-- =========================================================== -->
    <Call name="addLifeCycle">
      <Arg>
        <New class="org.mortbay.jetty.deployer.ContextDeployer">
          <!-- the ContextHandlerCollection to modify once a webapp is added or removed (Allows Hot Deployment) -->
          <Set name="contexts"><Ref id="Contexts"/></Set>

          <!-- the directory which will contain your context.xml files -->
          <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>

          <!-- the interval in milliseconds to periodically scan the configurationDir -->
          <Set name="scanInterval">5</Set>
        </New>
      </Arg>
    </Call>

    <!-- =========================================================== -->
    <!-- Configure the webapp deployer.                              -->
    <!-- A webapp  deployer will deploy standard webapps discovered  -->
    <!-- in a directory at startup, without the need for additional  -->
    <!-- configuration files.    It does not support hot deploy or   -->
    <!-- non standard contexts (see ContextDeployer above).          -->
    <!--                                                             -->
    <!-- This deployer is configured to deploy webapps from the      -->
    <!-- $JETTY_HOME/webapps directory                               -->
    <!--                                                             -->
    <!-- Normally only one type of deployer need be used.            -->
    <!--                                                             -->
    <!-- =========================================================== -->
    <Call name="addLifeCycle">
      <Arg>
        <New class="org.mortbay.jetty.deployer.WebAppDeployer">
          <!-- the ContextHandlerCollection to add the webapps to -->
          <Set name="contexts"><Ref id="Contexts"/></Set>

          <!-- the directory where all the webapps are located (can be exploded or packaged as war -->
          <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/others_wars</Set>

          <!-- indicates whether to lookup/load from the parent class loader first-->
	  <Set name="parentLoaderPriority">false</Set>

          <!-- indicates whether to extract the webapp if it is packaged as a war -->
	  <Set name="extract">true</Set>

          <!-- indicates whether a deployed webapp on a certain contextPath should have a duplicate webapp deployment -->
	  <Set name="allowDuplicates">false</Set>

          <!-- the default descriptor to use to be applied before a webapps' web.xml
          Com essa configuracao recebi:
			java.io.FileNotFoundException: /media/devExt3/WORKING-SPACE/workspaces_maven/jwwm_projects/igreja/etc/webdefault.xml (No such file or directory)
			at java.io.FileInputStream.open(Native Method)
			Mas acho que usando o plugin do jetty do maven talvez esse xml esteja definido pelo plugin...          
           -->
          
          <!-- Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set-->
        </New>
      </Arg>
    </Call>

    <!-- =========================================================== -->
    <!-- Configure Authentication Realms                             -->
    <!-- Realms may be configured for the entire server here, or     -->
    <!-- they can be configured for a specific web app in a context  -->
    <!-- configuration (see $(jetty.home)/contexts/test.xml for an   -->
    <!-- example).                                                   -->
    
    <!-- 
    <Set name="UserRealms">
      <Array type="org.mortbay.jetty.security.UserRealm">
        <Item>
          this realm uses a properties file to store/read the user/password/roles 
          <New class="org.mortbay.jetty.security.HashUserRealm">
            the name of the realm
            <Set name="name">Test Realm</Set>

            <### the location of the property file to load from ###
            <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set
            <Set name="config"><SystemProperty name="jetty.home" default="."/>realm.properties</Set>

            the interval in seconds to periodically scan for any changes and refresh/reload if changed
            <Set name="refreshInterval">0</Set>
          </New>          
        </Item>
      
      
      </Array>
    </Set>
    
    -->
	<!-- =========================================================== -->


    <!-- =========================================================== -->
    <!-- Configure Request Log                                       -->
    <!-- Request logs  may be configured for the entire server here, -->
    <!-- or they can be configured for a specific web app in a       -->
    <!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
    <!-- for an example).                                            -->
    <!-- =========================================================== -->
    <Ref id="RequestLog">
      <Set name="requestLog">
        <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
          <!-- the output file name of the log file. Name of the file will be date formatted -->
          <!-- 
          		a ideia e tentar resolver...
          		java.io.IOException: Cannot write log directory /media/devExt3/WORKING-SPACE/workspaces_maven/jwwm_projects/igreja/logs 
          		resultado positivo!
          Set name="filename"><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Set -->
          <Set name="filename"><SystemProperty name="jetty.logs" default="."/>/yyyy_mm_dd.request.log</Set>

          <!-- the date format -->
          <Set name="filenameDateFormat">yyyy_MM_dd</Set>

          <!-- the days to retain the log file -->
          <Set name="retainDays">90</Set>

          <!-- indicates if the new lines should be appended on an existing log file -->
          <Set name="append">true</Set>

          <!-- indicates if the lines logged to the file will be in extended format -->
          <Set name="extended">true</Set>

          <!-- Indicates if the cookie logs should be included in the log file -->
          <Set name="logCookies">false</Set>

          <!-- the timezone of the log -->
          <Set name="LogTimeZone">GMT</Set>
        </New>
      </Set>
    </Ref>

    <!-- =========================================================== -->
    <!-- extra options                                               -->
    <!-- =========================================================== -->

    <!-- Stops the server when ctrl+c is pressed (registers to Runtime.addShutdownHook) -->
    <Set name="stopAtShutdown">true</Set>
	 
	<!-- envia a versao do servidor no header da response -->
    <Set name="sendServerVersion">true</Set>

    <!-- send the date header in the response header? -->
    <Set name="sendDateHeader">true</Set>

    <!-- allows requests(prior to shutdown) to finish gracefully -->
    <Set name="gracefulShutdown">1000</Set>

</Configure>

t+

Criado 7 de julho de 2009
Ultima resposta 13 de jul. de 2009
Respostas 2
Participantes 1