I had the same issue with schema files. I wanted to find a more elegant solution using zip files or the assembly plugin, but all fell short of what I really wanted. I got the job done with the following, but will be watching this thread for a better solution.

I ...
a) packaged the reusable files into a jar artifact
b) unjar only the files I needed out of the artifact using the Ant unjar task and maven-antrun-plugin.

It worked except referencing the assembly from within the Ant code was not as clean as I'd like.

   //declare dependency

        <!-- get a copy of the ddl -->
    <plugin>
      <artifactId>maven-antrun-plugin</artifactId>
      <executions>
        <execution>
          <phase>generate-sources</phase>
          <configuration>
            <tasks>
              <unjar
                  dest="${basedir}/target/schema"
                  overwrite="true">
                <fileset dir="${user.home}/.m2/repository">
                  <include name="**/schemaBook-${pom.version}*.jar"/>
                </fileset>
                <patternset>
                  <include name="**/*.ddl"/>
                </patternset>
              </unjar>
            </tasks>
          </configuration>
          <goals>
            <goal>run</goal>
          </goals>
        </execution>
      </executions>
    </plugin>

David Blain wrote:

Hi,

I'm having the following problem which I don't know how to handle in Maven:

I have some jar projects which are/can being used by different war projects,
no problem here.

The problem is that is have a jar project (not war), which also has some
related common resources (like eg html/jsp files).  Those resources (that
are related to that jar project) should be injected in the root of the war
project at assembly ("package" goal in Maven).  I figured that I could
package those common resources in a seperate project as a zip, still I don't know if this is possible and how it should be done? Then I also wonder how that zip could be extracted into the root of that war project at assembly?
Maybe I'm working completely wrong in Maven?

To repeat:

1. I have a common jar project which can be used by differnt kinds of war
projects (no surprise here).
2. I have a common resources projects containing html and jsp files
which will be used by different war projects if they use the above mentioned
jar project.

How do I integrate this with Maven?

Kind regards,
David



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

Reply via email to