Mastodon
Coming Up for Air

Exporting Arquillian Archives

A big part of the testing we do on WildFly involves in-container testing, for which we use Arquillian. It’s a great tool when it works right, but sometimes things don’t. When that happens, I find it helpful to examine the archives that the tests produce. Fortunately, Arquillian makes that easy if you know that magic words, and they’re not easy to find, so I’m going to fix that here. :P

There are actually (at least) two ways to it, programmatic (thanks to James Perkins for this tidbit!) or declarative (in arquillian.xml):

Programmatic
1
2
war.as(ZipExporter.class)
    .exportTo(new File("target/deployments", war.getName()), true);
Declarative
1
2
3
<engine>
    <property name="deploymentExportPath">target/deployments</property>
</engine>

Now, when you run your tests, you’ll find something like target/deployments/_DEFAULT___DEFAULT__my-test-archive.war (the name will vary, of course, based on your test’s configuration).

I hope that helps someone. It will definitely help me when I can’t remember how to do this next time. :)

About

My name is Jason Lee. I am a software developer living in the middle of Oklahoma. I’ve been a professional developer since 1997, using a variety of languages, including Java, Javascript, PHP, Python, Delphi, and even a bit of C#. I currently work for Red Hat on the WildFly/EAP team, where, among other things, I maintain integrations for some MicroProfile specs, OpenTelemetry, Micrometer, Jakarta Faces, and Bean Validation. (Full resume here. LinkedIn profile)

I am the president of the Oklahoma City JUG, and an occasional speaker at the JUG and a variety of technical conferences.

On the personal side, I’m active in my church, and enjoy bass guitar, running, fishing, and a variety of martial arts. I’m also married to a beautiful woman, and have two boys, who, thankfully, look like their mother.

My Links

Quotes

Sample quote

Quote source

Publications