While this looks like an ideal solution, it doesn't appear to work as I'd
like. 

Since I have 4 web/war projects implementing the same thing, it'd be nice to
put common files (i.e. filters, listeners) in a "common" project and have
that one overlay the other war projects.  Eventually, I'm hoping users will
be able to "double war overlay" and have the appfuse-jsf (and its dependent
appfuse-web-common war) war project overlay theirs.

However, having the web-common war as a dependency for appfuse-jsf doesn't
seem to work.  In my pom.xml, I have:

    <name>AppFuse JSF Module</name>
    <build>
        <defaultGoal>install</defaultGoal>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    ...
        <dependency>
            <groupId>${pom.groupId}</groupId>
            <artifactId>appfuse-web-common</artifactId>
            <version>${pom.version}</version>
            <type>war</type>
        </dependency>

Yet when I compile appfuse-jsf, it doesn't find the classes in
appfuse-web-common's WEB-INF/classes directory.  Seems like a bug to me. 
I'm sure the solution is to create a JAR for web-common and a WAR for
common-web, but I think it's more intuitive for the classloader to recognize
classes from the overlayed WAR.

Another issue I'm seeing is that the dependencies from appfuse-web-common
aren't recognized in appfuse-jsf.  For example, the following dependencies
are in appfuse-web-common, and needed by appfuse-jsf as well.  However,
appfuse-jsf doesn't find them when compiling.

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>

I'm thought this might be an issue with <scope>provided</scope>, but I
changed it to <scope>compile</scope> and the problem still exists.

How hard would it be to change the WAR overlay (or war dependency) to
support class and dependency resolution?  I'm willing to do the work if
someone can point me in the right direction.

Thanks,

Matt

Carlos Sanchez-4 wrote:
> 
> even better ;)
> http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html
> 
> On 7/19/06, Jörg Schaible <[EMAIL PROTECTED]> wrote:
>> Hi Matt,
>>
>> Matt Raible wrote on Wednesday, July 19, 2006 7:56 AM:
>>
>> [snip]
>>
>> > With Maven and separate modules,
>> > it seems like duplication might be a necessary evil.  For example,
>> > there are many common CSS/JavaScript files between the web framework
>> > implementations.  There's no way to copy these into each option's WAR
>> > at build-time is there?  The easiest way to solve this might be
>> > svn:externals AFAIK.
>>
>> Simply build a toolkit.war with your files to share. Let other wars
>> dependend on it and anything will be copied over. See war plugin
>> documentation.
>>
>> - Jörg
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> I could give you my word as a Spaniard.
> No good. I've known too many Spaniards.
>                              -- The Princess Bride
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Converting-AppFuse-to-a-Maven-2-Project-tf1964609.html#a5870757
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to