Skip to content

Commit

Permalink
Merge pull request jbossas#95 from jamezp/JBASMP-80
Browse files Browse the repository at this point in the history
[JBASMP-80] Use a real value for the isIgnored() on the PackageType.
  • Loading branch information
jamezp committed Jun 1, 2016
2 parents 2d6468a + 60dd1ef commit e8be1e4
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/main/java/org/jboss/as/plugin/deployment/PackageType.java
@@ -1,6 +1,7 @@
package org.jboss.as.plugin.deployment;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import org.apache.maven.project.MavenProject;
Expand All @@ -12,8 +13,8 @@
*/
final class PackageType implements Comparable<PackageType> {

private static final PackageType MAVEN_PLUGIN = new PackageType("maven-project");
private static final PackageType POM = new PackageType("pom");
private static final PackageType MAVEN_PLUGIN = new PackageType("maven-project", true);
private static final PackageType POM = new PackageType("pom", true);
private static final PackageType EJB = new PackageType("ejb", "jar");
private static final Map<String, PackageType> DEFAULT_TYPES;

Expand All @@ -26,15 +27,24 @@ final class PackageType implements Comparable<PackageType> {

private final String packaging;
private final String fileExtension;
private final boolean ignored;

private PackageType(final String packaging) {
this.packaging = packaging;
this.fileExtension = packaging;
this(packaging, packaging, false);
}

private PackageType(final String packaging, final boolean ignored) {
this(packaging, packaging, ignored);
}

private PackageType(final String packaging, final String fileExtension) {
this(packaging, fileExtension, false);
}

private PackageType(final String packaging, final String fileExtension, final boolean ignored) {
this.packaging = packaging;
this.fileExtension = fileExtension;
this.ignored = ignored;
}

/**
Expand All @@ -45,7 +55,7 @@ private PackageType(final String packaging, final String fileExtension) {
* @return the package type
*/
public static PackageType resolve(final MavenProject project) {
final String packaging = project.getPackaging();
final String packaging = project.getPackaging().toLowerCase(Locale.ROOT);
if (DEFAULT_TYPES.containsKey(packaging)) {
return DEFAULT_TYPES.get(packaging);
}
Expand All @@ -58,7 +68,7 @@ public static PackageType resolve(final MavenProject project) {
* @return {@code true} if the package type should be ignored, otherwise {@code false}.
*/
public boolean isIgnored() {
return false;
return ignored;
}

/**
Expand Down

0 comments on commit e8be1e4

Please sign in to comment.