Skip to content

Instantly share code, notes, and snippets.

@aslakknutsen
Created April 24, 2012 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aslakknutsen/2483202 to your computer and use it in GitHub Desktop.
Save aslakknutsen/2483202 to your computer and use it in GitHub Desktop.
Arquillian JRebel Extension - File mapping
<application>
<classpath>
<dir name="/home/aslak/project/target/classes">
<include name="org/acme/B.class" />
<include name="org/acme/A.class" />
</dir>
<dir name="/home/aslak/other_project/target/classes">
<include name="org/acme/C.class" />
<include name="org/acme/D.class" />
</dir>
<dir name="/tmp/dynamically/created/my.war" /> <!-- location of dynamically created assets, beans.xml -->
<classpath>
<web>
<dir name="/home/aslak/project/src/main/webapp">
<include name="index.html" />
</dir>
</web>
</application>
/
org/
acme/
A.class
B.class
beans.xml
ShrinkWrap.create(WebArchive.class)
.addClasses(A.class, B.class)
.addAsWebInfResource(
Descriptors.create(BeansDescriptor.class).alternative(A.class));
@aslakknutsen
Copy link
Author

ShrinkWrap represents a subset of the full application and can link the added resources back to the original file on disk instead of having to write everything to a tmp folder and reference the dir in rebel.xml. Referencing the full original dir e.g. target/classes will deploy a lot more then just the defined subset.

@aslakknutsen
Copy link
Author

@aslakknutsen
Copy link
Author

In archive:
/WEB-INF/web.xml
/index.html

Resolved to:
/home/project/src/main/webapp/WEB-INF/web.xml
/home/project/src/main/webapp/index.html

Common root: /home/project/src/main/webapp

rebel.xml:

<web directory="common_root">
    <include>index.html</include>
    <include>WEB-INF/web.xml</include>
</web>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment