You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Naresh Bhatia <NB...@sapient.com> on 2006/08/26 07:52:38 UTC

Should Acegi be packaged into ear or war?

I am packaging my web application as an ear file because it uses EJBs. I
am using Acegi for security. However if I add Acegi as a dependency in
the war subproject then it pulls in bunch of other jars that are also
needed in my ejb subproject (such as spring) and I run into classloader
issues at runtime. To avoid this, I have moved the Acegi dependency into
the ejb package. Now everything works fine - Acegi and Spring are both
available to the web application. The only problem is that the web
application cannot access Acegi taglibs because they are no longer under
WEB-INF/lib. I could put Acegi back in the war project but I would have
to exclude all the dependent jars - I don't like doing this because the
list of Acegi dependent jars is really long! What is the most elegant
way to handle this situation?

 

Thanks.

Naresh


RE: Should Acegi be packaged into ear or war?

Posted by Naresh Bhatia <NB...@sapient.com>.
Henry, Matt,

I had solved this by doing exactly what you suggested - so thanks for
the confirmation. I basically found that it was impossible to use the
taglibs packaged with acegi if I kept the acegi jar at the ear level.
Hence moving to war became necessary, followed by the exclusions -
otherwise spring was being loaded by the war as well as the ear -
causing nothing but trouble :).

Thanks again.

Naresh
 
-----Original Message-----
From: Matt Raible [mailto:mraible@gmail.com] 
Sent: Tuesday, August 29, 2006 8:53 PM
To: Maven Users List
Subject: Re: Should Acegi be packaged into ear or war?

Here's what I'm using:

        <dependency>
            <groupId>org.acegisecurity</groupId>
            <artifactId>acegi-security</artifactId>
            <version>1.0.1</version>
            <exclusions>
                <!-- Maven thinks 2.0 is newer than 2.1 -->
                <exclusion>
                    <groupId>commons-lang</groupId>
                    <artifactId>commons-lang</artifactId>
                </exclusion>
                <!-- exclude older versions of Spring -->
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-remoting</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-jdbc</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-support</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

I exclude individual spring artifacts because I'm including the
following:

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.0-rc2</version>
        </dependency>

... and Maven (or maybe it's the poms) doesn't recognize that this JAR
is the same (and newer!) as all the Acegi dependencies.

Matt

On 8/29/06, Henry S. Isidro <hi...@exist.com> wrote:
> On Saturday, August 26, 2006 13:52, Naresh Bhatia wrote:
> > I am packaging my web application as an ear file because it uses
EJBs. I
> > am using Acegi for security. However if I add Acegi as a dependency
in
> > the war subproject then it pulls in bunch of other jars that are
also
> > needed in my ejb subproject (such as spring) and I run into
classloader
> > issues at runtime. To avoid this, I have moved the Acegi dependency
into
> > the ejb package. Now everything works fine - Acegi and Spring are
both
> > available to the web application. The only problem is that the web
> > application cannot access Acegi taglibs because they are no longer
under
> > WEB-INF/lib. I could put Acegi back in the war project but I would
have
> > to exclude all the dependent jars - I don't like doing this because
the
> > list of Acegi dependent jars is really long! What is the most
elegant
> > way to handle this situation?
> >
> >
> >
> > Thanks.
> >
> > Naresh
>
>
>
> You can try excluding those jars from being pulled in, just use the
> <exclusions> tag in the pom. For more information, check this out:
>
http://maven.apache.org/guides/introduction/introduction-to-dependency-m
echanism.html
>
> HTH,
> Henry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Should Acegi be packaged into ear or war?

Posted by Matt Raible <mr...@gmail.com>.
Here's what I'm using:

        <dependency>
            <groupId>org.acegisecurity</groupId>
            <artifactId>acegi-security</artifactId>
            <version>1.0.1</version>
            <exclusions>
                <!-- Maven thinks 2.0 is newer than 2.1 -->
                <exclusion>
                    <groupId>commons-lang</groupId>
                    <artifactId>commons-lang</artifactId>
                </exclusion>
                <!-- exclude older versions of Spring -->
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-remoting</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-jdbc</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-support</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

I exclude individual spring artifacts because I'm including the following:

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.0-rc2</version>
        </dependency>

... and Maven (or maybe it's the poms) doesn't recognize that this JAR
is the same (and newer!) as all the Acegi dependencies.

Matt

On 8/29/06, Henry S. Isidro <hi...@exist.com> wrote:
> On Saturday, August 26, 2006 13:52, Naresh Bhatia wrote:
> > I am packaging my web application as an ear file because it uses EJBs. I
> > am using Acegi for security. However if I add Acegi as a dependency in
> > the war subproject then it pulls in bunch of other jars that are also
> > needed in my ejb subproject (such as spring) and I run into classloader
> > issues at runtime. To avoid this, I have moved the Acegi dependency into
> > the ejb package. Now everything works fine - Acegi and Spring are both
> > available to the web application. The only problem is that the web
> > application cannot access Acegi taglibs because they are no longer under
> > WEB-INF/lib. I could put Acegi back in the war project but I would have
> > to exclude all the dependent jars - I don't like doing this because the
> > list of Acegi dependent jars is really long! What is the most elegant
> > way to handle this situation?
> >
> >
> >
> > Thanks.
> >
> > Naresh
>
>
>
> You can try excluding those jars from being pulled in, just use the
> <exclusions> tag in the pom. For more information, check this out:
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
>
> HTH,
> Henry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Should Acegi be packaged into ear or war?

Posted by "Henry S. Isidro" <hi...@exist.com>.
On Saturday, August 26, 2006 13:52, Naresh Bhatia wrote:
> I am packaging my web application as an ear file because it uses EJBs. I
> am using Acegi for security. However if I add Acegi as a dependency in
> the war subproject then it pulls in bunch of other jars that are also
> needed in my ejb subproject (such as spring) and I run into classloader
> issues at runtime. To avoid this, I have moved the Acegi dependency into
> the ejb package. Now everything works fine - Acegi and Spring are both
> available to the web application. The only problem is that the web
> application cannot access Acegi taglibs because they are no longer under
> WEB-INF/lib. I could put Acegi back in the war project but I would have
> to exclude all the dependent jars - I don't like doing this because the
> list of Acegi dependent jars is really long! What is the most elegant
> way to handle this situation?
>
>
>
> Thanks.
>
> Naresh



You can try excluding those jars from being pulled in, just use the 
<exclusions> tag in the pom. For more information, check this out: 
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

HTH,
Henry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org