XML : Referencing parent Maven project's files from sub Maven project's pom.xml

I have this file structure in my project:

Parent-project
|--pom.xml
|--Sub-Project
|----pom.xml
|----src/
|------main/
|--------java/
|----------packages and classes
|--WebFolder/
|----front/
|------html pages and JS files

From the Sub-Project's pom.xml, I'd like to include WebFolder as a resource. I want to create a JAR-file using the Sub-Project's pom.xml and I want it to include the WebFolder. The Sub-Project has a http-server that needs to host the WebFolder. From Sub-Project, I can easily reference the path as "WebFolder/front" to make it point at the web page I want to display, but it needs to be included in the JAR-file as well. The problem I have is with Maven. From what I've seen, I should be able to create what I want with resources from Sub-Project's pom.xml like so:

  <resources>    <resource>      <directory>???/WebFolder/</directory>    </resource>  </resources>    

The problem is, I don't know how reference something outside the Sub-Project. The directory-tag only seems to reference files inside the Sub-Project. Is there a way to make the directory point at WebFolder?

I'm already using maven-assembly-plugin to include all dependencies in a single JAR-file, but since the WebFolder is not related to Maven per-se, I need to include it with other means.

No comments:

Post a Comment