puniverse / capsule-maven

Runtime dependency-resolution caplet

Home Page:http://capsule.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

transitive exclusions in POM not reflected in runtime classpath

supercargo opened this issue · comments

In a multi-module project (I'm not sure if this detail is pertinent) where module A's POM is supplied to capsule as the root POM for dependency resolution and module A depends on module B and module B depends on library 1, and library 1 depends on library 2; listing an exclusion on library 2 when depending on library 1 from module B, library 2 is still included on the classpath even though the only "route" to that dependency is through library 1. This behavior is counter to the documented behavior for POM exclusions here: https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

To clarify, here are some pseudo POMs showing these relationships:

<project>
  <artifactId>module-a</artifactId>
  <packaging>jar</packaging>
  ...
  <dependencies>
    <dependency>
      <artifactId>module-b</artifactId>
    </dependency>
  </dependencies>
</project>
<project>
  <artifactId>module-b</artifactId>
  <packaging>jar</packaging>
  ...
  <dependencies>
    <dependency>
      <artifactId>library-1</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>library-2</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
</project>
<project>
  <artifactId>library-1</artifactId>
  <packaging>jar</packaging>
  ...
  <dependencies>
    <dependency>
      <artifactId>library-2</artifactId>
    </dependency>
  </dependencies>
</project>

Some background discussion around this issue is available here: https://groups.google.com/forum/#!topic/capsule-user/v1XGet8cYrs

Can you try it with the (updated) snapshot version (note that this time you must use 1.0.4-SNAPSHOT for capsule-maven, too, not just for capsule), and run introspection again? I've made a change that may not resolve the issue, but may help pinpoint where it is. As it was, the instrospection in the version you tried would not have shown exclusions even if they had been correctly parsed.

The introspection works now for my hand-rolled manifest.

If I try to actually launch the application through capsule, it now has a string of failures that look like trying to download the first level of dependencies with null versions.

MANIFEST.MF:

Manifest-Version: 1.0
Application: com.acuitysds.services:services-dist
Application-Name: services-dist-0.13.0.3-SNAPSHOT-capsule
Embedded-Artifacts: com.acuitysds.services:services-dist:0.13.0.3-SNAP
 SHOT 
Caplets: MavenCapsule
Allow-Snapshots: true
Premain-Class: Capsule
Application-Class: com.acuitysds.services.AcuityServices
Repositories: acuity-public(http://ci.dev.acuitysds.com:8081/nexus/con
 tent/groups/public) acuity-private(http://ci.dev.acuitysds.com:8081/n
 exus/content/groups/acuity)
Build-Info: includeApp resolveCompileDep resolveRuntimeDep resolveTran
 sitiveDep
Main-Class: Capsule

Output of java -Dcapsule.reset=true -Dcapsule.introspect -jar services/services-dist/target/services-dist-0.13.0.3-SNAPSHOT-capsule.jar:

  Application-Name (The application's name): 
	services-dist-0.13.0.3-SNAPSHOT-capsule
  Application-Id (The application's name): 
	com.acuitysds.services.services-dist
  Application-Version (The application's version string): 
	0.13.0.3-SNAPSHOT
  Caplets (A list of names of caplet classes -- if embedded in the capsule -- or Maven coordinates of caplet artifacts that will be applied to the capsule in the order they are listed): 
	[MavenCapsule]
  Capsule-Log-Level (The capsule's default log level): 
	null (default)
  Description (Contains the description of its respective mode): 
	null (default)
  Application-Class (The main application class): 
	com.acuitysds.services.AcuityServices
  Application (The Maven coordinates of the application's main JAR or the path of the main JAR within the capsule): 
	com.acuitysds.services:services-dist
  Application-Script (A startup script to be run *instead* of `Application-Class`, given as a path relative to the capsule's root): 
	null (default)
  Min-Java-Version (The lowest Java version required to run the application): 
	null (default)
  Java-Version (The highest version of the Java installation required to run the application): 
	null (default)
  Min-Update-Version (A space-separated key-value ('=' separated) list mapping Java versions to the minimum update version required): 
	{} (default)
  JDK-Required (Whether or not a JDK is required to launch the application): 
	false (default)
  Capsule-Agent (Whether this capsule should inject itself as an agent into the application.): 
	false (default)
  Args (A list of command line arguments to be passed to the application; the UNIX shell-style special variables (`$*`, `$1`, `$2`, ...) can refer to the actual arguments passed on the capsule's command line; if no special var is used, the listed values will be prepended to the supplied arguments (i.e., as if `$*` had been listed last).): 
	[] (default)
  Environment-Variables (A list of environment variables that will be put in the applications environment; formatted "var=value" or "var"): 
	{} (default)
  JVM-Args (A list of JVM arguments that will be used to launch the application's Java process): 
	[] (default)
  System-Properties (A list of system properties that will be defined in the applications JVM; formatted "prop=value" or "prop"): 
	{} (default)
  App-Class-Path (A list of JARs, relative to the capsule root, that will be put on the application's classpath, in the order they are listed): 
	[] (default)
  Capsule-In-Class-Path (Whether or not the capsule JAR itself is on the application's classpath): 
	true (default)
  Boot-Class-Path (A list of JARs, dependencies, and/or directories, relative to the capsule root, that will be used as the application's boot classpath): 
	[] (default)
  Boot-Class-Path-A (A list of JARs dependencies, and/or directories, relative to the capsule root, that will be appended to the applications default boot classpath): 
	[] (default)
  Boot-Class-Path-P (A list of JARs dependencies, and/or directories, relative to the capsule root, that will be prepended to the applications default boot classpath): 
	[] (default)
  Library-Path-A (A list of JARs and/or directories, relative to the capsule root, to be appended to the default native library path): 
	[] (default)
  Library-Path-P (a list of JARs and/or directories, relative to the capsule root, to be prepended to the default native library path): 
	[] (default)
  Security-Manager (The name of a class that will serve as the application's security-manager): 
	null (default)
  Security-Policy (A security policy file, relative to the capsule root, that will be used as the security policy): 
	null (default)
  Security-Policy-A (A security policy file, relative to the capsule root, that will be appended to the default security policy): 
	null (default)
  Java-Agents (A list of Java agents used by the application; formatted "agent" or "agent=arg1,arg2...", where agent is either the path to a JAR relative to the capsule root, or a Maven coordinate of a dependency): 
	{} (default)
  Native-Agents (A list of native JVMTI agents used by the application; formatted "agent" or "agent=arg1,arg2...", where agent is either the path to a native library, without the platform-specific suffix, relative to the capsule root. The native library file(s) can be embedded in the capsule or listed as Maven native dependencies using the Native-Dependencies-... attributes.): 
	{} (default)
  Dependencies (A list of Maven dependencies given as groupId:artifactId:version[(excludeGroupId:excludeArtifactId,...)]): 
	[com.acuitysds.services:services-auth:jar:null (runtime), com.acuitysds.services:services-session:jar:null (runtime), com.acuitysds.services:services-ops:jar:null (runtime), com.acuitysds.services:services-admin:jar:null (runtime), com.acuitysds.services:services-admin-ui:jar:null (runtime), commons-codec:commons-codec:jar:null (runtime), com.jamierf.dropwizard:dropwizard-logging-loggly:jar:0.7 (runtime), io.dropwizard:dropwizard-logging:jar:null (runtime)]
  Native-Dependencies (A list of Maven dependencies consisting of native library artifacts; each item can be a comma separated pair, with the second component being a new name to give the download artifact): 
	{} (default)
  Repositories (A list of Maven repositories, each formatted as URL or NAME(URL)): 
	[acuity-public(http://ci.dev.acuitysds.com:8081/nexus/content/groups/public), acuity-private(http://ci.dev.acuitysds.com:8081/nexus/content/groups/acuity)]
  Allow-Snapshots (Whether or not SNAPSHOT dependencies are allowed): 
	true

Are those dependencies listed under Dependencies in the introspection the ones listed in the pom.xml embedded in the capsule's root?

If so, are you absolutely certain you're using the latest capsule-maven (1.0.4-SNAPSHOT)? Note, it's not enough to pick the latest capsule version; you must also you the latest capsule-maven.

Alright, I think I have solved the bug; it had nothing to do with my previous modifications, nor with the dependencies being listed in a POM rather than the manifest. Aether never ceases to amaze me with how much boilerplate it requires.

Anyway, can you try again with the new capsule-maven (1.0.4-SNAPSHOT)? Make sure you're using the right version, and let me see what the introspection prints out, if only to verify you're using the correct version.

Okay, I think I may have had a stale snapshot in there somewhere (I was building from HEAD for capsule and capsule-maven; now I'm pulling directly from sonatype snapshot repo). Specifically:
capsule-1.0.4-20161221.145628-7.jar and capsule-maven-1.0.4-20161221.194732-7.jar

To answer your other question: yes, the listed dependencies are the same as the pom.xml in the capsule jar root.

Here is the output of the introspection

Capsule version: 1.0.4
  Application-Name (The application's name): 
	services-dist-0.13.0.3-SNAPSHOT-capsule
  Application-Id (The application's name): 
	com.acuitysds.services.services-dist
  Application-Version (The application's version string): 
	0.13.0.3-SNAPSHOT
  Caplets (A list of names of caplet classes -- if embedded in the capsule -- or Maven coordinates of caplet artifacts that will be applied to the capsule in the order they are listed): 
	[MavenCapsule]
  Capsule-Log-Level (The capsule's default log level): 
	null (default)
  Description (Contains the description of its respective mode): 
	null (default)
  Application-Class (The main application class): 
	com.acuitysds.services.AcuityServices
  Application (The Maven coordinates of the application's main JAR or the path of the main JAR within the capsule): 
	com.acuitysds.services:services-dist:0.13.0.3-SNAPSHOT
  Application-Script (A startup script to be run *instead* of `Application-Class`, given as a path relative to the capsule's root): 
	null (default)
  Min-Java-Version (The lowest Java version required to run the application): 
	null (default)
  Java-Version (The highest version of the Java installation required to run the application): 
	null (default)
  Min-Update-Version (A space-separated key-value ('=' separated) list mapping Java versions to the minimum update version required): 
	{} (default)
  JDK-Required (Whether or not a JDK is required to launch the application): 
	false (default)
  Capsule-Agent (Whether this capsule should inject itself as an agent into the application.): 
	false (default)
  Args (A list of command line arguments to be passed to the application; the UNIX shell-style special variables (`$*`, `$1`, `$2`, ...) can refer to the actual arguments passed on the capsule's command line; if no special var is used, the listed values will be prepended to the supplied arguments (i.e., as if `$*` had been listed last).): 
	[] (default)
  Environment-Variables (A list of environment variables that will be put in the applications environment; formatted "var=value" or "var"): 
	{} (default)
  JVM-Args (A list of JVM arguments that will be used to launch the application's Java process): 
	[] (default)
  System-Properties (A list of system properties that will be defined in the applications JVM; formatted "prop=value" or "prop"): 
	{} (default)
  App-Class-Path (A list of JARs, relative to the capsule root, that will be put on the application's classpath, in the order they are listed): 
	[] (default)
  Capsule-In-Class-Path (Whether or not the capsule JAR itself is on the application's classpath): 
	true (default)
  Boot-Class-Path (A list of JARs, dependencies, and/or directories, relative to the capsule root, that will be used as the application's boot classpath): 
	[] (default)
  Boot-Class-Path-A (A list of JARs dependencies, and/or directories, relative to the capsule root, that will be appended to the applications default boot classpath): 
	[] (default)
  Boot-Class-Path-P (A list of JARs dependencies, and/or directories, relative to the capsule root, that will be prepended to the applications default boot classpath): 
	[] (default)
  Library-Path-A (A list of JARs and/or directories, relative to the capsule root, to be appended to the default native library path): 
	[] (default)
  Library-Path-P (a list of JARs and/or directories, relative to the capsule root, to be prepended to the default native library path): 
	[] (default)
  Security-Manager (The name of a class that will serve as the application's security-manager): 
	null (default)
  Security-Policy (A security policy file, relative to the capsule root, that will be used as the security policy): 
	null (default)
  Security-Policy-A (A security policy file, relative to the capsule root, that will be appended to the default security policy): 
	null (default)
  Java-Agents (A list of Java agents used by the application; formatted "agent" or "agent=arg1,arg2...", where agent is either the path to a JAR relative to the capsule root, or a Maven coordinate of a dependency): 
	{} (default)
  Native-Agents (A list of native JVMTI agents used by the application; formatted "agent" or "agent=arg1,arg2...", where agent is either the path to a native library, without the platform-specific suffix, relative to the capsule root. The native library file(s) can be embedded in the capsule or listed as Maven native dependencies using the Native-Dependencies-... attributes.): 
	{} (default)
  Dependencies (A list of Maven dependencies given as groupId:artifactId:version[(excludeGroupId:excludeArtifactId,...)]): 
	[com.acuitysds.services:services-auth:null, com.acuitysds.services:services-session:null, com.acuitysds.services:services-ops:null, com.acuitysds.services:services-admin:null, com.acuitysds.services:services-admin-ui:null, commons-codec:commons-codec:null, com.jamierf.dropwizard:dropwizard-logging-loggly:0.7, io.dropwizard:dropwizard-logging:null]
  Native-Dependencies (A list of Maven dependencies consisting of native library artifacts; each item can be a comma separated pair, with the second component being a new name to give the download artifact): 
	{} (default)
  Repositories (A list of Maven repositories, each formatted as URL or NAME(URL)): 
	[acuity-public(http://ci.dev.acuitysds.com:8081/nexus/content/groups/public), acuity-private(http://ci.dev.acuitysds.com:8081/nexus/content/groups/acuity)]
  Allow-Snapshots (Whether or not SNAPSHOT dependencies are allowed): 
	true

OK, this problem does seem related to the POM. How are the dependencies' versions specified in the POM? (I'm asking because I can't reproduce this).

They are managed (i.e. <dependencyManagement>) in the parent's parent.

Oh! That's not currently supported, and I don't even know whether adding support for parent POMs would be easy or hard. Where is the parent located?

Ohhhh, good to know! The parents are in the source tree, but by the time capsule runs they are also deployed to our private repository so should be resolvable like any other artifact. But even if I weren't using this structure, I know many dependencies in central do, so isn't parent pom support kind of essential?

The problem is merely with using an embedded POM to specify the capsule's direct dependencies. The dependencies themselves may use whatever mechanism.

Okay, so if I drop the embedded pom part and go back to using capsule-maven-plugin to generate my MANIFEST.MF what should I expect? It is still unclear to me if it is capsule-maven-plugin's job to parenthetically list the exclusions in the Dependencies: section it generates (since it isn't doing this) or if capsule-maven it supposed to figure this out from the transitive POMs once it downloads them.

Exclusions in transitive dependencies were indeed ignored -- that was a bug what has now hopefully been fixed.

Using generated dependencies list now from the maven plugin. The behavior has changed compared to the last time I tried this setup, but not for the better! I'm getting a bunch of exceptions resolving various dependencies. Some are "not found" some are "forbidden" and others are errors in parsing retrieved poms(!). Since I'm proxying through a private repo, there could be some issue there (although nothing which is affecting my normal maven builds). I will look into other potential error sources, but in the meantime, here is some verbosity around one of the failures (403 forbidden root cause in this case):

CAPSULE EXCEPTION: Error resolving dependencies. while processing attribute Allow-Snapshots: true
java.lang.RuntimeException: Error resolving dependencies.
	at capsule.DependencyManager.resolve0(DependencyManager.java:426)
	at capsule.DependencyManager.resolveDependencies(DependencyManager.java:378)
	at MavenCapsule.resolve0(MavenCapsule.java:241)
	at Capsule.resolve(Capsule.java:3441)
	at Capsule.resolve(Capsule.java:3455)
	at Capsule.buildJavaProcess(Capsule.java:2270)
	at Capsule.buildProcess0(Capsule.java:1572)
	at Capsule.buildProcess(Capsule.java:1563)
	at Capsule.buildProcess(Capsule.java:1563)
	at Capsule.buildProcess(Capsule.java:1563)
	at Capsule.prelaunch0(Capsule.java:1536)
	at Capsule.prelaunch(Capsule.java:1529)
	at Capsule.prelaunch(Capsule.java:1529)
	at Capsule.prelaunch(Capsule.java:1529)
	at Capsule.prepareForLaunch(Capsule.java:1381)
	at Capsule.launch(Capsule.java:1310)
	at Capsule.main0(Capsule.java:407)
	at Capsule.main(Capsule.java:380)
Caused by: capsule.org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at com.acuitysds.services:services-common:jar:0.13.0.3-SNAPSHOT -> com.acuitysds:common-aws:jar:0.13.0.3-SNAPSHOT -> com.amazonaws:aws-java-sdk-swf-libraries:jar:1.10.75 -> org.springframework:spring-test:jar:3.0.7.RELEASE -> org.springframework:spring-webmvc-portlet:jar:3.0.7.RELEASE -> org.springframework:spring-webmvc:jar:3.0.7.RELEASE -> jasperreports:jasperreports:jar:2.0.5 -> commons-collections:commons-collections:jar:3.2.1.redhat-7
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:387)
	at capsule.DependencyManager.resolve0(DependencyManager.java:421)
	... 17 more
Caused by: capsule.org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at com.acuitysds.services:services-common:jar:0.13.0.3-SNAPSHOT -> com.acuitysds:common-aws:jar:0.13.0.3-SNAPSHOT -> com.amazonaws:aws-java-sdk-swf-libraries:jar:1.10.75 -> org.springframework:spring-test:jar:3.0.7.RELEASE -> org.springframework:spring-webmvc-portlet:jar:3.0.7.RELEASE -> org.springframework:spring-webmvc:jar:3.0.7.RELEASE -> jasperreports:jasperreports:jar:2.0.5 -> commons-collections:commons-collections:jar:3.2.1.redhat-7
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:291)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:341)
	... 18 more
Caused by: capsule.org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for commons-collections:commons-collections:jar:3.2.1.redhat-7
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:329)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
	... 19 more
Caused by: capsule.org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact org.apache.commons:commons-parent:pom:22-redhat-2 from/to jaspersoft (http://www.jasperforge.org/maven2): Forbidden (403)
	at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:177)
	at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:226)
	at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1000)
	at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:800)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:329)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
	... 54 more
Caused by: capsule.org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.commons:commons-parent:pom:22-redhat-2 from/to jaspersoft (http://www.jasperforge.org/maven2): Forbidden (403)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
	at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:173)
	... 59 more
Caused by: capsule.org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.commons:commons-parent:pom:22-redhat-2 from/to jaspersoft (http://www.jasperforge.org/maven2): Forbidden (403)
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
	at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
	... 62 more
Caused by: capsule.org.apache.http.client.HttpResponseException: Forbidden (403)
	at org.eclipse.aether.transport.http.HttpTransporter.handleStatus(HttpTransporter.java:519)
	at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:322)
	at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:274)
	at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:59)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
	... 67 more

and here is the introspection result:

Capsule version: 1.0.4
  Application-Name (The application's name): 
	services-dist-0.13.0.3-SNAPSHOT-capsule
  Application-Id (The application's name): 
	null (default)
  Application-Version (The application's version string): 
	null (default)
  Caplets (A list of names of caplet classes -- if embedded in the capsule -- or Maven coordinates of caplet artifacts that will be applied to the capsule in the order they are listed): 
	[MavenCapsule]
  Capsule-Log-Level (The capsule's default log level): 
	null (default)
  Description (Contains the description of its respective mode): 
	null (default)
  Application-Class (The main application class): 
	com.acuitysds.services.AcuityServices
  Application (The Maven coordinates of the application's main JAR or the path of the main JAR within the capsule): 
	null (default)
  Application-Script (A startup script to be run *instead* of `Application-Class`, given as a path relative to the capsule's root): 
	null (default)
  Min-Java-Version (The lowest Java version required to run the application): 
	null (default)
  Java-Version (The highest version of the Java installation required to run the application): 
	null (default)
  Min-Update-Version (A space-separated key-value ('=' separated) list mapping Java versions to the minimum update version required): 
	{} (default)
  JDK-Required (Whether or not a JDK is required to launch the application): 
	false (default)
  Capsule-Agent (Whether this capsule should inject itself as an agent into the application.): 
	false (default)
  Args (A list of command line arguments to be passed to the application; the UNIX shell-style special variables (`$*`, `$1`, `$2`, ...) can refer to the actual arguments passed on the capsule's command line; if no special var is used, the listed values will be prepended to the supplied arguments (i.e., as if `$*` had been listed last).): 
	[] (default)
  Environment-Variables (A list of environment variables that will be put in the applications environment; formatted "var=value" or "var"): 
	{} (default)
  JVM-Args (A list of JVM arguments that will be used to launch the application's Java process): 
	[] (default)
  System-Properties (A list of system properties that will be defined in the applications JVM; formatted "prop=value" or "prop"): 
	{} (default)
  App-Class-Path (A list of JARs, relative to the capsule root, that will be put on the application's classpath, in the order they are listed): 
	[] (default)
  Capsule-In-Class-Path (Whether or not the capsule JAR itself is on the application's classpath): 
	true (default)
  Boot-Class-Path (A list of JARs, dependencies, and/or directories, relative to the capsule root, that will be used as the application's boot classpath): 
	[] (default)
  Boot-Class-Path-A (A list of JARs dependencies, and/or directories, relative to the capsule root, that will be appended to the applications default boot classpath): 
	[] (default)
  Boot-Class-Path-P (A list of JARs dependencies, and/or directories, relative to the capsule root, that will be prepended to the applications default boot classpath): 
	[] (default)
  Library-Path-A (A list of JARs and/or directories, relative to the capsule root, to be appended to the default native library path): 
	[] (default)
  Library-Path-P (a list of JARs and/or directories, relative to the capsule root, to be prepended to the default native library path): 
	[] (default)
  Security-Manager (The name of a class that will serve as the application's security-manager): 
	null (default)
  Security-Policy (A security policy file, relative to the capsule root, that will be used as the security policy): 
	null (default)
  Security-Policy-A (A security policy file, relative to the capsule root, that will be appended to the default security policy): 
	null (default)
  Java-Agents (A list of Java agents used by the application; formatted "agent" or "agent=arg1,arg2...", where agent is either the path to a JAR relative to the capsule root, or a Maven coordinate of a dependency): 
	{} (default)
  Native-Agents (A list of native JVMTI agents used by the application; formatted "agent" or "agent=arg1,arg2...", where agent is either the path to a native library, without the platform-specific suffix, relative to the capsule root. The native library file(s) can be embedded in the capsule or listed as Maven native dependencies using the Native-Dependencies-... attributes.): 
	{} (default)
  Dependencies (A list of Maven dependencies given as groupId:artifactId:version[(excludeGroupId:excludeArtifactId,...)]): 
	[com.acuitysds.services:services-auth:0.13.0.3-SNAPSHOT, com.acuitysds.services:services-common:0.13.0.3-SNAPSHOT, io.dropwizard:dropwizard-client:0.9.1, io.dropwizard.metrics:metrics-httpclient:3.1.2, org.glassfish.jersey.connectors:jersey-apache-connector:2.22.1, io.dropwizard:dropwizard-auth:0.9.1, com.hubspot.dropwizard:dropwizard-guice:0.8.3.0, com.squarespace.jersey2-guice:jersey2-guice:0.10, javax.servlet:javax.servlet-api:3.1.0, javax.inject:javax.inject:1, com.theoryinpractise:halbuilder-standard:4.0.1, com.theoryinpractise:halbuilder-api:4.0.1, com.theoryinpractise:halbuilder-core:4.0.6, com.theoryinpractise:halbuilder-json:4.0.6, com.theoryinpractise:halbuilder-xml:4.0.1, org.jdom:jdom:2.0.2, com.google.inject:guice:4.0, aopalliance:aopalliance:1.0, com.google.inject.extensions:guice-servlet:4.0, com.google.code.findbugs:annotations:3.0.0, com.acuitysds:common-sfdc:0.13.0.3-SNAPSHOT, com.force.api:force-wsc:35.2.6, org.antlr:ST4:4.0.7, org.antlr:antlr-runtime:3.5, org.antlr:stringtemplate:3.2.1, antlr:antlr:2.7.7, org.codehaus.jackson:jackson-core-asl:1.9.13, org.codehaus.jackson:jackson-mapper-asl:1.9.13, commons-beanutils:commons-beanutils:1.9.3, commons-collections:commons-collections:3.2.2, com.google.guava:guava:20.0, org.apache.httpcomponents:httpcore:4.4.3, org.apache.httpcomponents:httpclient:4.5.1, com.acuitysds:common-guice:0.13.0.3-SNAPSHOT, com.google.inject.extensions:guice-multibindings:4.0, javax.ws.rs:javax.ws.rs-api:2.0.1, com.acuitysds:common-datomic:0.13.0.3-SNAPSHOT, com.datomic:datomic-pro:0.9.5544, org.clojure:clojure:1.8.0, org.clojure:tools.cli:0.3.5, org.fressian:fressian:0.6.5, org.apache.activemq:artemis-core-client:1.4.0, org.apache.activemq:artemis-commons:1.4.0, io.netty:netty-all:4.0.39.Final, org.apache.geronimo.specs:geronimo-json_1.0_spec:1.0-alpha-1, org.apache.johnzon:johnzon-core:0.9.4, com.h2database:h2:1.3.171, com.datomic:datomic-lucene-core:3.3.0, net.spy:spymemcached:2.11.4, org.apache.tomcat:tomcat-jdbc:7.0.27, org.apache.tomcat:tomcat-juli:7.0.27, org.codehaus.janino:commons-compiler-jdk:2.6.1, org.codehaus.janino:commons-compiler:2.6.1, com.amazonaws:aws-java-sdk-dynamodb:1.10.75, com.amazonaws:aws-java-sdk-core:1.10.75, commons-logging:commons-logging:1.1.3, com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.5.3, joda-time:joda-time:2.9.2, us.bpsm:edn-java:0.4.6, org.jetbrains:annotations-java5:15.0, com.acuitysds.model:data-model-common:0.13.0.3-SNAPSHOT, io.dropwizard:dropwizard-assets:0.9.1, io.dropwizard:dropwizard-servlets:0.9.1, io.dropwizard.metrics:metrics-annotation:3.1.2, com.auth0:java-jwt:2.0.1, com.acuitysds.services:services-session:0.13.0.3-SNAPSHOT, com.tdunning:t-digest:2.0.2, org.apache.commons:commons-math3:3.3, com.acuitysds.di:data-integration-core:0.13.0.3-SNAPSHOT, com.acuitysds.model:data-model-message:0.13.0.3-SNAPSHOT, com.acuitysds.di:data-integration-sfdc:0.13.0.3-SNAPSHOT, com.acuitysds.model:data-model-sales:0.13.0.3-SNAPSHOT, com.acuitysds.ae:ae-core:0.13.0.3-SNAPSHOT, com.google.code.findbugs:jsr305:1.3.9, com.acuitysds.model:data-model-ml:0.13.0.3-SNAPSHOT, com.atlassian.rserve:rserve-client:0.0.1-RC1, org.parboiled:parboiled-java:1.1.4, org.parboiled:parboiled-core:1.1.4, org.ow2.asm:asm:4.1, org.ow2.asm:asm-tree:4.1, org.ow2.asm:asm-analysis:4.1, org.ow2.asm:asm-util:4.1, org.reflections:reflections:0.9.9, org.javassist:javassist:3.18.2-GA, redis.clients:jedis:2.1.0, commons-pool:commons-pool:1.5.5, org.apache.poi:poi:3.12, org.apache.poi:poi-ooxml:3.12, org.apache.poi:poi-ooxml-schemas:3.12, org.apache.xmlbeans:xmlbeans:2.6.0, stax:stax-api:1.0.1, com.acuitysds.services:services-ops:0.13.0.3-SNAPSHOT, com.acuitysds:common-aws:0.13.0.3-SNAPSHOT, com.amazonaws:aws-java-sdk-s3:1.10.75, com.amazonaws:aws-java-sdk-kms:1.10.75, com.amazonaws:aws-java-sdk-sqs:1.10.75, com.amazonaws:aws-java-sdk-ses:1.10.75, com.amazonaws:aws-java-sdk-cloudformation:1.10.75, com.amazonaws:aws-java-sdk-route53:1.10.75, com.amazonaws:aws-java-sdk-opsworks:1.10.75, com.amazonaws:aws-java-sdk-swf-libraries:1.10.75, com.amazonaws:aws-java-sdk-simpleworkflow:1.10.75, com.amazonaws:aws-java-sdk-iam:1.10.75, com.amazonaws:aws-java-sdk-elasticloadbalancing:1.10.75, com.amazonaws:aws-java-sdk-ec2:1.10.75, com.amazonaws:aws-java-sdk-autoscaling:1.10.75, com.acuitysds.model:data-model-config:0.13.0.3-SNAPSHOT, io.dropwizard:dropwizard-configuration:0.9.1, com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.6.3, org.yaml:snakeyaml:1.15, org.apache.commons:commons-lang3:3.4, com.acuitysds.di:data-integration-sales:0.13.0.3-SNAPSHOT, com.github.spullara.mustache.java:compiler:0.8.16, cglib:cglib-nodep:2.2.2, com.acuitysds.services:services-admin:0.13.0.3-SNAPSHOT, com.acuitysds.services:services-admin-ui:0.13.0.3-SNAPSHOT, commons-codec:commons-codec:1.9, com.jamierf.dropwizard:dropwizard-logging-loggly:0.7, ch.qos.logback.contrib:logback-json-classic:0.1.2, ch.qos.logback.contrib:logback-json-core:0.1.2, ch.qos.logback.contrib:logback-jackson:0.1.2, org.logback-extensions:logback-ext-loggly:0.1.2, io.dropwizard:dropwizard-logging:0.9.1, io.dropwizard:dropwizard-jackson:0.9.1, io.dropwizard:dropwizard-util:0.9.1, com.fasterxml.jackson.core:jackson-core:2.6.1, com.fasterxml.jackson.core:jackson-annotations:2.6.1, com.fasterxml.jackson.core:jackson-databind:2.6.1, com.fasterxml.jackson.datatype:jackson-datatype-jdk7:2.6.3, com.fasterxml.jackson.datatype:jackson-datatype-guava:2.6.3, com.fasterxml.jackson.module:jackson-module-afterburner:2.6.3, com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.3, io.dropwizard:dropwizard-validation:0.9.1, org.hibernate:hibernate-validator:5.2.2.Final, javax.validation:validation-api:1.1.0.Final, org.jboss.logging:jboss-logging:3.2.1.Final, com.fasterxml:classmate:1.1.0, org.glassfish:javax.el:3.0.0, io.dropwizard.metrics:metrics-logback:3.1.2, io.dropwizard.metrics:metrics-core:3.1.2, org.slf4j:slf4j-api:1.7.5, org.slf4j:jul-to-slf4j:1.7.12, ch.qos.logback:logback-core:1.0.13, ch.qos.logback:logback-classic:1.0.13, org.slf4j:log4j-over-slf4j:1.7.12, org.slf4j:jcl-over-slf4j:1.7.5, org.eclipse.jetty:jetty-util:9.2.13.v20150730, io.dropwizard:dropwizard-core:0.9.1, io.dropwizard:dropwizard-metrics:0.9.1, io.dropwizard:dropwizard-jersey:0.9.1, org.glassfish.jersey.ext:jersey-metainf-services:2.22.1, org.glassfish.jersey.ext:jersey-bean-validation:2.22.1, io.dropwizard.metrics:metrics-jersey2:3.1.2, com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.6.3, com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.6.3, com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.6.3, org.glassfish.jersey.containers:jersey-container-servlet:2.22.1, org.eclipse.jetty:jetty-server:9.2.13.v20150730, org.eclipse.jetty:jetty-io:9.2.13.v20150730, org.eclipse.jetty:jetty-webapp:9.2.13.v20150730, org.eclipse.jetty:jetty-xml:9.2.13.v20150730, org.eclipse.jetty:jetty-continuation:9.2.13.v20150730, io.dropwizard:dropwizard-jetty:0.9.1, io.dropwizard.metrics:metrics-jetty9:3.1.2, org.eclipse.jetty:jetty-servlet:9.2.13.v20150730, org.eclipse.jetty:jetty-security:9.2.13.v20150730, org.eclipse.jetty:jetty-servlets:9.2.13.v20150730, org.eclipse.jetty:jetty-http:9.2.13.v20150730, io.dropwizard:dropwizard-lifecycle:0.9.1, io.dropwizard.metrics:metrics-jvm:3.1.2, io.dropwizard.metrics:metrics-servlets:3.1.2, io.dropwizard.metrics:metrics-json:3.1.2, io.dropwizard.metrics:metrics-healthchecks:3.1.2, net.sourceforge.argparse4j:argparse4j:0.6.0, org.eclipse.jetty.toolchain.setuid:jetty-setuid-java:1.0.3, org.glassfish.jersey.containers:jersey-container-servlet-core:2.22.1, org.glassfish.jersey.core:jersey-server:2.22.1, org.glassfish.jersey.core:jersey-common:2.22.1, org.glassfish.jersey.bundles.repackaged:jersey-guava:2.22.1, org.glassfish.hk2:osgi-resource-locator:1.0.1, org.glassfish.jersey.media:jersey-media-jaxb:2.22.1, javax.annotation:javax.annotation-api:1.2, org.glassfish.hk2:hk2-api:2.4.0-b31, org.glassfish.hk2:hk2-utils:2.4.0-b31, org.glassfish.hk2.external:aopalliance-repackaged:2.4.0-b31, org.glassfish.hk2.external:javax.inject:2.4.0-b31, org.glassfish.hk2:hk2-locator:2.4.0-b31, org.glassfish.jersey.core:jersey-client:2.22.1]
  Native-Dependencies (A list of Maven dependencies consisting of native library artifacts; each item can be a comma separated pair, with the second component being a new name to give the download artifact): 
	{} (default)
  Repositories (A list of Maven repositories, each formatted as URL or NAME(URL)): 
	[acuity-public(http://ci.dev.acuitysds.com:8081/nexus/content/groups/public), acuity-private(http://ci.dev.acuitysds.com:8081/nexus/content/groups/acuity)]
  Allow-Snapshots (Whether or not SNAPSHOT dependencies are allowed): 
	true

Uh, that may be related to the authentication change.

I've reverted some unnecessary, disruptive, changes.

Was there a new SNAPSHOT? I cleared my local cache but it is still pulling capsule-maven-1.0.4-20161221.194732-7.jar.

Also, not sure if this is the same conclusion you came to, but it looks like the reason I'm seeing so many new dependency issues is that capsule-maven is now including "optional" transitive dependencies which is wrong. For example, in the case of my AWS SDK dependency, the failure chain is this:

 Failed to collect dependencies at com.acuitysds.services:services-common:jar:0.13.0.3-SNAPSHOT -> com.acuitysds:common-aws:jar:0.13.0.3-SNAPSHOT -> com.amazonaws:aws-java-sdk-swf-libraries:jar:1.10.75 -> org.springframework:spring-test:jar:3.0.7.RELEASE -> org.springframework:spring-webmvc-portlet:jar:3.0.7.RELEASE -> org.springframework:spring-webmvc:jar:3.0.7.RELEASE -> jasperreports:jasperreports:jar:2.0.5 -> commons-collections:commons-collections:jar:3.2.1.redhat-7

If you look at the pom.xml for com.amazonaws:aws-java-sdk-swf-libraries:jar:1.10.75 you can see that org.springframework:spring-test:jar:3.0.7.RELEASE is declared as <optional>true</optional> and therefore shouldn't be included in com.acuitysds:common-aws:jar:0.13.0.3-SNAPSHOT

Yes, I accidentally messed up some filters. There should be a new snapshot now. Problem is, I also reverted what I had originally thought was my fix for the transitive exclusion problem, so please let me know.

Got capsule-maven-1.0.4-20161222.140713-10.jar and capsule-1.0.4-20161222.140832-12.jar; I'm back to seeing dependencies resolve and the app start, but the classpath/exclusion issue is back.

If Aether was conceived to make it easier to deal with central in a uniform way, I think there is still some work to be done there!

Can you run with -Dcapsule.tree, just to make sure the excluded dependency isn't included through some other path?

Also, I have now added code that tries to resolve a parent POM and use its dependency management. You can give that a try, too.

Yes! I think this is looking good. The default profile for caupsule-maven-plugin is including transitive dependencies so they are too high up the tree for exclusions to apply. With a custom config such that only direct dependencies are included in the manifest, it looks like exclusion rules are working.

For the record (in case anyone runs into a similar issue) the following options create the minimal "thin" capsule:

<includeApp>true</includeApp>
<includeCompileDep>false</includeCompileDep>
<includeRuntimeDep>false</includeRuntimeDep>
<includeProvidedDep>false</includeProvidedDep>
<includeSystemDep>false</includeSystemDep>
<includeTestDep>false</includeTestDep>
<includeTransitiveDep>false</includeTransitiveDep>
<includeOptionalDep>false</includeOptionalDep>

<resolveApp>false</resolveApp>
<resolveCompileDep>true</resolveCompileDep>
<resolveRuntimeDep>true</resolveRuntimeDep>
<resolveProvidedDep>false</resolveProvidedDep>
<resolveSystemDep>false</resolveSystemDep>
<resolveTestDep>false</resolveTestDep>
<resolveTransitiveDep>false</resolveTransitiveDep>

I am still seeing a classpath discrepancy, but it is a version mismatch (and involves dependency management) so I will open a new issue for that.

Thanks @pron you've been a great help!