You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kiren Pillay <ki...@gmail.com> on 2011/05/17 17:51:49 UTC

Multi-module Web project - test-jar not copied

Hi

I have a multi-module maven web project which builds a war file.
Withing the WAR module I have some unit tests as well. I noticed now
that when I build the application from the root directory, the
test-jar is built, but does not get copied to the local repository.
Another test-jar is being placed in there for some reason.

If I had to build the war module by itself, which is 3 levels down,
the correct test-jar is installed in my local repository.

This looks like some kind of configuration issue.

Regards
Kiren


Parent pom (Incorrect Behaviour)

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>za.co.vodacom.pams</groupId>
    <artifactId>pams-main</artifactId>
    <version>1.1.0-QA-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>PAMS - Main</name>

    <modules>
        <module>core</module>
        <module>business_services</module>
    </modules>

    <properties>
        <pams.version>1.1.0-QA-SNAPSHOT</pams.version>
        <fcaps.version>1.0.0-QA-SNAPSHOT</fcaps.version>
        <spring.version>3.0.5.RELEASE</spring.version>
        <slf4j.version>1.6.1</slf4j.version>

        <log4j.version>1.2.12</log4j.version>
        <junit.version>4.8.1</junit.version>
        <java.source.version>1.6</java.source.version>
        <java.target.version>1.6</java.target.version>

        <cxf.version>2.3.3</cxf.version>
        <httpclient.version>3.1</httpclient.version>
        <jsr311.version>1.1.1</jsr311.version>
        <xmlBeans.version>2.5.0</xmlBeans.version>
        <tandem.jdbc.version>8.9.26</tandem.jdbc.version>
        <hibernate.version>3.3.2.GA</hibernate.version>
        <slf4j.version>1.6.1</slf4j.version>
        <slf4j.log4j.version>slf4j-log4j12</slf4j.log4j.version>
        <jtds.jdbc.version>1.2.2</jtds.jdbc.version>

    </properties>
    <organization>
    </organization>
    <build>
       <!-- Maven test JAR plugin, DONT remove -->
        <plugins>

            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <phase>test-compile</phase>
                    </execution>

                </executions>
				<!--<configuration>
					<outputDirectory>${basedir}\target</outputDirectory>
				</configuration>
			-->
            </plugin>

        </plugins>
    </build>
    <dependencyManagement>

        <dependencies>


			<!-- SLF -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>${slf4j.log4j.version}</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

			<!-- Tandem JDBC Driver -->
            <dependency>
                <groupId>com.tandem.t4jdbc</groupId>
                <artifactId>t4sqlmx</artifactId>
                <version>${tandem.jdbc.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

			<!-- Hibernate -->
			
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${hibernate.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>${hibernate.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>cglib</groupId>
                        <artifactId>cglib</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>dom4j</groupId>
                        <artifactId>dom4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
			


			<!--  3rd Party -->
			<!--  Log4J     -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>${log4j.version}</version>
            </dependency>

			<!--  JUnit     -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>compile</scope>
            </dependency>

			<!--  Spring      -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>

        </dependencies>

    </dependencyManagement>

    <distributionManagement>
        <repository>
            <id>vodacom-releases-local</id>
            <name>vodacom-releases-local</name>
            <url>http://bcx-repo/artifactory/vodacom-releases-local</url>
        </repository>
        <snapshotRepository>
            <id>vodacom-snapshots-local</id>
            <name>vodacom-snapshots-local</name>
            <url>http://bcx-repo/artifactory/vodacom-snapshots-local</url>
        </snapshotRepository>
    </distributionManagement>

    <ciManagement>
        <system>continuum</system>
        <url>http://bcx-repo/continuum</url>
    </ciManagement>

    <scm>
        <connection>scm:svn:http://bcx-svn/svn/vodacom.za/pams/server/branches/V1-1-0-QA/</connection>
        <developerConnection>scm:svn:http://bcx-svn/svn/vodacom.za/pams/server/branches/V1-1-0-QA/</developerConnection>
    </scm>
	


    <reporting>
        <plugins>
<!-- Plugins used for Hudson -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.2</version>

            </plugin>
            <!-- this is to solve the Hudson Memory issues -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.7.1</version>
                <configuration>
          <excludes>
            <exclude>**/Abstract*.java</exclude>
            <exclude>**/TestPAMSInfoService.java</exclude>
            <exclude>**/TestAirtimeTransferRegistrationQuery.java</exclude>
            <exclude>**/TetsRest.java</exclude>
            <exclude>**/TestQuerySubscriberINProfile.java</exclude>
          </excludes>


                    <forkMode>pertest</forkMode>
                    <argLine>-Xmx512m -XX:MaxPermSize=512m</argLine>

                </configuration>
            </plugin>



            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.0.1</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jdepend-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <sourceEncoding>utf-8</sourceEncoding>
                    <minimumTokens>10</minimumTokens>
                    <includeTests>false</includeTests>
                    <targetJdk>1.6</targetJdk>
                    <targetJdk>${maven.compiler.target}</targetJdk>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <xmlOutput>true</xmlOutput>
                    <findbugsXmlOutput>true</findbugsXmlOutput>
                    <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
                    <threshold>Default</threshold>

                    <debug>false</debug>
                    <relaxed>false</relaxed>
                    <maxHeap>1024</maxHeap>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <configuration>
                    <tags>
                        <tag>TODO</tag>
                        <tag>FIXME</tag>
                        <tag>@todo</tag>
                        <tag>@deprecated</tag>
                    </tags>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <formats>
                        <format>xml</format>
                    </formats>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

</project>

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


Re: Multi-module Web project - test-jar not copied

Posted by Wayne Fay <wa...@gmail.com>.
> The correct test jar sits in the target folder of the Web project.
> However the one in the local repository looks likes an empty module
> jar. I have attached the relevant files from the local repo.

What exactly do you want someone on this list to do for you?

Wayne

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


Re: Multi-module Web project - test-jar not copied

Posted by Kiren Pillay <ki...@gmail.com>.
Hi

The correct test jar sits in the target folder of the Web project.
However the one in the local repository looks likes an empty module
jar. I have attached the relevant files from the local repo.




On Tue, May 17, 2011 at 5:51 PM, Kiren Pillay <ki...@gmail.com> wrote:
> Hi
>
> I have a multi-module maven web project which builds a war file.
> Withing the WAR module I have some unit tests as well. I noticed now
> that when I build the application from the root directory, the
> test-jar is built, but does not get copied to the local repository.
> Another test-jar is being placed in there for some reason.
>
> If I had to build the war module by itself, which is 3 levels down,
> the correct test-jar is installed in my local repository.
>
> This looks like some kind of configuration issue.
>
> Regards
> Kiren
>
>
> Parent pom (Incorrect Behaviour)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> � � � �xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>
> � �<modelVersion>4.0.0</modelVersion>
>
> � �<groupId>za.co.vodacom.pams</groupId>
> � �<artifactId>pams-main</artifactId>
> � �<version>1.1.0-QA-SNAPSHOT</version>
> � �<packaging>pom</packaging>
> � �<name>PAMS - Main</name>
>
> � �<modules>
> � � � �<module>core</module>
> � � � �<module>business_services</module>
> � �</modules>
>
> � �<properties>
> � � � �<pams.version>1.1.0-QA-SNAPSHOT</pams.version>
> � � � �<fcaps.version>1.0.0-QA-SNAPSHOT</fcaps.version>
> � � � �<spring.version>3.0.5.RELEASE</spring.version>
> � � � �<slf4j.version>1.6.1</slf4j.version>
>
> � � � �<log4j.version>1.2.12</log4j.version>
> � � � �<junit.version>4.8.1</junit.version>
> � � � �<java.source.version>1.6</java.source.version>
> � � � �<java.target.version>1.6</java.target.version>
>
> � � � �<cxf.version>2.3.3</cxf.version>
> � � � �<httpclient.version>3.1</httpclient.version>
> � � � �<jsr311.version>1.1.1</jsr311.version>
> � � � �<xmlBeans.version>2.5.0</xmlBeans.version>
> � � � �<tandem.jdbc.version>8.9.26</tandem.jdbc.version>
> � � � �<hibernate.version>3.3.2.GA</hibernate.version>
> � � � �<slf4j.version>1.6.1</slf4j.version>
> � � � �<slf4j.log4j.version>slf4j-log4j12</slf4j.log4j.version>
> � � � �<jtds.jdbc.version>1.2.2</jtds.jdbc.version>
>
> � �</properties>
> � �<organization>
> � �</organization>
> � �<build>
> � � � <!-- Maven test JAR plugin, DONT remove -->
> � � � �<plugins>
>
> � � � � � �<plugin>
> � � � � � � � �<artifactId>maven-jar-plugin</artifactId>
> � � � � � � � �<version>2.3.1</version>
> � � � � � � � �<executions>
> � � � � � � � � � �<execution>
> � � � � � � � � � � � �<goals>
> � � � � � � � � � � � � � �<goal>test-jar</goal>
> � � � � � � � � � � � �</goals>
> � � � � � � � � � � � �<phase>test-compile</phase>
> � � � � � � � � � �</execution>
>
> � � � � � � � �</executions>
> � � � � � � � � � � � � � � � �<!--<configuration>
> � � � � � � � � � � � � � � � � � � � �<outputDirectory>${basedir}\target</outputDirectory>
> � � � � � � � � � � � � � � � �</configuration>
> � � � � � � � � � � � �-->
> � � � � � �</plugin>
>
> � � � �</plugins>
> � �</build>
> � �<dependencyManagement>
>
> � � � �<dependencies>
>
>
> � � � � � � � � � � � �<!-- SLF -->
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.slf4j</groupId>
> � � � � � � � �<artifactId>slf4j-api</artifactId>
> � � � � � � � �<version>${slf4j.version}</version>
> � � � � � �</dependency>
>
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.slf4j</groupId>
> � � � � � � � �<artifactId>jcl-over-slf4j</artifactId>
> � � � � � � � �<version>${slf4j.version}</version>
> � � � � � �</dependency>
>
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.slf4j</groupId>
> � � � � � � � �<artifactId>${slf4j.log4j.version}</artifactId>
> � � � � � � � �<version>${slf4j.version}</version>
> � � � � � �</dependency>
>
> � � � � � � � � � � � �<!-- Tandem JDBC Driver -->
> � � � � � �<dependency>
> � � � � � � � �<groupId>com.tandem.t4jdbc</groupId>
> � � � � � � � �<artifactId>t4sqlmx</artifactId>
> � � � � � � � �<version>${tandem.jdbc.version}</version>
> � � � � � � � �<exclusions>
> � � � � � � � � � �<exclusion>
> � � � � � � � � � � � �<groupId>commons-logging</groupId>
> � � � � � � � � � � � �<artifactId>commons-logging</artifactId>
> � � � � � � � � � �</exclusion>
> � � � � � � � �</exclusions>
> � � � � � �</dependency>
>
> � � � � � � � � � � � �<!-- Hibernate -->
>
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.hibernate</groupId>
> � � � � � � � �<artifactId>hibernate-core</artifactId>
> � � � � � � � �<version>${hibernate.version}</version>
> � � � � � � � �<exclusions>
> � � � � � � � � � �<exclusion>
> � � � � � � � � � � � �<groupId>commons-logging</groupId>
> � � � � � � � � � � � �<artifactId>commons-logging</artifactId>
> � � � � � � � � � �</exclusion>
> � � � � � � � �</exclusions>
> � � � � � �</dependency>
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.hibernate</groupId>
> � � � � � � � �<artifactId>hibernate-entitymanager</artifactId>
> � � � � � � � �<version>${hibernate.version}</version>
> � � � � � � � �<exclusions>
> � � � � � � � � � �<exclusion>
> � � � � � � � � � � � �<groupId>cglib</groupId>
> � � � � � � � � � � � �<artifactId>cglib</artifactId>
> � � � � � � � � � �</exclusion>
> � � � � � � � � � �<exclusion>
> � � � � � � � � � � � �<groupId>dom4j</groupId>
> � � � � � � � � � � � �<artifactId>dom4j</artifactId>
> � � � � � � � � � �</exclusion>
> � � � � � � � �</exclusions>
> � � � � � �</dependency>
>
>
>
> � � � � � � � � � � � �<!-- �3rd Party -->
> � � � � � � � � � � � �<!-- �Log4J � � -->
> � � � � � �<dependency>
> � � � � � � � �<groupId>log4j</groupId>
> � � � � � � � �<artifactId>log4j</artifactId>
> � � � � � � � �<version>${log4j.version}</version>
> � � � � � �</dependency>
>
> � � � � � � � � � � � �<!-- �JUnit � � -->
> � � � � � �<dependency>
> � � � � � � � �<groupId>junit</groupId>
> � � � � � � � �<artifactId>junit</artifactId>
> � � � � � � � �<version>${junit.version}</version>
> � � � � � � � �<scope>compile</scope>
> � � � � � �</dependency>
>
> � � � � � � � � � � � �<!-- �Spring � � �-->
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.springframework</groupId>
> � � � � � � � �<artifactId>spring-test</artifactId>
> � � � � � � � �<version>${spring.version}</version>
> � � � � � �</dependency>
>
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.springframework</groupId>
> � � � � � � � �<artifactId>spring-core</artifactId>
> � � � � � � � �<version>${spring.version}</version>
> � � � � � �</dependency>
>
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.springframework</groupId>
> � � � � � � � �<artifactId>spring-beans</artifactId>
> � � � � � � � �<version>${spring.version}</version>
> � � � � � �</dependency>
>
> � � � � � �<dependency>
> � � � � � � � �<groupId>org.springframework</groupId>
> � � � � � � � �<artifactId>spring-context</artifactId>
> � � � � � � � �<version>${spring.version}</version>
> � � � � � �</dependency>
>
> � � � �</dependencies>
>
> � �</dependencyManagement>
>
> � �<distributionManagement>
> � � � �<repository>
> � � � � � �<id>vodacom-releases-local</id>
> � � � � � �<name>vodacom-releases-local</name>
> � � � � � �<url>http://bcx-repo/artifactory/vodacom-releases-local</url>
> � � � �</repository>
> � � � �<snapshotRepository>
> � � � � � �<id>vodacom-snapshots-local</id>
> � � � � � �<name>vodacom-snapshots-local</name>
> � � � � � �<url>http://bcx-repo/artifactory/vodacom-snapshots-local</url>
> � � � �</snapshotRepository>
> � �</distributionManagement>
>
> � �<ciManagement>
> � � � �<system>continuum</system>
> � � � �<url>http://bcx-repo/continuum</url>
> � �</ciManagement>
>
> � �<scm>
> � � � �<connection>scm:svn:http://bcx-svn/svn/vodacom.za/pams/server/branches/V1-1-0-QA/</connection>
> � � � �<developerConnection>scm:svn:http://bcx-svn/svn/vodacom.za/pams/server/branches/V1-1-0-QA/</developerConnection>
> � �</scm>
>
>
>
> � �<reporting>
> � � � �<plugins>
> <!-- Plugins used for Hudson -->
>
> � � � � � �<plugin>
> � � � � � � � �<groupId>org.apache.maven.plugins</groupId>
> � � � � � � � �<artifactId>maven-checkstyle-plugin</artifactId>
> � � � � � � � �<version>2.2</version>
>
> � � � � � �</plugin>
> � � � � � �<!-- this is to solve the Hudson Memory issues -->
> � � � � � �<plugin>
> � � � � � � � �<groupId>org.apache.maven.plugins</groupId>
> � � � � � � � �<artifactId>maven-surefire-plugin</artifactId>
> � � � � � � � �<version>2.7.1</version>
> � � � � � � � �<configuration>
> � � � � �<excludes>
> � � � � � �<exclude>**/Abstract*.java</exclude>
> � � � � � �<exclude>**/TestPAMSInfoService.java</exclude>
> � � � � � �<exclude>**/TestAirtimeTransferRegistrationQuery.java</exclude>
> � � � � � �<exclude>**/TetsRest.java</exclude>
> � � � � � �<exclude>**/TestQuerySubscriberINProfile.java</exclude>
> � � � � �</excludes>
>
>
> � � � � � � � � � �<forkMode>pertest</forkMode>
> � � � � � � � � � �<argLine>-Xmx512m -XX:MaxPermSize=512m</argLine>
>
> � � � � � � � �</configuration>
> � � � � � �</plugin>
>
>
>
> � � � � � �<plugin>
> � � � � � � � �<groupId>org.apache.maven.plugins</groupId>
> � � � � � � � �<artifactId>maven-project-info-reports-plugin</artifactId>
> � � � � � � � �<version>2.0.1</version>
> � � � � � �</plugin>
> � � � � � �<plugin>
> � � � � � � � �<groupId>org.codehaus.mojo</groupId>
> � � � � � � � �<artifactId>jdepend-maven-plugin</artifactId>
> � � � � � �</plugin>
> � � � � � �<plugin>
> � � � � � � � �<artifactId>maven-pmd-plugin</artifactId>
> � � � � � � � �<configuration>
> � � � � � � � � � �<sourceEncoding>utf-8</sourceEncoding>
> � � � � � � � � � �<minimumTokens>10</minimumTokens>
> � � � � � � � � � �<includeTests>false</includeTests>
> � � � � � � � � � �<targetJdk>1.6</targetJdk>
> � � � � � � � � � �<targetJdk>${maven.compiler.target}</targetJdk>
> � � � � � � � �</configuration>
> � � � � � �</plugin>
>
> � � � � � �<plugin>
> � � � � � � � �<groupId>org.codehaus.mojo</groupId>
> � � � � � � � �<artifactId>findbugs-maven-plugin</artifactId>
> � � � � � � � �<version>2.3.1</version>
> � � � � � � � �<configuration>
> � � � � � � � � � �<xmlOutput>true</xmlOutput>
> � � � � � � � � � �<findbugsXmlOutput>true</findbugsXmlOutput>
> � � � � � � � � � �<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
> � � � � � � � � � �<threshold>Default</threshold>
>
> � � � � � � � � � �<debug>false</debug>
> � � � � � � � � � �<relaxed>false</relaxed>
> � � � � � � � � � �<maxHeap>1024</maxHeap>
> � � � � � � � �</configuration>
> � � � � � �</plugin>
> � � � � � �<plugin>
> � � � � � � � �<groupId>org.codehaus.mojo</groupId>
> � � � � � � � �<artifactId>taglist-maven-plugin</artifactId>
> � � � � � � � �<configuration>
> � � � � � � � � � �<tags>
> � � � � � � � � � � � �<tag>TODO</tag>
> � � � � � � � � � � � �<tag>FIXME</tag>
> � � � � � � � � � � � �<tag>@todo</tag>
> � � � � � � � � � � � �<tag>@deprecated</tag>
> � � � � � � � � � �</tags>
> � � � � � � � �</configuration>
> � � � � � �</plugin>
> � � � � � �<plugin>
> � � � � � � � �<groupId>org.codehaus.mojo</groupId>
> � � � � � � � �<artifactId>cobertura-maven-plugin</artifactId>
> � � � � � � � �<configuration>
> � � � � � � � � � �<formats>
> � � � � � � � � � � � �<format>xml</format>
> � � � � � � � � � �</formats>
> � � � � � � � �</configuration>
> � � � � � �</plugin>
> � � � �</plugins>
> � �</reporting>
>
> </project>
>

Re: Multi-module Web project - test-jar not copied

Posted by Wayne Fay <wa...@gmail.com>.
> that when I build the application from the root directory, the
> test-jar is built, but does not get copied to the local repository.
> Another test-jar is being placed in there for some reason.

Have you compared one test-jar vs the other to see what the
differences are etc? Without this information at a minimum, we can't
have any discussion.

Wayne

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


Re: Multi-module Web project - test-jar not copied

Posted by Wayne Fay <wa...@gmail.com>.
> the jar plugin or not. If the package for a module is a war file, does
> that mean one isn't allowed to write unit tests for any classes in
> that War file? (To me it should be allowed).

Of course you can write unit tests for classes in a war module. Be
aware that this is not the best practice. Instead, you are generally
encouraged to put your classes and tests in a separate module that
produces a jar file, and then depend on that artifact in your war
artifact.

> Is it the War plugin that's writing the empty test-jar into the local
> repository, if so, why is it doing that?

I doubt the war plugin is writing the empty test-jar. Run mvn with -X
(debug mode) and see what the build info looks like, you may notice
something that is oddly/wrongly configured that explains what is going
on -- don't forget that parent modules can mix configuration with
their children, so your configuration issue may not even be in this
module's pom.xml.

If you can't sort it out, don't send the full debug log here
(attachments are stripped and huge debug logs are annoying to read in
email), please post it online somewhere like pastebin.com and send a
link here instead.

Wayne

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


Re: Multi-module Web project - test-jar not copied

Posted by Kiren Pillay <ki...@gmail.com>.
Thanks for your comments.

Well basically Wayne, I'm trying to determine whether this a bug with
the jar plugin or not. If the package for a module is a war file, does
that mean one isn't allowed to write unit tests for any classes in
that War file? (To me it should be allowed).

Is it the War plugin that's writing the empty test-jar into the local
repository, if so, why is it doing that?

On Thu, May 19, 2011 at 6:42 PM, Wendy Smoak <ws...@gmail.com> wrote:
> On Tue, May 17, 2011 at 11:51 AM, Kiren Pillay <ki...@gmail.com> wrote:
>> Hi
>>
>> I have a multi-module maven web project which builds a war file.
>> Withing the WAR module I have some unit tests as well. I noticed now
>> that when I build the application from the root directory, the
>> test-jar is built, but does not get copied to the local repository.
>> Another test-jar is being placed in there for some reason.
>
> If you have enough code in your war module that you're interested in
> the unit tests, then the code should probably be moved out to its own
> jar module.  (The webapp would then depend on that  jar.)
>
> Most likely the jar plugin will start behaving the way you want at
> that point.  I'm not certain what configuring the jar plugin is going
> to do when the packaging is war.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> 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: Multi-module Web project - test-jar not copied

Posted by Wendy Smoak <ws...@gmail.com>.
On Tue, May 17, 2011 at 11:51 AM, Kiren Pillay <ki...@gmail.com> wrote:
> Hi
>
> I have a multi-module maven web project which builds a war file.
> Withing the WAR module I have some unit tests as well. I noticed now
> that when I build the application from the root directory, the
> test-jar is built, but does not get copied to the local repository.
> Another test-jar is being placed in there for some reason.

If you have enough code in your war module that you're interested in
the unit tests, then the code should probably be moved out to its own
jar module.  (The webapp would then depend on that  jar.)

Most likely the jar plugin will start behaving the way you want at
that point.  I'm not certain what configuring the jar plugin is going
to do when the packaging is war.

-- 
Wendy

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