Saturday, March 09, 2013

Configurar um projeto web c/ JSF 2 no Maven

Mais um post relacionado a Maven, agora para quem pretende desenvolver um aplicação JSF.


A seguir um pedaço (principal) do pom.xml que define as dependências necessárias para utilizar o JSF 2.1:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>br.com.yaw</groupId>
  <artifactId>exemplo-jsf-maven</artifactId>
  <packaging>war</packaging>
  <version>1.0</version>
  <name>exemplo-jsf-maven</name>

  <dependencies>
    <!-- JSF 2 -->
    <dependency>
      <groupId>com.sun.faces</groupId>
      <artifactId>jsf-api</artifactId>
      <version>2.1.11</version>
    </dependency>
    <dependency>
      <groupId>com.sun.faces</groupId>
      <artifactId>jsf-impl</artifactId>
      <version>2.1.11</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
      <scope>provided</scope>
    </dependency>

    <!-- EL -->
    <dependency>
      <groupId>org.glassfish.web</groupId>
      <artifactId>el-impl</artifactId>
      <version>2.2</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>
    </plugins>
  </build>
</project>

Pronto!

http://twitter.com/edermag
http://www.yaw.com.br

1 comment:

Blogger said...

Ever wanted to get free Twitter Re-tweets?
Did you know you can get them AUTOMATICALLY AND TOTALLY FOR FREE by registering on Add Me Fast?