Skip to content
Snippets Groups Projects
Commit 48069553 authored by Federico Martinez's avatar Federico Martinez
Browse files

avances practico 1

parent 26aaeb03
No related branches found
No related tags found
1 merge request!1Avances practico1
Showing
with 365 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/practico1-data"/>
<classpathentry combineaccessrules="false" kind="src" path="/practico1-ejb"/>
<classpathentry combineaccessrules="false" kind="src" path="/practico1-web"/>
<classpathentry kind="output" path="bin"/>
</classpath>
.project 0 → 100644
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>practico1</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=21
eclipse.preferences.version=1
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="21"/>
</faceted-project>
default.configuration=
eclipse.preferences.version=1
hibernate3.enabled=false
This project was created from the archetype "wildfly-jakartaee-ear-archetype".
To deploy it:
Run the maven goals "install wildfly:deploy"
To undeploy it:
Run the maven goals "wildfly:undeploy"
==========================
DataSource:
This sample includes a "persistence.xml" file in the EJB project. This file defines
a persistence unit "practico1PersistenceUnit" which uses the JakartaEE default database.
In production environment, you should define a database in WildFly config and point to this database
in "persistence.xml".
If you don't use entity beans, you can delete "persistence.xml".
==========================
JSF:
The web application is prepared for JSF 4.0 by bundling an empty "faces-config.xml" in "src/main/webapp/WEB-INF".
In case you don't want to use JSF, simply delete this file and "src/main/webapp/beans.xml".
==========================
Testing:
This sample is prepared for running JUnit5 unit tests with the Arquillian framework.
The configuration can be found in "practico1/pom.xml":
Three profiles are defined:
-"default": no integration tests are executed.
-"arq-remote": you have to start a WildFly server on your machine. The tests are executed by deploying
the application to this server.
Here the "maven-failsafe-plugin" is enabled so that integration tests can be run.
Run maven with these arguments: "clean verify -Parq-remote"
-"arq-managed": this requires the environment variable "JBOSS_HOME" to be set:
The server found in this path is started and the tests are executed by deploying the application to this server.
Instead of using this environment variable, you can also define the path in "arquillian.xml".
Here the "maven-failsafe-plugin" is enabled so that integration tests can be run.
Run maven with these arguments: "clean verify -Parq-managed"
The Arquillian test runner is configured with the file "src/test/resources/arquillian.xml"
(duplicated in EJB and WEB project, depending where your tests are placed).
The profile "arq-remote" uses the container qualifier "remote" in this file.
The profile "arq-managed" uses the container qualifier "managed" in this file.
Unit tests can be added to EJB project and/or to Web project.
The web project contains an integration test "SampleIT" which shows how to create the deployable EAR file using the ShrinkWrap API.
You can delete this test file if no tests are necessary.
Why integration tests instead of the "maven-surefire-plugin" testrunner?
The Arquillian test runner deploys the EAR file to the WildFly server and thus you have to build it yourself with the ShrinkWrap API.
The goal "verify" (which triggers the maven-surefire-plugin) is executed later in the maven build lifecyle than the "test" goal so that the target
artifacts ("practico1-ejb.jar" and "practico1-web.war") are already built. You can build
the final EAR by including those files. The "maven-surefire-plugin" is executed before the JAR/WAR files
are created, so those JAR/WAR files would have to be built in the "@Deployment" method, too.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="all">
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>practico1-ear</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="practico1">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/ear-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/application" tag="defaultRootSource"/>
<dependent-module archiveName="practico1-ejb.jar" deploy-path="/" handle="module:/resource/practico1-ejb/practico1-ejb">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="practico1-web.war" deploy-path="/" handle="module:/resource/practico1-web/practico1-web">
<dependency-type>uses</dependency-type>
</dependent-module>
</wb-module>
</project-modules>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="jst.ear" version="10.0"/>
</faceted-project>
disabled=06target
eclipse.preferences.version=1
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual
contributors by the @authors tag. See the copyright.txt in the
distribution for a full listing of individual contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="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>
<parent>
<groupId>tse</groupId>
<artifactId>practico1</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>practico1-ear</artifactId>
<packaging>ear</packaging>
<name>practico1 - ear</name>
<description>This is the EAR POM file</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>practico1-ejb</artifactId>
<type>ejb</type>
</dependency>
<!-- Depend on the EJB module and WAR so that we can package them -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>practico1-web</artifactId>
<type>war</type>
</dependency>
</dependencies>
<build>
<finalName>${project.parent.artifactId}</finalName>
<plugins>
<!--EAR plugin: format of output file -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>${version.ear.plugin}</version>
<configuration>
<!-- Tell Maven we are using Jakarta EE -->
<version>10</version>
<!-- Use Jakarta EE ear libraries as needed. Jakarta EE ear libraries
are in easy way to package any libraries needed in the ear, and automatically
have any modules (EJB-JARs and WARs) use them -->
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<!-- Default context root of the web app is /practico1-web.
If a custom context root is needed, uncomment the following snippet to
register our War as a web module and set the contextRoot property -->
<!--
<webModule>
<groupId>${project.groupId}</groupId>
<artifactId>practico1-web</artifactId>
<contextRoot>/practico1</contextRoot>
</webModule>
-->
</modules>
<outputFileNameMapping>@{artifactId}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
</configuration>
</plugin>
<!-- The WildFly plug-in deploys your ear to a local WildFly / JBoss EAP container.
Due to Maven's lack of intelligence with EARs we need to configure
the WildFly Maven plug-in to skip deployment for all modules. We then enable
it specifically in the ear module. -->
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/application_10.xsd" version="10">
<description>This is the EAR POM file</description>
<display-name>practico1-ear</display-name>
<module>
<ejb>practico1-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>practico1-web.war</web-uri>
<context-root>/practico1-web</context-root>
</web>
</module>
<library-directory>lib</library-directory>
</application>
\ No newline at end of file
Manifest-Version: 1.0
Build-Jdk-Spec: 21
Created-By: Maven Integration for Eclipse
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/application_10.xsd" version="10">
<description>This is the EAR POM file</description>
<display-name>practico1-ear</display-name>
<module>
<ejb>practico1-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>practico1-web.war</web-uri>
<context-root>/practico1-web</context-root>
</web>
</module>
<library-directory>lib</library-directory>
</application>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment