Coder Social home page Coder Social logo

Comments (17)

arghya88 avatar arghya88 commented on July 23, 2024 8

remove targetPath tag

from docker-maven-plugin.

BrettFieber avatar BrettFieber commented on July 23, 2024 2

In case you can't wait for that PR, here is a workaround I came up with:

<!-- define a default value in <properties> ->
<properties>
    ...
    <docker.resource.targetPath>/</docker.resource.targetPath>
</properties>

<!-- define a profile that is activated in windows environments -->
<profiles>
    <profile>
        <id>windows</id>
        <activation>
            <os>
                <family>Windows</family>
            </os>
        </activation>
        <properties>
            <docker.resource.targetPath></docker.resource.targetPath>
        </properties>
    </profile>
</profiles>

<!-- then set the targetPath using the property -->
<build>
    <plugins>
        <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.2.12</version>
                <configuration>
                    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                    <dockerDirectory>src/main/docker</dockerDirectory>
                    <resources>
                       <resource>
                           <targetPath>${docker.resource.targetPath}</targetPath>
                           <directory>${project.build.directory}</directory>
                           <include>${project.build.finalName}.jar</include>
 ...

Hope this helps.

from docker-maven-plugin.

sunieldalal avatar sunieldalal commented on July 23, 2024 1

I was facing the same issue. Upgraded to 0.3.9 version and no longer facing the issue.

from docker-maven-plugin.

chrisdostert avatar chrisdostert commented on July 23, 2024

@arghya88 your suggestion worked great for me

from docker-maven-plugin.

rharido avatar rharido commented on July 23, 2024

If you want to copy your resources to a specific folder in the docker image you will need targetPath. In this case it is still a problem.
/opt/${project.artifactId} -- Fails in windows

from docker-maven-plugin.

rohansingh avatar rohansingh commented on July 23, 2024

What happens if you use backslashes in the targetPath?

from docker-maven-plugin.

sellersj avatar sellersj commented on July 23, 2024

I'm running into this issue too on version 0.2.11. I've tried:
/
${file.separator}
/
/

//

Any helpers or work arounds would be great.

from docker-maven-plugin.

sellersj avatar sellersj commented on July 23, 2024

I have not tested it yet, but it looks like someone has made a fix. It's waiting in a PR
https://github.com/oberthur/docker-maven-plugin/commit/1f303e0aeb76aee5122d6d7bda4cd240518a6337

from docker-maven-plugin.

sellersj avatar sellersj commented on July 23, 2024

I've now tested oberthur's fork and it works for me on windows. The change is in #65

from docker-maven-plugin.

pmandayam avatar pmandayam commented on July 23, 2024

@BrettFieber this worked for me, thanks

from docker-maven-plugin.

davidxia avatar davidxia commented on July 23, 2024

This should be resolved by https://github.com/spotify/docker-maven-plugin/pull/121/commits

from docker-maven-plugin.

javacody avatar javacody commented on July 23, 2024

I just tried this with 0.3.5 on Windows. It's still broken.

from docker-maven-plugin.

sellersj avatar sellersj commented on July 23, 2024

Not that it helps for the spotify plugin, but one I've found that works on windows is https://github.com/rhuss/docker-maven-plugin

Good luck.

from docker-maven-plugin.

rohansingh avatar rohansingh commented on July 23, 2024

Reopening this based on reports that it doesn't work. We welcome PR's but are unlikely to fix this at Spotify, since nobody has a Windows setup to test it out with.

from docker-maven-plugin.

craykg avatar craykg commented on July 23, 2024

I ran into this same issue, and have created a PR that works around the issue (its actually a bug in the Windows implementation of Paths.get)

from docker-maven-plugin.

mattnworb avatar mattnworb commented on July 23, 2024

@javacody do you still have issues with 0.3.9-SNAPSHOT? If so can you tell us the output of running your maven commands with the -e flag?

from docker-maven-plugin.

mattnworb avatar mattnworb commented on July 23, 2024

@sunieldalal thanks for the confirmation!

from docker-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.