public static EnterpriseArchive createEARDeployment ( ) { final EnterpriseArchive ear = ShrinkWrap . create ( EnterpriseArchive . class , "scribble-test.ear" ) ; // use local maven repository mirror only final PomEquippedResolveStage pom = Maven . configureResolver ( ) . workOffline ( ) . loadPomFromFile ( "pom.xml" ) ; final File [ ] files = pom . importDependencies ( ScopeType . COMPILE ) . resolve ( ) . withTransitivity ( ) . asFile ( ) ; for ( final File f : files ) { if ( f . getName ( ) . endsWith ( ".jar" ) ) { LOG . debug ( "Adding lib {}" , f ) ; ear . addAsLibrary ( f ) ; } } return ear ; }
Creates an enterprise archive for the module in whose working directory the method is invoked including all compile - scoped jar archives .