Skip to content

improved simpler api's #225

Open
Open

Description

@xjusko

I'd like to see API's such as the following, that just put the file in the right place with the right name on the classpath.

Archive.addPersistenceXML("path/to/persistence.xml")
Archive.addBeansXML("path/to/beans.xml"); // create empty instance if null passed, or maybe just have a variant without a parameter

(obviously corresponding API's using File and such are fine)

having this code, seems silly when the underlying logic could figure it out, once it knows what to return.


    public static JavaArchive testJarH2() {
        return testJar()
              .addPackage( "com.lm.repository.sql" )
              .addAsManifestResource(
                    "wildfly/persistence.xml",
                    "persistence.xml"
              );
    }

    public static WebArchive testWarH2() {
        return testWar()
                .addPackage( "com.lm.repository.sql" )
                .addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" )
                .addAsResource(
                        "wildfly/persistence.xml",
                        "META-INF/persistence.xml"
                );
    }

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions