Skip to content

Commit

Permalink
AS7-5547 ignore empty Dependencies: entry in a manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Mar 22, 2013
1 parent 0d911ed commit fbfdb70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -25,7 +25,6 @@
import java.util.List;
import java.util.jar.Manifest;

import org.jboss.as.server.ServerMessages;
import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentPhaseContext;
import org.jboss.as.server.deployment.DeploymentUnit;
Expand Down Expand Up @@ -84,10 +83,11 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU

final String[] dependencyDefs = dependencyString.split(",");
for (final String dependencyDef : dependencyDefs) {
final String[] dependencyParts = dependencyDef.trim().split(" ");
if (dependencyParts.length == 0) {
throw ServerMessages.MESSAGES.invalidDependency(dependencyString);
final String trimmed = dependencyDef.trim();
if(trimmed.isEmpty()) {
continue;
}
final String[] dependencyParts = trimmed.split(" ");

final ModuleIdentifier dependencyId = ModuleIdentifier.fromString(dependencyParts[0]);
final boolean export = containsParam(dependencyParts, EXPORT_PARAM);
Expand Down
Expand Up @@ -23,6 +23,7 @@

import javax.ejb.Stateless;

import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.junit.Assert;

import org.jboss.arquillian.container.test.api.Deployment;
Expand All @@ -47,6 +48,7 @@ public static Archive<?> deploy() {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
ear.addAsModule(war);
JavaArchive earLib = ShrinkWrap.create(JavaArchive.class, "cp.jar");
earLib.addAsManifestResource(new StringAsset("Dependencies: \n"), "MANIFEST.MF"); //AS7-5547, make sure an empty dependencies entry is fine
earLib.addClasses(TestBB.class, WebInfLibClass.class);
ear.addAsLibrary(earLib);
return ear;
Expand Down

0 comments on commit fbfdb70

Please sign in to comment.