maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From offbyone <r...@iridiumsuite.com>
Subject Re: using build profiles for WAR plugin
Date Fri, 02 Mar 2012 00:17:04 GMT
Really struggling here and could use some help with these overlays.  I seem
to be missing basic concepts or maybe I am just slow, sorry if these
questions are pedestrian.

So I am trying to produce an overlay to add the extra configuration for each
of my server deployments.  

I have my main project which is a package pom type.  It has dependencies, a
compiler plugin and a war plugin.  Essentially:

project directory layout
/pom.xml
..src/main/java
..src/main/webapp
..src/main/reports


<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.myproject</groupId>
    <artifactId>myartifact</artifactId>
    <version>8.1.1</version>
    <name>my project</name>
    <packaging>pom</packaging>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <webResources>
                        <resource>
                           
<directory>${basedir}/src/main/reports</directory>
                            <targetPath>WEB-INF/reports</targetPath>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
    </build>
    <dependencies>
        .
	.
	.
    </dependencies>
</project>

I can compile and execute the war task to create the war.  It of course is
missing my per server files.  I presume this is correct so far, but please
let me know if I am already blowing it.

Then I have my other projects for each server:

project directory layout
/pom.xml
..src/main/java
..src/main/webapp
..src/main/reports

..server/server1
..server/server1/pom.xml
..server/server1/src/main/webapp

..server/server2
..server/server2/pom.xml
..server/server3/src/main/webapp

..server/server3
..server/server3/pom.xml
..server/server3/src/main/webapp


Each of these poms looks like this(clearly something is wrong):
<project>
    <modelVersion>4.0.0</modelVersion>
    <parent> //??? Am I suppose to be referencing the main project as a
parent?
	    <groupId>com.myproject</groupId>
	    <artifactId>myartifact</artifactId>
	    <version>8.1.1</version>
    </parent>
    <groupId>com.myproject</groupId>
    <artifactId>server1</artifactId>
    <version>8.1.1</version>
    <packaging>war</packaging>

    <dependencies>
    <dependency>  //???Am I suppose to be referencing the main project as a
dependency here?
	    <groupId>com.myproject</groupId>
	    <artifactId>myartifact</artifactId>
	    <version>8.1.1</version>
    </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <overlays>
                        <overlay>
			    <groupId>com.myproject</groupId>
			    <artifactId>myartifact</artifactId>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>



I get some dependency error that I don't understand.  I am unclear as to the
relationship of the two projects.
Does the main project reference the overlay or vice versa?  

Do I need to set a dependency in the overlay to the other project or vice
versa?


Also, what are the steps I am suppose to go through to get this built?  
I am presuming that I install the first project, then package the second
project?  This is a lot more work than when I used the profiles which was a
one command process, am I missing something?

--
View this message in context: http://maven.40175.n5.nabble.com/using-build-profiles-for-WAR-plugin-tp5525954p5529716.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Mime
View raw message