Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

plugin does not work if artifactId contains uppercase character. #215

Closed
sunels opened this issue Apr 7, 2016 · 5 comments
Closed

plugin does not work if artifactId contains uppercase character. #215

sunels opened this issue Apr 7, 2016 · 5 comments

Comments

@sunels
Copy link

sunels commented Apr 7, 2016

Description

plugin does not work if artifactId contains uppercase character.

How to reproduce

plugin does not work if maven project artifactId contains uppercase character.

What do you expect

It must not be a problem , if it is so it must be written in the docs !!

What happened instead

mvn clean package docker:build throw exception

INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Connection reset by peer at Socket[addr=0.0.0.0/0.0.0.0,port=0,localport=0][fd=java.io.FileDescriptor@5fad5636; file=/run/docker.sock; connected=true; bound=false]

Software:

  • docker version: [pls see below docker info output]
  • docker-maven-plugin version: [0.2.3]
  • maven version: [3.0.5]
    sunels@sunels:~$ docker info
    Containers: 7
    Running: 0
    Paused: 0
    Stopped: 7
    Images: 37
    Server Version: 1.10.3
    Storage Driver: aufs
    Root Dir: /var/lib/docker/aufs
    Backing Filesystem: extfs
    Dirs: 45
    Dirperm1 Supported: true
    Execution Driver: native-0.2
    Logging Driver: json-file
    Plugins:
    Volume: local
    Network: bridge null host
    Kernel Version: 4.2.0-34-generic
    Operating System: Ubuntu 15.10
    OSType: linux
    Architecture: x86_64
    CPUs: 4
    Total Memory: 3.726 GiB
    Name: sunels
    ID: 4EBW:U4UN:U4UV:KYKY:TSTU:DSEZ:ZRYH:LS6B:FWRU:6CPE:YDP7:IJWG
    Username: sunels
    Registry: https://index.docker.io/v1/
    WARNING: No swap limit support

Full backtrace

sunels@sunels:/serkan sunel/ConsumerSharedService/consumerSharedService$ mvn clean compile package docker:build
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building consumer shared service 0.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Customer-shared-service ---
[INFO] Deleting /space/serkan sunel/ConsumerSharedService/consumerSharedService/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Customer-shared-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Customer-shared-service ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 35 source files to /space/serkan sunel/ConsumerSharedService/consumerSharedService/target/classes
[WARNING] /space/serkan sunel/ConsumerSharedService/consumerSharedService/src/main/java/com/gk/banking/CrudUtil.java: /space/serkan sunel/ConsumerSharedService/consumerSharedService/src/main/java/com/gk/banking/CrudUtil.java uses unchecked or unsafe operations.
[WARNING] /space/serkan sunel/ConsumerSharedService/consumerSharedService/src/main/java/com/gk/banking/CrudUtil.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Customer-shared-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Customer-shared-service ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Customer-shared-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /space/serkan sunel/ConsumerSharedService/consumerSharedService/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Customer-shared-service ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /space/serkan sunel/ConsumerSharedService/consumerSharedService/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ Customer-shared-service ---
[INFO] Surefire report directory: /space/serkan sunel/ConsumerSharedService/consumerSharedService/target/surefire-reports


T E S T S

Running com.gk.banking.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in banking.AppTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.5:jar (default-jar) @ Customer-shared-service ---
[INFO] Building jar: /space/serkan sunel/ConsumerSharedService/consumerSharedService/target/Customer-shared-service-0.1.0.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:1.3.3.RELEASE:repackage (default) @ Customer-shared-service ---
[INFO]
[INFO] --- docker-maven-plugin:0.2.3:build (default-cli) @ Customer-shared-service ---
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Copying /space/serkan sunel/ConsumerSharedService/consumerSharedService/target/Customer-shared-service-0.1.0.jar -> /space/serkan sunel/ConsumerSharedService/consumerSharedService/target/docker/Customer-shared-service-0.1.0.jar
[INFO] Copying src/main/docker/Dockerfile -> /space/serkan sunel/ConsumerSharedService/consumerSharedService/target/docker/Dockerfile
[INFO] Building image sunels/Customer-shared-service
Apr 07, 2016 9:04:48 AM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Connection reset by peer at Socket[addr=0.0.0.0/0.0.0.0,port=0,localport=0][fd=java.io.FileDescriptor@5fad5636; file=/run/docker.sock; connected=true; bound=false]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.355s
[INFO] Finished at: Thu Apr 07 09:04:48 EEST 2016
[INFO] Final Memory: 40M/242M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.2.3:build (default-cli) on project Customer-shared-service: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.client.ClientProtocolException: Cannot retry request with a non-repeatable request entity: Connection reset by peer at Socket[addr=0.0.0.0/0.0.0.0,port=0,localport=0][fd=java.io.FileDescriptor@5fad5636; file=/run/docker.sock; connected=true; bound=false] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
sunels@sunels:/space/projects/ConsumerSharedService/consumerSharedService$

[Paste full backtrace here]
@rhuss
Copy link

rhuss commented Apr 7, 2016

Docker has a somewhat strange syntax for the allowed image name part, i.e. it must conform to the pattern '[a-z0-9]+(?:(?:[._]|__|[-]*)[a-z0-9]+)*'. More on this here and the "official" spec here.

So if the artifact id is part of the image name, it must not contain uppercase letters (+ the other constraints described by the pattern above).

@sunels
Copy link
Author

sunels commented Apr 8, 2016

It is very clean for me to understand that artifactId does not meet the requirements.

I am just having difficulties to understand why getting "org.apache.http.client.ClientProtocolException" exception while expecting to get "com.x.y.x.SomeStupidException("Your artifactId does not meet requirements..bla bla bla..")"

Kind Regards

@rhuss
Copy link

rhuss commented Apr 8, 2016

You are absolutely correct (but wanted to point out, that there are still other restrictions like no more than two subsequent underscores too)

Its an issue on the Docker daemon side that it simply closes the connection without any error indication.

So you'd better validate on the client side, too, to get a meaningful error message.

@mattnworb
Copy link
Member

related to / duplicate of #206

@junxinzhang
Copy link

I also encountered the same problem. Your method solved my problem. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants