Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-484

improved simpler api's

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None

    Description

      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"
                      );
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            xenoterracide_jira Caleb Cushing (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: