Commit 2547297e4fe60baa341d326a229a7b2e3cdcca5a

Authored by Cleverson Sacramento
1 parent 7bba9cf7
Exists in master

Ajustes no arquétipo e no parent pom

archetype/jsf-jpa/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
... ... @@ -1,11 +0,0 @@
1   -<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2   - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
3   -
4   - <alternatives>
5   - <class>br.gov.frameworkdemoiselle.transaction.JPATransaction</class>
6   -
7   - <!--
8   - <class>br.gov.frameworkdemoiselle.transaction.JTATransaction</class>
9   - -->
10   - </alternatives>
11   -</beans>
archetype/jsf-jpa/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml
... ... @@ -2,10 +2,41 @@
2 2 <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 3 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
4 4  
5   - <!-- If you are using jboss6 with non JTA transaction then use this persistence-unit -->
  5 + <!-- If you are using JBoss AS7 with non JTA transaction then use this persistence-unit -->
6 6 <!--
7 7 -->
8 8 <persistence-unit name="bookmark-ds" transaction-type="RESOURCE_LOCAL">
  9 + <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source>
  10 +
  11 + <class>${package}.domain.Bookmark</class>
  12 +
  13 + <properties>
  14 + <property name="hibernate.show_sql" value="true" />
  15 + <property name="hibernate.format_sql" value="false" />
  16 + <property name="hibernate.hbm2ddl.auto" value="create-drop" />
  17 + <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
  18 + </properties>
  19 + </persistence-unit>
  20 +
  21 + <!-- If you are using JBoss AS7 with JTA transaction then use this persistence-unit -->
  22 + <!--
  23 + <persistence-unit name="bookmark-ds" transaction-type="JTA">
  24 + <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
  25 +
  26 + <class>${package}.domain.Bookmark</class>
  27 +
  28 + <properties>
  29 + <property name="hibernate.show_sql" value="true" />
  30 + <property name="hibernate.format_sql" value="false" />
  31 + <property name="hibernate.hbm2ddl.auto" value="update" />
  32 + <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
  33 + </properties>
  34 + </persistence-unit>
  35 + -->
  36 +
  37 + <!-- If you are using JBoss AS6 with non JTA transaction then use this persistence-unit -->
  38 + <!--
  39 + <persistence-unit name="bookmark-ds" transaction-type="RESOURCE_LOCAL">
9 40 <non-jta-data-source>java:/DefaultDS</non-jta-data-source>
10 41  
11 42 <class>${package}.domain.Bookmark</class>
... ... @@ -17,8 +48,9 @@
17 48 <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
18 49 </properties>
19 50 </persistence-unit>
  51 + -->
20 52  
21   - <!-- If you are using jboss6 with JTA transaction then use this persistence-unit -->
  53 + <!-- If you are using JBoss AS6 with JTA transaction then use this persistence-unit -->
22 54 <!--
23 55 <persistence-unit name="bookmark-ds" transaction-type="JTA">
24 56 <jta-data-source>java:/DefaultDS</jta-data-source>
... ... @@ -34,7 +66,7 @@
34 66 </persistence-unit>
35 67 -->
36 68  
37   - <!-- If you are using tomcat6/tomcat7/junit then use this persistence-unit -->
  69 + <!-- If you are using Tomcat 6 / Tomcat 7 / JUnit then use this persistence-unit -->
38 70 <!--
39 71 <persistence-unit name="bookmark-ds" transaction-type="RESOURCE_LOCAL">
40 72  
... ...
archetype/jsf-jpa/src/main/resources/archetype-resources/src/main/resources/demoiselle.properties
... ... @@ -33,3 +33,4 @@
33 33 # ou escreva para a Fundação do Software Livre (FSF) Inc.,
34 34 # 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
35 35  
  36 +frameworkdemoiselle.transaction.class=br.gov.frameworkdemoiselle.transaction.JPATransaction
... ...
archetype/jsf-jpa/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
  3 +
  4 + <interceptors>
  5 + <class>br.gov.frameworkdemoiselle.internal.interceptor.ExceptionHandlerInterceptor</class>
  6 + <class>br.gov.frameworkdemoiselle.internal.interceptor.RequiredPermissionInterceptor</class>
  7 + <class>br.gov.frameworkdemoiselle.internal.interceptor.RequiredRoleInterceptor</class>
  8 + <class>br.gov.frameworkdemoiselle.internal.interceptor.TransactionalInterceptor</class>
  9 + </interceptors>
  10 +
  11 +</beans>
... ...
parent/jsf/pom.xml
... ... @@ -173,6 +173,78 @@
173 173 </profile>
174 174 <profile>
175 175 <id>jboss6</id>
  176 + <dependencies>
  177 + <dependency>
  178 + <groupId>br.gov.frameworkdemoiselle</groupId>
  179 + <artifactId>demoiselle-jsf</artifactId>
  180 + <scope>compile</scope>
  181 + <exclusions>
  182 + <exclusion>
  183 + <groupId>javax.servlet</groupId>
  184 + <artifactId>servlet-api</artifactId>
  185 + </exclusion>
  186 + </exclusions>
  187 + </dependency>
  188 + <dependency>
  189 + <groupId>javax.servlet</groupId>
  190 + <artifactId>javax.servlet-api</artifactId>
  191 + <scope>provided</scope>
  192 + </dependency>
  193 + <dependency>
  194 + <groupId>javax.enterprise</groupId>
  195 + <artifactId>cdi-api</artifactId>
  196 + <scope>provided</scope>
  197 + </dependency>
  198 + <dependency>
  199 + <groupId>javax.servlet</groupId>
  200 + <artifactId>jstl</artifactId>
  201 + <scope>provided</scope>
  202 + </dependency>
  203 + <dependency>
  204 + <artifactId>validation-api</artifactId>
  205 + <groupId>javax.validation</groupId>
  206 + <scope>provided</scope>
  207 + </dependency>
  208 + <dependency>
  209 + <groupId>javax.transaction</groupId>
  210 + <artifactId>jta</artifactId>
  211 + <scope>provided</scope>
  212 + </dependency>
  213 + <dependency>
  214 + <groupId>org.slf4j</groupId>
  215 + <artifactId>slf4j-log4j12</artifactId>
  216 + <scope>runtime</scope>
  217 + </dependency>
  218 + <dependency>
  219 + <groupId>org.eclipse.persistence</groupId>
  220 + <artifactId>javax.persistence</artifactId>
  221 + <scope>provided</scope>
  222 + </dependency>
  223 + <dependency>
  224 + <groupId>com.sun.faces</groupId>
  225 + <artifactId>jsf-api</artifactId>
  226 + <scope>provided</scope>
  227 + </dependency>
  228 + <dependency>
  229 + <groupId>com.sun.faces</groupId>
  230 + <artifactId>jsf-impl</artifactId>
  231 + <scope>provided</scope>
  232 + </dependency>
  233 + <dependency>
  234 + <groupId>hsqldb</groupId>
  235 + <artifactId>hsqldb</artifactId>
  236 + <scope>provided</scope>
  237 + </dependency>
  238 +
  239 + <dependency>
  240 + <groupId>org.hibernate</groupId>
  241 + <artifactId>hibernate-entitymanager</artifactId>
  242 + <scope>test</scope>
  243 + </dependency>
  244 + </dependencies>
  245 + </profile>
  246 + <profile>
  247 + <id>jboss7</id>
176 248 <activation>
177 249 <activeByDefault>true</activeByDefault>
178 250 </activation>
... ...