fabric8io / docker-maven-plugin

Maven plugin for running and creating Docker images
https://dmp.fabric8.io
Apache License 2.0
1.88k stars 643 forks source link

Double copy when using outputDirectory in assembly referenced from assembly/descriptor #152

Open BigSocial opened 9 years ago

BigSocial commented 9 years ago

When an image includes this:

<assembly>
    <basedir>/tomcat</basedir>
    <descriptor>tomcat-artifacts.xml</descriptor>
</assembly>

And tomcat-artifacts.xml look like this:

<files>
    <file>
         <outputDirectory>lib</outputDirectory>
         <source>src/test/drivers/mysql-connector-java-5.1.35-bin.jar</source>
    </file>
    <file>
         <outputDirectory>webapps</outputDirectory>
         <source>target/service.war</source>
    </file>
</files>

The files are copied to both /tomcat and their correct /tomcat/lib and /tomcat/webapps directories. Even more strange, the service.war file is renamed service-1.0.war when copied to the /tomcat directory.

rhuss commented 9 years ago

I will have a look at it, sounds weird indeed.

rhuss commented 9 years ago

I tried it, and it works for me. Please note that the content assembly is put into target/maven and then afterwards everything under target/maven is copied into the Docker image. That means, if there is already something within it, it will be copied, too. A mvn clean before should fix this.

Maybe its a good idea to cleanup target/maven before doing the assembly. Hmm, let's think about this.

rhuss commented 9 years ago

Sorry, the path is target/docker/<image name>/build/maven/