arquillian-core icon indicating copy to clipboard operation
arquillian-core copied to clipboard

Shortcut to deploy output of build for IT tests

Open arjantijms opened this issue 2 years ago • 3 comments

To deploy the output of a build in an IT test, we typically use code such as:

@Deployment(testable = false)
    public static JavaArchive createDeployment() {
        return create(ZipImporter.class, getProperty("finalName") + ".jar")
                .importFrom(new File("target/" + getProperty("finalName") + ".jar"))
                .as(JavaArchive.class);
    }

Though it's not difficult, it might be nice to have some annotation or annotations for this to declaratively state this.

arjantijms avatar Oct 09 '23 14:10 arjantijms

This is already supported via the deploymentExportPath property of the arquillian.xml engine configuration or by setting the arquillian.deploymentExportPath system property.

See the "Export the Deployment" section of this guide: https://arquillian.org/guides/getting_started_rinse_and_repeat/#export_the_deployment

There are also deploymentExportExploded/arquillian.deploymentExportExploded boolean setting to indicate the exported test artifact should be exploded.

Do you think you need something more?

starksm64 avatar Nov 07 '23 22:11 starksm64

This is already supported via the deploymentExportPath property of the arquillian.xml engine configuration or by setting the arquillian.deploymentExportPath system property.

I think that's something completely else, if I'm not mistaken.

That property makes Arquillian export the archive that was used for deployment to a file, right? What I'm looking for is essentially the reverse. Whatever target Maven created is used for deployment via a simple setting or annotation.

arjantijms avatar Nov 07 '23 23:11 arjantijms

Ah, ok, I misread the code. Maybe an importPath property on @Deployment along with an importer utility class would suffice.

starksm64 avatar Nov 07 '23 23:11 starksm64