tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: Standalone OpenEJB pom (embedded container)
Date Thu, 17 Jun 2010 17:35:29 GMT
On 17 June 2010 18:13, David Blevins <david.blevins@visi.com> wrote:

>
> On Jun 17, 2010, at 1:06 AM, Yvan wrote:
>
> >
> > Well I don't know how you manage to get all you need with only one core
> jar
> > but just in case someone else uses the openejb-standalone container's
> > libraries as depedencies of his project, here is the full pom.xml
> > dependencies section to get the jars needed in the above mentioned
> > 3.2-SNAPSHOT:
>
> Maven will automatically pull in the dependencies of your dependencies,
> recursively, till all dependencies are collected.
>
> Looks like you need web services, so if you replaced your openejb-core
> dependency with the openejb-cxf module, you'll get everything listed.  Try
> just listing this jar:
>
>            <dependency>
>              <groupId>org.apache.openejb</groupId>
>              <artifactId>openejb-cxf</artifactId>
>              <version>${openejb.version}</version>
>              <optional>true</optional>
>

I would recommend against specifying optional=true unless the depenency
truely is optional.

IMHO most people fail to understand what <optional> is actually for... and
it never does what its supposed to do anyway ;-) [i.e. an optional
dependency is one which is not required but nice to have... but the way
maven works, it will just go ahead and download it anyway... it's in reality
a hack for projects which are too lazy to refactor into mix-in modules.

for example, log4j has an optional dependency on javax.mail

    <dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
      <version>1.4.1</version>
      <optional>true</optional>
    </dependency>

The reality is that when you use log4j:log4j:1.2.16, you will always pull
javax.mail:mail onto your classpath because maven will see the dependency,
and see that it can get the dependency, and so add it to your classpath for
you...

if log4j did not ship an uberjar, but instead split the classes that depend
on javax.mail into a log4j-mail module then there would be no need for the
optional dependency, people who need the mail support will just add a
dependency on the log4j-mail artifact and get the javax.mail added to their
classpath because they actually need it.

there are worse examples out there, for example, at one time one version of
log4j that I saw in a repo other than central had an optional dependency on
the Windows NT event logging support classes... and don't get me started on
the crazy fools who use profile activation based on OS to add dependencies
so that when you build on Windows you get one set of dependencies while
building on linux gives another (so that when I build on linux for a windows
machine my build fails!)

so, to end my rant... you never really want to specify
<optional>true</optional> you actually want to split the code that has that
dependency into it's own module...

thankfully what I've seen of openejb follows this pattern ;-)

-Stephen


>            </dependency>
>
> Here's a good reference pom for web services:
>
>
> http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/simple-webservice/pom.xml
>
> On a side note, we do pack in two files inside every jar which say exactly
> what that jars dependencies are.  These are mostly aimed at non-maven users
> -- maven takes care of that as mentioned above -- but it is interesting.
>
> These files are in the jar at:
>
>   - META-INF/dependencies.xml
>   - META-INF/dependencies.txt
>
> Here are the list of dependencies that get pulled in for the openejb-cxf
> module:
>
> <dependencies>
>  <dependency groupId="org.apache.cxf" artifactId="cxf-bundle"
> version="2.2.4" file-name="cxf-bundle-2.2.4.jar">
>    <dependency groupId="antlr" artifactId="antlr" version="2.7.7"
> file-name="antlr-2.7.7.jar"/>
>    <dependency groupId="asm" artifactId="asm" version="2.2.3"
> file-name="asm-2.2.3.jar"/>
>    <dependency groupId="com.sun.xml.messaging.saaj" artifactId="saaj-impl"
> version="1.3.2" file-name="saaj-impl-1.3.2.jar"/>
>    <dependency groupId="commons-codec" artifactId="commons-codec"
> version="1.3" file-name="commons-codec-1.3.jar"/>
>    <dependency groupId="commons-collections"
> artifactId="commons-collections" version="3.2"
> file-name="commons-collections-3.2.jar"/>
>    <dependency groupId="commons-lang" artifactId="commons-lang"
> version="2.1" file-name="commons-lang-2.1.jar"/>
>    <dependency groupId="commons-pool" artifactId="commons-pool"
> version="1.5.2" file-name="commons-pool-1.5.2.jar"/>
>    <dependency groupId="javax.ws.rs" artifactId="jsr311-api" version="1.0"
> file-name="jsr311-api-1.0.jar"/>
>    <dependency groupId="org.apache.abdera" artifactId="abdera-core"
> version="0.4.0-incubating" file-name="abdera-core-0.4.0-incubating.jar"/>
>    <dependency groupId="org.apache.abdera"
> artifactId="abdera-extensions-json" version="0.4.0-incubating"
> file-name="abdera-extensions-json-0.4.0-incubating.jar"/>
>    <dependency groupId="org.apache.abdera"
> artifactId="abdera-extensions-main" version="0.4.0-incubating"
> file-name="abdera-extensions-main-0.4.0-incubating.jar"/>
>    <dependency groupId="org.apache.abdera" artifactId="abdera-i18n"
> version="0.4.0-incubating" file-name="abdera-i18n-0.4.0-incubating.jar"/>
>    <dependency groupId="org.apache.abdera" artifactId="abdera-parser"
> version="0.4.0-incubating" file-name="abdera-parser-0.4.0-incubating.jar"/>
>    <dependency groupId="org.apache.geronimo.specs"
> artifactId="geronimo-jaxws_2.1_spec" version="1.0"
> file-name="geronimo-jaxws_2.1_spec-1.0.jar"/>
>    <dependency groupId="org.apache.neethi" artifactId="neethi"
> version="2.0.4" file-name="neethi-2.0.4.jar"/>
>    <dependency groupId="org.apache.santuario" artifactId="xmlsec"
> version="1.4.3" file-name="xmlsec-1.4.3.jar"/>
>    <dependency groupId="org.apache.velocity" artifactId="velocity"
> version="1.6.2" file-name="velocity-1.6.2.jar"/>
>    <dependency groupId="org.apache.ws.commons.axiom" artifactId="axiom-api"
> version="1.2.7" file-name="axiom-api-1.2.7.jar"/>
>    <dependency groupId="org.apache.ws.commons.axiom"
> artifactId="axiom-impl" version="1.2.7" file-name="axiom-impl-1.2.7.jar"/>
>    <dependency groupId="org.apache.ws.commons.schema"
> artifactId="XmlSchema" version="1.4.5" file-name="XmlSchema-1.4.5.jar"/>
>    <dependency groupId="org.apache.ws.security" artifactId="wss4j"
> version="1.5.8" file-name="wss4j-1.5.8.jar"/>
>    <dependency groupId="org.bouncycastle" artifactId="bcprov-jdk15"
> version="1.43" file-name="bcprov-jdk15-1.43.jar"/>
>    <dependency groupId="org.codehaus.jettison" artifactId="jettison"
> version="1.1" file-name="jettison-1.1.jar"/>
>    <dependency groupId="org.codehaus.woodstox" artifactId="wstx-asl"
> version="3.2.8" file-name="wstx-asl-3.2.8.jar"/>
>    <dependency groupId="org.slf4j" artifactId="slf4j-api" version="1.5.8"
> file-name="slf4j-api-1.5.8.jar"/>
>    <dependency groupId="org.slf4j" artifactId="slf4j-jdk14" version="1.5.8"
> file-name="slf4j-jdk14-1.5.8.jar"/>
>    <dependency groupId="oro" artifactId="oro" version="2.0.8"
> file-name="oro-2.0.8.jar"/>
>    <dependency groupId="xalan" artifactId="serializer" version="2.7.1"
> file-name="serializer-2.7.1.jar"/>
>  </dependency>
>  <dependency groupId="org.apache.openejb" artifactId="javaee-api"
> version="6.0-SNAPSHOT" file-name="javaee-api-6.0-SNAPSHOT.jar"/>
>  <dependency groupId="org.apache.openejb" artifactId="openejb-core"
> version="3.2-SNAPSHOT" file-name="openejb-core-3.2-SNAPSHOT.jar">
>    <dependency groupId="commons-cli" artifactId="commons-cli" version="1.1"
> file-name="commons-cli-1.1.jar"/>
>    <dependency groupId="commons-logging" artifactId="commons-logging"
> version="1.1" file-name="commons-logging-1.1.jar"/>
>    <dependency groupId="hsqldb" artifactId="hsqldb" version="1.8.0.7"
> file-name="hsqldb-1.8.0.7.jar"/>
>    <dependency groupId="log4j" artifactId="log4j" version="1.2.12"
> file-name="log4j-1.2.12.jar"/>
>    <dependency groupId="org.apache.activemq" artifactId="activemq-core"
> version="5.3.1" file-name="activemq-core-5.3.1.jar">
>      <dependency groupId="commons-logging" artifactId="commons-logging-api"
> version="1.1" file-name="commons-logging-api-1.1.jar"/>
>      <dependency groupId="commons-net" artifactId="commons-net"
> version="2.0" file-name="commons-net-2.0.jar"/>
>      <dependency groupId="org.apache.activemq" artifactId="activeio-core"
> version="3.1.2" file-name="activeio-core-3.1.2.jar">
>        <dependency groupId="org.apache.geronimo.specs"
> artifactId="geronimo-j2ee-management_1.1_spec" version="1.0.1"
> file-name="geronimo-j2ee-management_1.1_spec-1.0.1.jar"/>
>      </dependency>
>      <dependency groupId="org.apache.activemq" artifactId="kahadb"
> version="5.3.1" file-name="kahadb-5.3.1.jar"/>
>      <dependency groupId="org.apache.activemq.protobuf"
> artifactId="activemq-protobuf" version="1.0"
> file-name="activemq-protobuf-1.0.jar"/>
>      <dependency groupId="org.osgi" artifactId="org.osgi.core"
> version="4.2.0" file-name="org.osgi.core-4.2.0.jar"/>
>      <dependency groupId="org.springframework" artifactId="spring-context"
> version="2.5.6" file-name="spring-context-2.5.6.jar">
>        <dependency groupId="aopalliance" artifactId="aopalliance"
> version="1.0" file-name="aopalliance-1.0.jar"/>
>        <dependency groupId="org.springframework" artifactId="spring-beans"
> version="2.5.6" file-name="spring-beans-2.5.6.jar"/>
>        <dependency groupId="org.springframework" artifactId="spring-core"
> version="2.5.6" file-name="spring-core-2.5.6.jar"/>
>      </dependency>
>      <dependency groupId="org.springframework.osgi"
> artifactId="spring-osgi-core" version="1.2.1"
> file-name="spring-osgi-core-1.2.1.jar" download-url="
> http://www.springframework.org/osgi/">
>        <dependency groupId="org.springframework.osgi"
> artifactId="spring-osgi-io" version="1.2.1"
> file-name="spring-osgi-io-1.2.1.jar" download-url="
> http://www.springframework.org/osgi/"/>
>      </dependency>
>    </dependency>
>    <dependency groupId="org.apache.activemq" artifactId="activemq-ra"
> version="5.3.1" file-name="activemq-ra-5.3.1.jar"/>
>    <dependency groupId="org.apache.commons" artifactId="commons-math"
> version="2.1" file-name="commons-math-2.1.jar"/>
>    <dependency groupId="org.apache.geronimo.components"
> artifactId="geronimo-connector" version="2.1"
> file-name="geronimo-connector-2.1.jar"/>
>    <dependency groupId="org.apache.geronimo.components"
> artifactId="geronimo-transaction" version="2.1"
> file-name="geronimo-transaction-2.1.jar"/>
>    <dependency groupId="org.apache.geronimo.javamail"
> artifactId="geronimo-javamail_1.4_mail" version="1.2"
> file-name="geronimo-javamail_1.4_mail-1.2.jar"/>
>    <dependency groupId="org.apache.openejb" artifactId="commons-dbcp-all"
> version="1.3-r699049" file-name="commons-dbcp-all-1.3-r699049.jar"/>
>    <dependency groupId="org.apache.openejb" artifactId="openejb-api"
> version="3.2-SNAPSHOT" file-name="openejb-api-3.2-SNAPSHOT.jar"/>
>    <dependency groupId="org.apache.openejb" artifactId="openejb-javaagent"
> version="3.2-SNAPSHOT" file-name="openejb-javaagent-3.2-SNAPSHOT.jar"/>
>    <dependency groupId="org.apache.openejb" artifactId="openejb-jee"
> version="3.2-SNAPSHOT" file-name="openejb-jee-3.2-SNAPSHOT.jar">
>      <dependency groupId="com.sun.xml.bind" artifactId="jaxb-impl"
> version="2.1.9" file-name="jaxb-impl-2.1.9.jar"/>
>    </dependency>
>    <dependency groupId="org.apache.openejb" artifactId="openejb-loader"
> version="3.2-SNAPSHOT" file-name="openejb-loader-3.2-SNAPSHOT.jar"/>
>    <dependency groupId="org.apache.openjpa" artifactId="openjpa"
> version="1.2.1" file-name="openjpa-1.2.1.jar">
>      <dependency groupId="net.sourceforge.serp" artifactId="serp"
> version="1.13.1" file-name="serp-1.13.1.jar"/>
>    </dependency>
>    <dependency groupId="org.apache.xbean" artifactId="xbean-asm-shaded"
> version="3.8-20100615.232028-1"
> file-name="xbean-asm-shaded-3.8-SNAPSHOT.jar"/>
>    <dependency groupId="org.apache.xbean" artifactId="xbean-finder-shaded"
> version="3.8-20100615.232028-1"
> file-name="xbean-finder-shaded-3.8-SNAPSHOT.jar"/>
>    <dependency groupId="org.apache.xbean" artifactId="xbean-naming"
> version="3.8-20100615.232028-1" file-name="xbean-naming-3.8-SNAPSHOT.jar"/>
>    <dependency groupId="org.apache.xbean" artifactId="xbean-reflect"
> version="3.8-20100615.232028-1" file-name="xbean-reflect-3.8-SNAPSHOT.jar"/>
>    <dependency groupId="org.codehaus.swizzle" artifactId="swizzle-stream"
> version="1.0.1" file-name="swizzle-stream-1.0.1.jar"/>
>    <dependency groupId="org.objectweb.howl" artifactId="howl"
> version="1.0.1-1" file-name="howl-1.0.1-1.jar"/>
>    <dependency groupId="quartz" artifactId="quartz" version="1.5.2"
> file-name="quartz-1.5.2.jar"/>
>  </dependency>
>  <dependency groupId="org.apache.openejb" artifactId="openejb-http"
> version="3.2-SNAPSHOT" file-name="openejb-http-3.2-SNAPSHOT.jar">
>    <dependency groupId="org.apache.openejb" artifactId="openejb-ejbd"
> version="3.2-SNAPSHOT" file-name="openejb-ejbd-3.2-SNAPSHOT.jar"/>
>    <dependency groupId="org.apache.openejb" artifactId="openejb-server"
> version="3.2-SNAPSHOT" file-name="openejb-server-3.2-SNAPSHOT.jar">
>      <dependency groupId="org.apache.openejb" artifactId="openejb-client"
> version="3.2-SNAPSHOT" file-name="openejb-client-3.2-SNAPSHOT.jar"/>
>    </dependency>
>  </dependency>
>  <dependency groupId="org.apache.openejb" artifactId="openejb-webservices"
> version="3.2-SNAPSHOT" file-name="openejb-webservices-3.2-SNAPSHOT.jar"/>
>  <dependency groupId="wsdl4j" artifactId="wsdl4j" version="1.6.1"
> file-name="wsdl4j-1.6.1.jar"/>
>  <dependency groupId="xml-resolver" artifactId="xml-resolver" version="1.2"
> file-name="xml-resolver-1.2.jar"/>
> </dependencies>
>
>
>
> -David
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message