Mostrando entradas con la etiqueta servlet. Mostrar todas las entradas
Mostrando entradas con la etiqueta servlet. Mostrar todas las entradas

miércoles, 6 de abril de 2011

Configuración Inicial

El IDE Netbeans puede ser bajado de forma gratuita de su página oficial http://www.netbeans.com/, en este tutorial suponemos un manejo básico de este IDE.
Para empezar a trabajar es necesario agregar un plugin al Netbeans, este proceso se describe claramente en el siguiente link:
Ahora se crea un nuevo proyecto web añadiendo los frameworsk de Vaadin, Spring e Hibernate.

Se modifican los diferentes archivos xml, como lo son el web.xml y los archivos de configuracion de spring applicationContext.xml y dispatcher-servlet.xml, ademas informacion de conexion con la base de datos para hibernate en un archivo properties.

web.xml (Descriptor comun que controla el comportamiento de la web)
 <?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>VaadinApplication</servlet-name>
<servlet-class>com.ejemplo.vaadin.util.AutowiringApplicationServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>com.ejemplo.vaadin.MyApplication</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/vaadin/html/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VaadinApplication</servlet-name>
<url-pattern>/vaadin/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VaadinApplication</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file/>
</welcome-file-list>
</web-app>

applicationContext.xml (fichero de configuración básico de Spring)

Aca definimos los beans basicos y demas configuraciones necesarias para el proyecto.

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<context:property-placeholder location = "classpath:application.properties"/>
<!-- ############ Inicio Hibernate ############ -->
<!-- DATASOURCE DECLARATION -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
<!-- HIBERNATE SESSION FACTORY -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
<value>com.ejemplo.vaadin.entidades.Usuario</value>
</list>
</property>
<property name="eventListeners">
<map>
<entry key="merge">
<bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
</entry>
</map>
</property>
</bean>
<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"
p:sessionFactory-ref="sessionFactory"/>
<!-- ############ Fin Hibernate ############ -->
<context:annotation-config />
<tx:annotation-driven/>
<aop:aspectj-autoproxy/>
<!-- Scan por los DAO -->
<context:component-scan base-package="com.ejemplo.vaadin.dao"/>
<!-- Declaramos los servicios explicitamente para poder referenciarlos-->
<bean class="com.ejemplo.vaadin.servicios.impl.ServicioUsuariosImpl" id="servicioUsuarios"/>
</beans>
dispatcher-servlet.xml (Archivo de configuracion de spring)


 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<context:annotation-config />
<context:component-scan base-package="com.ejemplo.vaadin.rest"/>
<bean id="contentNegotiatingViewResolver"
class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="favorPathExtension" value="true" />
<property name="favorParameter" value="true" />
<!--
default media format parameter name is 'format'
-->
<property name="ignoreAcceptHeader" value="false" />
<property name="order" value="1" />
<property name="mediaTypes">
<map>
<entry key="html" value="text/html"/>
<entry key="json" value="application/json" />
<entry key="xml" value="application/xml" />
</map>
</property>
<property name="viewResolvers">
<list>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
</bean>
</list>
</property>
<property name="defaultViews">
<list>
<bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
<bean class="org.springframework.web.servlet.view.xml.MarshallingView">
<constructor-arg>
<bean class="org.springframework.oxm.xstream.XStreamMarshaller" />
</constructor-arg>
</bean>
</list>
</property>
</bean>
<!-- Configure the multipart resolver -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- the maximum file size in bytes -->
<property name="maxUploadSize" value="20000000"/>
</bean>

</beans>

application.propertiesAlmacena los parámetros configurables de una aplicación. También se puede utilizar para el almacenamiento de cadenas para la internacionalización y localización (i18n).

 ################ BD ############################
## ESPECIFICOS DE LA BD
## BD DESARROLLO ###############################
jdbc.driverClassName=org.postgresql.Driver
## SERVIDOR BD
jdbc.url=jdbc:postgresql://localhost:5432/ejemplo
jdbc.username=usuario
jdbc.password=contrasena
#
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
############################################################
## FIN SERVIDOR BD
## HIBERNATE SETTINGS
hibernate.generate_statistics=true
hibernate.show_sql=false
hibernate.hbm2ddl.auto=false
########################################################


Se crea servlet para trabajar con Vaadin y con Spring convinados
Servlet necesario para trabajar con Spring y Vaadin relacionados, se define en el web.xml, permite la inyeccion de los beans definidos en el applicationContext.

 /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ejemplo.vaadin.util;
import com.vaadin.Application;
import com.vaadin.terminal.gwt.server.ApplicationServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
//import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
/**
* {@link ApplicationServlet} that autowires and configures the {@link Application}
* objects it creates using the containing Spring {@link WebApplicationContext}.
*
* <p>
* When using this servlet, annotations such as
* <code>@{@link org.springframework.beans.factory.annotation.Autowired Autowired}</code>
* and <code>@{@link org.springframework.beans.factory.annotation.Required Required}</code>
* and interfaces such as {@link org.springframework.beans.factory.BeanFactoryAware BeanFactoryAware},
* etc. will work on your {@link Application} instances.
* </p>
*
* <p>
* An example:
* <blockquote><pre>
* &lt;bean id="applicationServlet" class="org.springframework.web.servlet.mvc.ServletWrappingController"
*   p:servletClass="com.example.AutowiringApplicationServlet"&gt;
*   &lt;property name="initParameters"&gt;
*     &lt;props&gt;
*       &lt;prop key="application"&gt;some.spring.configured.Application&lt;/prop&gt;
*       &lt;prop key="productionMode"&gt;true&lt;/prop&gt;
*     &lt;/props&gt;
*   &lt;/property&gt;
* &lt;/bean&gt;
* </pre></blockquote>
*
* @see org.springframework.web.servlet.mvc.ServletWrappingController
* @see AutowireCapableBeanFactory
*/
public class AutowiringApplicationServlet extends ApplicationServlet {
//  protected final Logger log = Logger.getLogger(getClass());
private WebApplicationContext webApplicationContext;
/**
* Initialize this servlet.
*
* @throws ServletException if there is no {@link WebApplicationContext} associated with this servlet's context
*/
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
//    log.debug("finding containing WebApplicationContext");
System.out.println("finding containing WebApplicationContext");
try {
this.webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext());
} catch (IllegalStateException e) {
throw new ServletException("could not locate containing WebApplicationContext");
}
}
/**
* Get the containing Spring {@link WebApplicationContext}.
* This only works after the servlet has been initialized (via {@link #init init()}).
*
* @throws ServletException if the operation fails
*/
protected final WebApplicationContext getWebApplicationContext() throws ServletException {
if (this.webApplicationContext == null) {
throw new ServletException("can't retrieve WebApplicationContext before init() is invoked");
}
return this.webApplicationContext;
}
/**
* Get the {@link AutowireCapableBeanFactory} associated with the containing Spring {@link WebApplicationContext}.
* This only works after the servlet has been initialized (via {@link #init init()}).
*
* @throws ServletException if the operation fails
*/
protected final AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws ServletException {
try {
return getWebApplicationContext().getAutowireCapableBeanFactory();
} catch (IllegalStateException e) {
throw new ServletException("containing context " + getWebApplicationContext() + " is not autowire-capable", e);
}
}
/**
* Create and configure a new instance of the configured application class.
*
* <p>
* The implementation in {@link AutowiringApplicationServlet} delegates to
* {@link #getAutowireCapableBeanFactory getAutowireCapableBeanFactory()}, then invokes
* {@link AutowireCapableBeanFactory#createBean AutowireCapableBeanFactory.createBean()}
* using the configured {@link Application} class.
* </p>
*
* @param request the triggering {@link HttpServletRequest}
* @throws ServletException if creation or autowiring fails
*/
@Override
protected Application getNewApplication(HttpServletRequest request) throws ServletException {
Class<? extends Application> cl = null;
try {
cl = getApplicationClass();
} catch (ClassNotFoundException e) {
//      log.error( "failed to find the application class" );
System.out.println("failed to find the application class");
}
//    log.debug("creating new instance of " + cl);
System.out.println("creating new instance of " + cl);
AutowireCapableBeanFactory beanFactory = getAutowireCapableBeanFactory();
try {
return beanFactory.createBean(cl);
} catch (BeansException e) {
throw new ServletException("failed to create new instance of " + cl, e);
}
}
}


Si desean compilar el proyecto usando maven este seria el pom.xml:

  
<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.ejemplo.vaadin</groupId>
    <artifactId>EjemploVaadin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>EjemploVaadin</name>

    <properties>
        <vaadin.version>6.8.15</vaadin.version>
        <gwt.version>2.7.0</gwt.version>
        <gwt.plugin.version>2.2.0</gwt.plugin.version>
        <spring.version>3.0.5.RELEASE</spring.version>
        <version.hibernate>3.5.3-Final</version.hibernate>
        <version.slf4j>1.5.8</version.slf4j>
        <version.log4j>1.2.14</version.log4j>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwt.version}</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.3.1</version>
        </dependency>
        
        <dependency>
                <groupId>commons-fileupload</groupId>
                <artifactId>commons-fileupload</artifactId>
                <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${version.hibernate}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>${version.hibernate}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.0.2.GA</version>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.6.8</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.4.GA</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${version.slf4j}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${version.slf4j}</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${version.log4j}</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <artifactId>commons-collections</artifactId>
            <groupId>commons-collections</groupId>
            <version>3.1</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.16</version>
        </dependency>
        
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.0.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <scope>runtime</scope>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>c</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
            <type>tld</type>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>fmt</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
            <type>tld</type>
        </dependency>
        
        
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <classifier>sources</classifier>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
            <version>2.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>jsr250-api</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.8.1</version>
        </dependency>
        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>1.7</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        
        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>8.4-702.jdbc4</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <!-- Compile custom GWT components or widget dependencies with the GWT compiler -->
            <!-- 
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${gwt.plugin.version}</version>
                <configuration>
                    <modules>
                        <module>com.ejemplo.vaadin.widgetset.Widgetset</module>
                    </modules>
                    <webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                    <runTarget>DrDental</runTarget>
                    <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
                    <noServer>true</noServer>
                    <port>8080</port>
                    <compileReport>false</compileReport>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>resources</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-user</artifactId>
                        <version>2.3.0</version>
                    </dependency>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-dev</artifactId>
                        <version>2.3.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>1.0.2</version>
                <configuration>
                    <module>com.ejemplo.vaadin.widgetset.Widgetset</module>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>update-widgetset</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
                  -->

            <!-- A simple Jetty test server at http://localhost:8080/DrDental can be launched with the Maven goal jetty:run
        and stopped with jetty:stop -->
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.24</version>
                <configuration>
                    <stopPort>9966</stopPort>
                    <stopKey>Vaadin</stopKey>
                    <!-- Redeploy every x seconds if changes are detected, 0 for no automatic redeployment -->
                    <scanIntervalSeconds>0</scanIntervalSeconds>
                    <!-- make sure Jetty also finds the widgetset -->
                    <webAppConfig>
                        <contextPath>/vaadin</contextPath>
                        <baseResource implementation="org.mortbay.resource.ResourceCollection">
                            <!-- Workaround for Maven/Jetty issue http://jira.codehaus.org/browse/JETTY-680 -->
                            <!-- <resources>src/main/webapp,${project.build.directory}/${project.build.finalName}</resources> -->
                            <resourcesAsCSV>src/main/webapp,${project.build.directory}/${project.build.finalName}
                            </resourcesAsCSV>
                        </baseResource>
                    </webAppConfig>
                </configuration>
            </plugin>
        </plugins>
        <finalName>vaadin</finalName>
    </build>
    
    <repositories>
        <repository>
            <id>vaadin-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>        
        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <!--repository>
            <url>http://ftp.ing.umu.se/mirror/eclipse/rt/eclipselink/maven.repo</url>
            <id>eclipselink</id>
            <layout>default</layout>
            <name>Repository for library Library[eclipselink]</name>
        </repository-->
        <!--repository>
         <id>EclipseLink Repo</id>
         <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
         --><!-- use this for javax.persistence-->
         <!--snapshots>
            <enabled>true</enabled>
         </snapshots> -->
      <!--/repository-->
    </repositories>
    
    <pluginRepositories>
        <pluginRepository>
            <id>codehaus-snapshots</id>
            <url>http://nexus.codehaus.org/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
        <pluginRepository>
            <id>vaadin-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

</project>


Siguiente: Modelo
Volver al menú