You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stephen Duncan Jr <st...@gmail.com> on 2009/01/14 23:39:26 UTC

Maven EAR Plugin ContextRoot

I'm following the instructions here to set the context-root for my web
modules as specified here:
http://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-context-root.html

It seems to have no effect on the generated application.xml, the
context-root still has the default values.  I couldn't find any mention of
this problem.  Can anyone else indicate if this works or not in the current
release of the maven-ear-pluging (2.3.1)?

-- 
Stephen Duncan Jr
www.stephenduncanjr.com

Re: Maven EAR Plugin ContextRoot

Posted by Stephen Duncan Jr <st...@gmail.com>.
On Sun, Jan 18, 2009 at 5:30 AM, Stephane Nicoll
<st...@gmail.com>wrote:

> On Wed, Jan 14, 2009 at 11:39 PM, Stephen Duncan Jr
>
> It is working with both 2.3.1 and the trunk. I've just tried on a
> stupid project that I have for testing and it worked. Can you maybe
> post your pom.xml file?
>
> <plugin>
>  <artifactId>maven-ear-plugin</artifactId>
>  <version>2.3.1</version>
>  <configuration>
>    <modules>
>      <webModule>
>        <groupId>root.project.servlets</groupId>
>        <artifactId>servlet</artifactId>
>        <contextRoot>/foobar</contextRoot>
>      </webModule>
>    </modules>
>  </configuration>
> </plugin>
>
> >
> > --
> > Stephen Duncan Jr
> > www.stephenduncanjr.com
> >
>
>
>
> --
> Large Systems Suck: This rule is 100% transitive. If you build one,
> you suck" -- S.Yegge
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Somehow I'd gone all this time without noticing that I was missing the
<modules> level of the configuration.  Thanks for verifying that it did work
so that I re-examined my pom more closely.  Apologies for the mistake.

-- 
Stephen Duncan Jr
www.stephenduncanjr.com

Re: Maven EAR Plugin ContextRoot

Posted by Stephane Nicoll <st...@gmail.com>.
On Wed, Jan 14, 2009 at 11:39 PM, Stephen Duncan Jr
<st...@gmail.com> wrote:
> I'm following the instructions here to set the context-root for my web
> modules as specified here:
> http://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-context-root.html
>
> It seems to have no effect on the generated application.xml, the
> context-root still has the default values.  I couldn't find any mention of
> this problem.  Can anyone else indicate if this works or not in the current
> release of the maven-ear-pluging (2.3.1)?

It is working with both 2.3.1 and the trunk. I've just tried on a
stupid project that I have for testing and it worked. Can you maybe
post your pom.xml file?

<plugin>
  <artifactId>maven-ear-plugin</artifactId>
  <version>2.3.1</version>
  <configuration>
    <modules>
      <webModule>
        <groupId>root.project.servlets</groupId>
        <artifactId>servlet</artifactId>
        <contextRoot>/foobar</contextRoot>
      </webModule>
    </modules>
  </configuration>
</plugin>

>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com
>



-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


Re: Maven EAR Plugin ContextRoot

Posted by Stephen Duncan Jr <st...@gmail.com>.
On Thu, Jan 15, 2009 at 3:43 PM, Wayne Fay <wa...@gmail.com> wrote:

> > For now I've worked around the issue by using the applicationXml
> > configuration to point to my own application.xml with the context-root
> being
> > set, instead of using the generated one.  I'd still like to know if this
> is
> > just broken for everyone, or if there's something I'm missing so I can
> > decide how to file a bug.
>
> Take a look at the source code:
>
> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/WebModule.java?revision=728546&view=markup
>
> If I were you, I'd debug that class/method in an IDE or add some
> System.out's to see what's going on during the execution of the code.
> (This assumes you pull down the entire plugin and rebuild it with a
> new version eg 2.3.99 which you'd build and install locally, and then
> specify it in your pom.xml file -- make sure you delete it later!)
> Without doing that, I'm not sure if there's a bug here or not.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
I don't see anything in the source code that looks like it gets the
contextRoot from the configuration.  The one method that mentions it 1)
checks for null, and then sets it to the default if it's still null, even
though the constructor initializes it the default, 2) that method
(resolveArtifact) is never called.

I don't really understand how nested configuration elements like this are
supposed to be set.  I'd be willing to try to debug the issue further if I
knew where to start.

-- 
Stephen Duncan Jr
www.stephenduncanjr.com

Re: Maven EAR Plugin ContextRoot

Posted by Wayne Fay <wa...@gmail.com>.
> For now I've worked around the issue by using the applicationXml
> configuration to point to my own application.xml with the context-root being
> set, instead of using the generated one.  I'd still like to know if this is
> just broken for everyone, or if there's something I'm missing so I can
> decide how to file a bug.

Take a look at the source code:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/WebModule.java?revision=728546&view=markup

If I were you, I'd debug that class/method in an IDE or add some
System.out's to see what's going on during the execution of the code.
(This assumes you pull down the entire plugin and rebuild it with a
new version eg 2.3.99 which you'd build and install locally, and then
specify it in your pom.xml file -- make sure you delete it later!)
Without doing that, I'm not sure if there's a bug here or not.

Wayne

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


Re: Maven EAR Plugin ContextRoot

Posted by Stephen Duncan Jr <st...@gmail.com>.
On Wed, Jan 14, 2009 at 5:39 PM, Stephen Duncan Jr <stephen.duncan@gmail.com
> wrote:

> I'm following the instructions here to set the context-root for my web
> modules as specified here:
> http://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-context-root.html
>
> It seems to have no effect on the generated application.xml, the
> context-root still has the default values.  I couldn't find any mention of
> this problem.  Can anyone else indicate if this works or not in the current
> release of the maven-ear-pluging (2.3.1)?
>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com
>

For now I've worked around the issue by using the applicationXml
configuration to point to my own application.xml with the context-root being
set, instead of using the generated one.  I'd still like to know if this is
just broken for everyone, or if there's something I'm missing so I can
decide how to file a bug.

-- 
Stephen Duncan Jr
www.stephenduncanjr.com