Closed qiankunli closed 6 years ago
Interesting. I guess at least you can keep using 0.9.7. In the meantime, could you test the following things in order with 0.9.8?
$ cat ~/.docker/config.json
and upload the output (stripping sensitive info)mvn help:effective-settings
settings.xml
and enter auth info in pom.xml
instead:
<to>
<image>harbor.test.xxx.com/test/jib-springboot-demo</image>
<auth>
<username>...</username>
<password>...</password>
</auth>
</to>
rm -rf ~/.m2/repository/com/google/cloud/tools/jib-maven-plugin/ && mvn -U clean compile jib:build
mvn -U -Djib.to.auth.username=<username> -Djib.to.auth.password=<password> clean compile jib:build
@chanseokoh
mvn help:effective-settings
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<localRepository xmlns="http://maven.apache.org/SETTINGS/1.1.0">/Users/nali/.m2/repository</localRepository>
<servers xmlns="http://maven.apache.org/SETTINGS/1.1.0">
<server>
<username>admin</username>
<password>***</password>
<id>artifactory</id>
</server>
<server>
<username>admin</username>
<password>***</password>
<id>harbor.test.xxx.com</id>
</server>
</servers>
<profiles xmlns="http://maven.apache.org/SETTINGS/1.1.0">
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>artifactory-central</id>
<url>http://artifactory.xxx.com/artifactory/repo</url>
</repository>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<id>artifactory-snapshots</id>
<url>http://artifactory.xxx.com/artifactory/repo</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>artifactory-central</id>
<url>http://artifactory.xxx.com/artifactory/plugins-releases</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>false</enabled>
</releases>
<id>artifactory-snapshots</id>
<url>http://artifactory.xxx.com/artifactory/plugins-snapshots</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>false</enabled>
</releases>
<id>artifactory-central-snapshots</id>
<url>http://artifactory.xxx.com/artifactory/plugins-snapshots-local/</url>
</pluginRepository>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>artifactory-central-releases</id>
<url>http://artifactory.xxx.com/artifactory/plugins-releases-local/</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
<profile>
<repositories>
<repository>
<id>objectweb</id>
<name>objectweb Repository</name>
<url>http://maven.ow2.org/maven2/</url>
</repository>
<repository>
<id>ibiblio</id>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven/</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<id>snapshots</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>sonatype</id>
<url>http://repository.sonatype.org/</url>
</repository>
<repository>
<id>codehaus</id>
<url>http://repository.codehaus.org/</url>
</repository>
<repository>
<id>org.springframework.maven.milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
</repository>
<repository>
<snapshots />
<id>spring-maven-snapshot</id>
<name>Springframework Maven SNAPSHOT Repository</name>
<url>http://maven.springframework.org/snapshot</url>
</repository>
<repository>
<id>springsource.repository</id>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>cedarsoft-thirdparty</id>
<url>http://maven.cedarsoft.com/content/repositories/thirdparty/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>false</enabled>
</releases>
<id>snapshots</id>
<url>http://repo1.maven.org/maven2/</url>
</pluginRepository>
<pluginRepository>
<id>sonatype</id>
<url>http://repository.sonatype.org</url>
</pluginRepository>
<pluginRepository>
<id>objectweb</id>
<url>http://maven.ow2.org/maven2/</url>
</pluginRepository>
</pluginRepositories>
<id>m2repo</id>
</profile>
</profiles>
<activeProfiles xmlns="http://maven.apache.org/SETTINGS/1.1.0">
<activeProfile>artifactory</activeProfile>
</activeProfiles>
<pluginGroups xmlns="http://maven.apache.org/SETTINGS/1.1.0">
<pluginGroup>org.apache.maven.plugins</pluginGroup>
<pluginGroup>org.codehaus.mojo</pluginGroup>
</pluginGroups>
</settings>
I remove the auth in settings.xml
and run mvn -U -Djib.to.auth.username=<username> -Djib.to.auth.password=<password> clean compile jib:build
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.8:build (default-cli) on project docker-springboot-demo: Build image failed, perhaps you should make sure your credentials for 'harbor.test.xxx.com' are set up correctly: Unauthorized for harbor.test.xxx.com/test/jib-springboot-demo: 401 Unauthorized
[ERROR] {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"test/jib-springboot-demo","Action":"pull"},{"Type":"repository","Class":"","Name":"test/jib-springboot-demo","Action":"push"},{"Type":"repository","Class":"","Name":"test/jdk8","Action":"pull"}]}]}
I have the same problem!
jib-version : 0.9.8
Build image failed, perhaps you should make sure your credentials for 'registry.xxxx.com' are set up correctly: Unauthorized for registry.xxxx.com/jib-example: 401 Unauthorized
@qiankunli from https://github.com/GoogleContainerTools/jib/issues/699#issue-343957843, I noticed that with 0.9.7, you were connecting through the plain HTTP (not HTTPS) by setting allowInsecureRegistries
to true. (And I'm sure you were passing your password with -DsendCredentialsOverHttp
.) Is this still the case, or harbor.test.xxx.com
is now a full-fledged HTTPS registry?
@Justinmad likewise, with 0.9.7, were you setting allowInsecureRegistries
to true to connect to an HTTP (not HTTPS) registry?
@qiankunli can you give us an update (https://github.com/GoogleContainerTools/jib/issues/790#issuecomment-410565750)?
I believe this is the same issue as https://github.com/GoogleContainerTools/jib/issues/808#issuecomment-411457622
@coollog @chanseokoh it works in 0.9.9, thanks!
Thanks for confirming! Duplicate of #808
plugin config
maven settings.xml
mvn package jib:build
error log