org.jboss.shrinkwrap.resolver.api.maven.strategy.AcceptScopesStrategy Java Examples
The following examples show how to use
org.jboss.shrinkwrap.resolver.api.maven.strategy.AcceptScopesStrategy.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EarWebAppFirstClassLoaderTest.java From tomee with Apache License 2.0 | 6 votes |
@Deployment(testable = false) public static Archive<?> ear() { final File[] joda = Maven.configureResolver() .workOffline() .withClassPathResolution(true) .resolve("joda-time:joda-time:2.5") .using(new AcceptScopesStrategy(ScopeType.COMPILE, ScopeType.RUNTIME)) .asFile(); return ShrinkWrap.create(EnterpriseArchive.class, "broken.ear") .addAsLibraries(joda) .addAsModule(ShrinkWrap.create(WebArchive.class, "broken-web.war") .addClasses(LoadJodaFromTheWebAppResource.class) .addAsManifestResource(new StringAsset( "<Context>" + "<Loader className=\"" + TomEEWebappLoader.class.getName() + "\" loaderClass=\"" + WebAppFirstEarClassLoader.class.getName() + "\" />" + "</Context>"), "context.xml") .addAsLibraries(joda)); }
Example #2
Source File: EarClassLoaderTest.java From tomee with Apache License 2.0 | 6 votes |
@Deployment(testable = false) public static Archive<?> ear() { return ShrinkWrap.create(EnterpriseArchive.class, "broken.ear") .addAsModule( ShrinkWrap.create(WebArchive.class, "broken-web.war") .addClasses(LoadJodaFromTheWebAppResource.class) .addAsLibraries( Maven.configureResolver() .workOffline() .withClassPathResolution(true) .resolve("joda-time:joda-time:2.5") .using(new AcceptScopesStrategy(ScopeType.COMPILE, ScopeType.RUNTIME)) .asFile() ) ); }