<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You 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. | |
--> | |
<!-- $Rev$ $Date$ --> | |
<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>org.acme</groupId> | |
<artifactId>simple-app</artifactId> | |
<packaging>jar</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<name>OpenEJB :: Examples :: HelloWorld Stateful POJO</name> | |
<build> | |
<defaultGoal>install</defaultGoal> | |
<plugins> | |
<plugin> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<configuration> | |
<source>1.5</source> | |
<target>1.5</target> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<configuration> | |
<!-- argLine>-agentlib:jdwp=transport=dt_socket,server=y,address=5005</argLine --> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
<repositories> | |
<repository> | |
<id>codehaus-m2-snapshot</id> | |
<name>Codehaus Snapshot Repository</name> | |
<url>http://snapshots.repository.codehaus.org</url> | |
</repository> | |
<repository> | |
<id>apache-m2-snapshot</id> | |
<name>Apache Snapshot Repository</name> | |
<url>http://people.apache.org/repo/m2-snapshot-repository/</url> | |
</repository> | |
</repositories> | |
<dependencies> | |
<dependency> | |
<groupId>org.apache.geronimo.specs</groupId> | |
<artifactId>geronimo-ejb_3.0_spec</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>4.1</version> | |
<scope>test</scope> | |
</dependency> | |
<!-- | |
Nice thing about maven2 is it has test-only dependencies. | |
This guarantees that non of your runtime code is dependent | |
on any OpenEJB classes. | |
For those of you who want to know the minimum steps required | |
to add OpenEJB for testing to an existing maven 2 build, you | |
simply add this dependency below and in your test code create | |
your InitialContext like such: | |
Properties properties = new Properties(); | |
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory"); | |
// Tells OpenEJB to look for META-INF/ejb-jar.xml files in the classpath | |
properties.setProperty("openejb.deployments.classpath", "true"); | |
initialContext = new InitialContext(properties); | |
--> | |
<dependency> | |
<groupId>org.apache.openejb</groupId> | |
<artifactId>openejb-core</artifactId> | |
<version>3.0-beta-1</version> | |
<scope>test</scope> | |
</dependency> | |
</dependencies> | |
</project> |