fabric8-maven-plugin: Error creating assembly archive docker: You must set at least one file. with mode dir

Using the defaults when prompted:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate -Dfilter=io.fabric8:spring-boot-camel-archetype -DgroupId=my.test -DartifactId=fabric8-test-project
cd fabric8-test-project
➜  fabric8-test-project mvn clean fabric8:resource fabric8:build fabric8:push fabric8:deploy -Ddocker.push.registry=fabric8-docker-registry.default.beast.fabric8.io
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Fabric8 :: Quickstarts :: Spring-Boot :: Camel 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ fabric8-test-project ---
[INFO] Deleting /Users/jamesrawlings/archs/fabric8-test-project/target
[INFO]
[INFO] --- fabric8-maven-plugin:3.1.17:resource (default-cli) @ fabric8-test-project ---
[INFO] F8> Running in Kubernetes mode
[INFO] F8> Running generator spring-boot
[INFO] F8> fmp-service: Adding a default Service with ports [8080]
[INFO] F8> fmp-controller: Adding a default Deployment
[WARNING] F8> No .git/config file could be found so cannot annotate kubernetes resources with git commit SHA and branch
[WARNING] F8> No .git/config file could be found so cannot annotate kubernetes resources with git commit SHA and branch
[INFO]
[INFO] >>> fabric8-maven-plugin:3.1.17:build (default-cli) > initialize @ fabric8-test-project >>>
[INFO]
[INFO] <<< fabric8-maven-plugin:3.1.17:build (default-cli) < initialize @ fabric8-test-project <<<
[INFO]
[INFO] --- fabric8-maven-plugin:3.1.17:build (default-cli) @ fabric8-test-project ---
[INFO] F8> Running in Kubernetes mode
[INFO] F8> Running generator spring-boot
[WARNING] Cannot include project artifact: my.test:fabric8-test-project:jar:1.0-SNAPSHOT; it doesn't have an associated file or directory.
[WARNING] The following patterns were never triggered in this artifact inclusion filter:
o  'my.test:fabric8-test-project'

[ERROR] F8> Failed to create assembly for docker image: Error creating assembly archive docker: You must set at least one file. with mode dir
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (18 by maintainers)

Most upvoted comments

In short: The message is weird, but what it means is that the assembly plugin can’t find the dependency you set in <dependencySets>.

<dependencySets>
    <dependencySet>
        <useProjectArtifact>false</useProjectArtifact>
        <includes>
            <include>com.mycompany:bpds-api</include>
        </includes>
        <outputDirectory>.</outputDirectory>
        <outputFileNameMapping>bpds-fabric8.jar</outputFileNameMapping>
    </dependencySet>
</dependencySets>

You need to add that to project’s dependencies. Check that it’s not test scope.

<dependencies>
    <dependency>
        <groupId>com.mycompany</groupId>
        <artifactId>bpds-api</artifactId>
        <version>${project.version}</version>
    </dependency>
</dependencies>