You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "David C. Hicks" <dh...@i-hicks.org> on 2009/02/06 18:10:32 UTC

Referring to another module's artifact?

I'm sure I'm going to feel stupid when someone tells me how, but I can't 
find a way to refer to another module's artifact from within the same 
multi-module pom.  Specifically, I have an "integration test" module in 
which I want to use the Jetty plugin to run the WAR created by a prior 
module's build.  I just don't know how to refer to that artifact from 
one of its sibling modules.  Anyone?

Thanks,
Dave


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


Re: Referring to another module's artifact?

Posted by "David C. Hicks" <dh...@i-hicks.org>.
Hmmm...I can't imagine a scenario where that makes sense, but I can't 
say there isn't one.  The WAR is created already.  I just need to launch 
Jetty (or some other container) to run the WAR, then run the test suite 
against the container.

I actually got this working - sort of.  I'm not happy with it, yet, 
though.  As far as I can tell, the Jetty plugin "run-war" goal doesn't 
support the capability to provide a jetty-env.xml file the way the 
jetty:run goal does.  Maybe it's just not documented, but I couldn't 
make it work, either.  So, I ended up running the exploded directory 
from my integration-test module by referring to the other module's 
directories.  (Like I said, I'm not very happy with it.)

I'd love to see a good example of something like this.  I'm sure someone 
has solved this problem in a more "Maven" kind of way.  I plan to have a 
look at Selenium over the weekend as a possible option.


Rusty Wright wrote:
> Would it make sense for the integration test make its own war?  The 
> jetty plugin docs say for webApp:
>
> defaults to ${project.build.directory}/${project.build.finalName}.war
>
>
> David C. Hicks wrote:
>> Oh yuck! That looked a whole lot better when I clicked the "Send" 
>> button. Hopefully, this is more readable...
>>
>> David C. Hicks wrote:
>>> <plugin>
>>> <groupId>org.mortbay.jetty</groupId>
>>> <artifactId>maven-jetty-plugin</artifactId>
>>> <version>6.1.11</version>
>>> <configuration>
>>> <webApp>
>>> <<something refering to the sibling artifact WAR file goes here>>
>>> </webApp>
>>> </configuration>
>>>
>>
>> ---------------------------------------------------------------------
>> 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: Referring to another module's artifact?

Posted by Rusty Wright <ru...@gmail.com>.
Would it make sense for the integration test make its own war?  The jetty plugin docs say for webApp:

 defaults to ${project.build.directory}/${project.build.finalName}.war


David C. Hicks wrote:
> Oh yuck! That looked a whole lot better when I clicked the "Send" 
> button. Hopefully, this is more readable...
> 
> David C. Hicks wrote:
>> <plugin>
>> <groupId>org.mortbay.jetty</groupId>
>> <artifactId>maven-jetty-plugin</artifactId>
>> <version>6.1.11</version>
>> <configuration>
>> <webApp>
>> <<something refering to the sibling artifact WAR file goes here>>
>> </webApp>
>> </configuration>
>>
> 
> ---------------------------------------------------------------------
> 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: Referring to another module's artifact?

Posted by "David C. Hicks" <dh...@i-hicks.org>.
Oh yuck! That looked a whole lot better when I clicked the "Send" 
button. Hopefully, this is more readable...

David C. Hicks wrote:
> <plugin>
> <groupId>org.mortbay.jetty</groupId>
> <artifactId>maven-jetty-plugin</artifactId>
> <version>6.1.11</version>
> <configuration>
> <webApp>
> <<something refering to the sibling artifact WAR file goes here>>
> </webApp>
> </configuration>
>

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


Re: Referring to another module's artifact?

Posted by "David C. Hicks" <dh...@i-hicks.org>.
I understand that I need to have a dependency to make sure that the 
modules are processed in the proper order. I need to refer to the actual 
artifact FILE in the Jetty plugin configuration in order to run the WAR. 
This would be the plugin config:

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.11</version>
<configuration>
<webApp>
<<something refering to the sibling artifact WAR file goes here>>
</webApp>
</configuration>

I guess I can use something like: ../<sibling module 
name>/target/<sibling module name>-${project.version}.war
I just figured there must be something better than "hard-coding" that 
value in that way.

Thanks,
Dave


Todd Thiessen wrote:
> Just added it as a dependency. ie:
>
>     <dependency>
>       <groupId>${project.groupId}</groupId>
>       <artifactId><sibling artifact ID></artifactId>
>       <version>${project.version}</version>
>       <type>jar</type>
>       <scope>compile</scope>
>     </dependency>
>
> ---
> Todd Thiessen
>  
>
>   
>> -----Original Message-----
>> From: David C. Hicks [mailto:dhicks@i-hicks.org] 
>> Sent: Friday, February 06, 2009 12:11 PM
>> To: Maven Users
>> Subject: Referring to another module's artifact?
>>
>> I'm sure I'm going to feel stupid when someone tells me how, 
>> but I can't find a way to refer to another module's artifact 
>> from within the same multi-module pom.  Specifically, I have 
>> an "integration test" module in which I want to use the Jetty 
>> plugin to run the WAR created by a prior module's build.  I 
>> just don't know how to refer to that artifact from one of its 
>> sibling modules.  Anyone?
>>
>> Thanks,
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> 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: Referring to another module's artifact?

Posted by Todd Thiessen <th...@nortel.com>.
Just added it as a dependency. ie:

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId><sibling artifact ID></artifactId>
      <version>${project.version}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>

---
Todd Thiessen
 

> -----Original Message-----
> From: David C. Hicks [mailto:dhicks@i-hicks.org] 
> Sent: Friday, February 06, 2009 12:11 PM
> To: Maven Users
> Subject: Referring to another module's artifact?
> 
> I'm sure I'm going to feel stupid when someone tells me how, 
> but I can't find a way to refer to another module's artifact 
> from within the same multi-module pom.  Specifically, I have 
> an "integration test" module in which I want to use the Jetty 
> plugin to run the WAR created by a prior module's build.  I 
> just don't know how to refer to that artifact from one of its 
> sibling modules.  Anyone?
> 
> Thanks,
> Dave
> 
> 
> ---------------------------------------------------------------------
> 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: Referring to another module's artifact?

Posted by ossi petz <os...@gmail.com>.
hallo

well i hope its that simple :)

just add it as a dependency!

<dependency>
	<groupId>${project.groupId}</groupId>
	<artifactId>common</artifactId>
	<version>${project.version}</version>
</dependency>

this could be a module in the multimodule build too. no difference to
'external' dependencies.

regards

ossi



David C. Hicks schrieb:
> I'm sure I'm going to feel stupid when someone tells me how, but I can't
> find a way to refer to another module's artifact from within the same
> multi-module pom.  Specifically, I have an "integration test" module in
> which I want to use the Jetty plugin to run the WAR created by a prior
> module's build.  I just don't know how to refer to that artifact from
> one of its sibling modules.  Anyone?
> 
> Thanks,
> Dave


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