2 Replies Latest reply: Nov 17, 2011 11:34 AM by Martin Heinemann RSS

    How to exclude a class from an included package

    Martin Heinemann Newbie

      Hi,

       

      i was wondering if it is possible to remove a java class from a previously added package. I need to replace a class for my tests.

      I use shrinkWrap with Arquillian and my scenario is:

       

       

          @Deployment
          public static WebArchive createBaseTestArchive() {
      
              return ShrinkWrap
                      .create( WebArchive.class, "test.war" )
                      .addPackages( true, "com.foo.bar" )
                                      .resolveAs( GenericArchive.class ) );
           }
      

       

      Is there a way to do something like this?:

       

          @Deployment
          public static WebArchive createBaseTestArchive() {
      
              return ShrinkWrap
                      .create( WebArchive.class, "test.war" )
                      .addPackages( true, "com.foo.bar" )
                      .excludeClass(MyClass.class)                  //   <--           here it is =)
                                      .resolveAs( GenericArchive.class ) );
           }