Skip to content

Commit

Permalink
deal better with missing jar extensions and include scope in the json
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed May 10, 2013
1 parent 9595c9a commit 5a4aeb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hawtio-aether/src/main/java/io/hawt/aether/AetherFacade.java
@@ -1,6 +1,7 @@
package io.hawt.aether;

import io.hawt.util.MBeanSupport;
import io.hawt.util.Strings;
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.PlexusContainerException;
Expand Down Expand Up @@ -76,7 +77,7 @@ public AetherResult resolve(String mavenCoords) throws PlexusContainerException,
}

public AetherResult resolve(String groupId, String artifactId, String version, String extension, String classifier) throws PlexusContainerException, ComponentLookupException, DependencyCollectionException, ArtifactResolutionException, DependencyResolutionException {
if (extension == null || extension.equals("bundle")) {
if (Strings.isBlank(extension) || extension.equals("bundle")) {
extension = DEFAULT_EXTENSION;
}
if (classifier == null) {
Expand Down
4 changes: 4 additions & 0 deletions hawtio-aether/src/main/java/io/hawt/aether/AetherResult.java
Expand Up @@ -87,6 +87,10 @@ protected void toJson(DependencyNode node, String indent, StringBuilder sb, bool
if (Strings.isNotBlank(extension) && !extension.equals("jar")) {
appendJsonProperty(sb, childIndent, "extension", extension, false);
}
String scope = dependency.getScope();
if (Strings.isNotBlank(scope)) {
appendJsonProperty(sb, childIndent, "scope", scope, false);
}
List<DependencyNode> children = node.getChildren();
if (!children.isEmpty()) {
sb.append(childIndent);
Expand Down

0 comments on commit 5a4aeb5

Please sign in to comment.