You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Daivish Shah <da...@gmail.com> on 2012/05/01 20:44:27 UTC

How to include WAR dependency in project

Hi,

I have following dependency declared in my UNIT Testing module project.

<dependency>
    <groupId>sample-project-ws</groupId>
    <artifactId>sample-project-ws</artifactId>

     <version>${project.version}</version>

    <type>war</type>
    <scope>test</scope>
</dependency>


And i also have following entry in my unit testing module project
which is different then my web service project.

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
            <overlays>
                <overlay/>
                <overlay>
                    <groupId>sample-project-ws</groupId>
                    <artifactId>your-project-artifactId</artifactId>
                </overlay>
            </overlays>
        </configuration>
    </plugin>

And i am using Webservice depedency classes, in my JUNIT module which
is build under that WAR project.

But i am not able to add it, Please help me out on this.


Thanks.

Re: How to include WAR dependency in project

Posted by Daivish Shah <da...@gmail.com>.
Thanks Stanimir,


I modified my code like this.

JUNIT Module POM.XML

<dependency>
    <groupId>sample-project-ws</****groupId>
    <artifactId>sample-project-ws<****/artifactId>

     <version>${project.version}</****version>
     <classifier>classes</classes>
    <scope>test</scope>
</dependency>


My sample-project-ws POM.XML

<plugins>
    <plugin>
        <groupId>org.apache.maven.****plugins</groupId>
        <artifactId>maven-war-plugin</****artifactId>
        <configuration>
               <attachClasses>true</attachClasses>
        </configuration>
    </plugin>


Thanks a lot for your help.




On Tue, May 1, 2012 at 1:08 PM, Stanimir Stamenkov <s7...@netscape.net>wrote:

> Tue, 1 May 2012 11:44:27 -0700, /Daivish Shah/:
>
>  I have following dependency declared in my UNIT Testing module project.
>>
>> <dependency>
>>    <groupId>sample-project-ws</**groupId>
>>    <artifactId>sample-project-ws<**/artifactId>
>>    <version>${project.version}</**version>
>>    <type>war</type>
>>    <scope>test</scope>
>> </dependency>
>> [...]
>>
>
> If you control the POM of "sample-project-ws" you could produce additional
> 'classes' jar artifact:
>
> http://maven.apache.org/**plugins/maven-war-plugin/war-**
> mojo.html#attachClasses<http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses>
>
> which you could then refer to as dependency from other modules:
>
>
> <dependency>
>    <groupId>sample-project-ws</**groupId>
>    <artifactId>sample-project-ws<**/artifactId>
>    <version>${project.version}</**version>
>    <classifier>classes</**classifier>
>    <scope>test</scope>
> </dependency>
>
> --
> Stanimir
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<us...@maven.apache.org>
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to include WAR dependency in project

Posted by Stanimir Stamenkov <s7...@netscape.net>.
Tue, 1 May 2012 11:44:27 -0700, /Daivish Shah/:

> I have following dependency declared in my UNIT Testing module project.
>
> <dependency>
>     <groupId>sample-project-ws</groupId>
>     <artifactId>sample-project-ws</artifactId>
>     <version>${project.version}</version>
>     <type>war</type>
>     <scope>test</scope>
> </dependency>
> [...]

If you control the POM of "sample-project-ws" you could produce 
additional 'classes' jar artifact:

http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses

which you could then refer to as dependency from other modules:

<dependency>
     <groupId>sample-project-ws</groupId>
     <artifactId>sample-project-ws</artifactId>
     <version>${project.version}</version>
     <classifier>classes</classifier>
     <scope>test</scope>
</dependency>

-- 
Stanimir

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


Re: How to include WAR dependency in project

Posted by Ron Wheeler <rw...@artifact-software.com>.
Break the WAR project into 2 projects.
One with code that makes a JAR and one without code to make a WAR.

You could put your unit tests in the jar project which is what most 
people do or make a third project that has some test routines that test 
your code.

Ron

On 01/05/2012 3:12 PM, Daivish Shah wrote:
> I have some integration UNIT test cases.
>
> Which require me to include those JAVA files in my integration unit test
> module, And this module is designed to include all UNIT test case for that
> parent project.
>
> I hope you got it. But do you have any solution of my question ?
>
>
>
> On Tue, May 1, 2012 at 11:59 AM, Ron Wheeler<rwheeler@artifact-software.com
>> wrote:
>> What are you trying to do?
>> It is unusual for a WAR to be a dependency.
>>   Even more unusual for a WebService to be a dependency.
>>
>> What are you testing?
>>
>> Ron
>>
>>
>> On 01/05/2012 2:44 PM, Daivish Shah wrote:
>>
>>> Hi,
>>>
>>> I have following dependency declared in my UNIT Testing module project.
>>>
>>> <dependency>
>>>      <groupId>sample-project-ws</**groupId>
>>>      <artifactId>sample-project-ws<**/artifactId>
>>>
>>>       <version>${project.version}</**version>
>>>
>>>      <type>war</type>
>>>      <scope>test</scope>
>>> </dependency>
>>>
>>>
>>> And i also have following entry in my unit testing module project
>>> which is different then my web service project.
>>>
>>> <plugins>
>>>      <plugin>
>>>          <groupId>org.apache.maven.**plugins</groupId>
>>>          <artifactId>maven-war-plugin</**artifactId>
>>>          <configuration>
>>>              <overlays>
>>>                  <overlay/>
>>>                  <overlay>
>>>                      <groupId>sample-project-ws</**groupId>
>>>                      <artifactId>your-project-**artifactId</artifactId>
>>>                  </overlay>
>>>              </overlays>
>>>          </configuration>
>>>      </plugin>
>>>
>>> And i am using Webservice depedency classes, in my JUNIT module which
>>> is build under that WAR project.
>>>
>>> But i am not able to add it, Please help me out on this.
>>>
>>>
>>> Thanks.
>>>
>>>
>> --
>> Ron Wheeler
>> President
>> Artifact Software Inc
>> email: rwheeler@artifact-software.com
>> skype: ronaldmwheeler
>> phone: 866-970-2435, ext 102
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<us...@maven.apache.org>
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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


Re: How to include WAR dependency in project

Posted by Daivish Shah <da...@gmail.com>.
I have some integration UNIT test cases.

Which require me to include those JAVA files in my integration unit test
module, And this module is designed to include all UNIT test case for that
parent project.

I hope you got it. But do you have any solution of my question ?



On Tue, May 1, 2012 at 11:59 AM, Ron Wheeler <rwheeler@artifact-software.com
> wrote:

> What are you trying to do?
> It is unusual for a WAR to be a dependency.
>  Even more unusual for a WebService to be a dependency.
>
> What are you testing?
>
> Ron
>
>
> On 01/05/2012 2:44 PM, Daivish Shah wrote:
>
>> Hi,
>>
>> I have following dependency declared in my UNIT Testing module project.
>>
>> <dependency>
>>     <groupId>sample-project-ws</**groupId>
>>     <artifactId>sample-project-ws<**/artifactId>
>>
>>      <version>${project.version}</**version>
>>
>>     <type>war</type>
>>     <scope>test</scope>
>> </dependency>
>>
>>
>> And i also have following entry in my unit testing module project
>> which is different then my web service project.
>>
>> <plugins>
>>     <plugin>
>>         <groupId>org.apache.maven.**plugins</groupId>
>>         <artifactId>maven-war-plugin</**artifactId>
>>         <configuration>
>>             <overlays>
>>                 <overlay/>
>>                 <overlay>
>>                     <groupId>sample-project-ws</**groupId>
>>                     <artifactId>your-project-**artifactId</artifactId>
>>                 </overlay>
>>             </overlays>
>>         </configuration>
>>     </plugin>
>>
>> And i am using Webservice depedency classes, in my JUNIT module which
>> is build under that WAR project.
>>
>> But i am not able to add it, Please help me out on this.
>>
>>
>> Thanks.
>>
>>
>
> --
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<us...@maven.apache.org>
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to include WAR dependency in project

Posted by Ron Wheeler <rw...@artifact-software.com>.
What are you trying to do?
It is unusual for a WAR to be a dependency.
  Even more unusual for a WebService to be a dependency.

What are you testing?

Ron

On 01/05/2012 2:44 PM, Daivish Shah wrote:
> Hi,
>
> I have following dependency declared in my UNIT Testing module project.
>
> <dependency>
>      <groupId>sample-project-ws</groupId>
>      <artifactId>sample-project-ws</artifactId>
>
>       <version>${project.version}</version>
>
>      <type>war</type>
>      <scope>test</scope>
> </dependency>
>
>
> And i also have following entry in my unit testing module project
> which is different then my web service project.
>
> <plugins>
>      <plugin>
>          <groupId>org.apache.maven.plugins</groupId>
>          <artifactId>maven-war-plugin</artifactId>
>          <configuration>
>              <overlays>
>                  <overlay/>
>                  <overlay>
>                      <groupId>sample-project-ws</groupId>
>                      <artifactId>your-project-artifactId</artifactId>
>                  </overlay>
>              </overlays>
>          </configuration>
>      </plugin>
>
> And i am using Webservice depedency classes, in my JUNIT module which
> is build under that WAR project.
>
> But i am not able to add it, Please help me out on this.
>
>
> Thanks.
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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