Java Code Examples for org.jboss.shrinkwrap.api.spec.JavaArchive#setManifest()
The following examples show how to use
org.jboss.shrinkwrap.api.spec.JavaArchive#setManifest() .
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: ShrinkWrapFatJarPackageService.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
/** * Generate the manifest for the über jar. */ private static void generateManifest(JavaArchive jar, Map<String, String> entries) throws IOException { Manifest manifest = new Manifest(); Attributes attributes = manifest.getMainAttributes(); attributes.put(Attributes.Name.MANIFEST_VERSION, "1.0"); if (entries != null) { for (Map.Entry<String, String> entry : entries.entrySet()) { attributes.put(new Attributes.Name(entry.getKey()), entry.getValue()); } } ByteArrayOutputStream bout = new ByteArrayOutputStream(); manifest.write(bout); bout.close(); byte[] bytes = bout.toByteArray(); //TODO: merge existing manifest with current one jar.setManifest(new ByteArrayAsset(bytes)); }
Example 2
Source File: ShrinkWrapFatJarPackageService.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
/** * Generate the manifest for the über jar. */ private void generateManifest(JavaArchive jar, Map<String, String> entries) throws IOException, MojoExecutionException { Manifest manifest = new Manifest(); Attributes attributes = manifest.getMainAttributes(); attributes.put(Attributes.Name.MANIFEST_VERSION, "1.0"); if (entries != null) { for (Map.Entry<String, String> entry : entries.entrySet()) { attributes.put(new Attributes.Name(entry.getKey()), entry.getValue()); } } ByteArrayOutputStream bout = new ByteArrayOutputStream(); manifest.write(bout); bout.close(); byte[] bytes = bout.toByteArray(); //TODO: merge existing manifest with current one jar.setManifest(new ByteArrayAsset(bytes)); }
Example 3
Source File: SpringContextDeploymentTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive createdeployment() { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "camel-deployment-tests"); archive.addAsResource("spring/transform6-camel-context.xml", "some-other-name.xml"); archive.setManifest(new Asset() { @Override public InputStream openStream() { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "org.jboss.as.controller-client"); return builder.openStream(); } }); return archive; }
Example 4
Source File: MyBatisIntegrationTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive createdeployment() { JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "camel-mybatis-tests"); archive.addClasses(Account.class); archive.addAsResource("mybatis/SqlMapConfig.xml", "SqlMapConfig.xml"); archive.addAsResource("mybatis/Account.xml"); archive.setManifest(() -> { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "com.h2database.h2"); return builder.openStream(); }); return archive; }
Example 5
Source File: JcrIntegrationTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive createDeployment() { JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "camel-jcr-tests.jar"); archive.addAsResource("jcr/repository-simple-security.xml"); archive.addClasses(FileUtils.class, IOUtils.class); archive.setManifest(() -> { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "org.apache.jackrabbit"); return builder.openStream(); }); return archive; }
Example 6
Source File: ExplicitCamelDependencyTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive jarCamelDeployment() { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "cameldep.jar"); archive.setManifest(new Asset() { @Override public InputStream openStream() { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "org.apache.camel"); return builder.openStream(); } }); return archive; }
Example 7
Source File: JCacheMBeansTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive createdeployment() { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jcache-mbeans-tests"); archive.addAsResource("jcache/jcache-camel-context.xml", "some-other-name.xml"); archive.setManifest(new Asset() { @Override public InputStream openStream() { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "org.jboss.as.controller-client"); return builder.openStream(); } }); return archive; }
Example 8
Source File: LumberjackComponentTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive deployment() { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "camel-lumberjack-tests"); archive.addClasses(AvailablePortFinder.class); archive.addAsResource("lumberjack/window10"); archive.addAsResource("lumberjack/window15"); archive.setManifest(() -> { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "io.netty"); return builder.openStream(); }); return archive; }
Example 9
Source File: TransactedJMSIntegrationTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive createdeployment() { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "camel-jms-tx-tests"); archive.setManifest(new Asset() { @Override public InputStream openStream() { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "org.jboss.as.controller-client"); return builder.openStream(); } }); return archive; }
Example 10
Source File: UndertowHandlerTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive createDeployment() { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "undertow-handler-test"); archive.addClasses(HttpRequest.class); archive.setManifest(new Asset() { @Override public InputStream openStream() { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "org.wildfly.extension.undertow,io.undertow.core"); return builder.openStream(); } }); return archive; }
Example 11
Source File: OptaPlannerIntegrationTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static JavaArchive createDeployment() { JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "camel-optaplanner-tests"); archive.addPackages(true, "org.optaplanner.examples.cloudbalancing"); archive.addPackages(true, "org.optaplanner.examples.common"); archive.setManifest(() -> { ManifestBuilder builder = new ManifestBuilder(); builder.addManifestHeader("Dependencies", "com.google.guava,org.apache.commons.lang3"); return builder.openStream(); }); archive.addAsResource("optaplanner/cloudBalancingScoreRules.drl"); archive.addAsResource("optaplanner/solverConfig.xml"); return archive; }