I am working on NetBeans 7.0 which has maven 3.0.3 by default.... last week I opened a project which was developed using Maven 2.2... Now even after closing that project.. NetBeans is not allowing me to create any new project...not even the sample projects of NetBeans.... Every time I get the following error ...
Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org: Unknown host repo1.maven.org -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
"**[Help 1] http://cw
iki.apache.org/confluence/display/MAVEN/PluginResolutionException"**
any help regarding this will be appreciated....
Thanks in advance,,
Unknown host repo1.maven.org
Try setting your DNS to 8.8.8.8 or 8.8.4.4 these are google's DNS which can resolve this name
in Linux machine.
type
sudo gedit /etc/resolv.conf
add an entry of nameserver with the mentioned IP
Related
I am on windows and this is the plugin configuration:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<container>
<ports>
<port>8080</port>
</ports>
<format>OCI</format>
</container>
</configuration>
</plugin>
This is the command I run:
.\mvnw clean install jib:dockerBuild -Dimage=fullstack:v1
This is the error I keep getting no matter what I do:
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.2.1:dockerBuild (default-cli) on project SpringBootFullStack: Build
to Docker daemon failed, perhaps you should make sure your credentials for 'registry-1.docker.io/library/eclipse-temurin' are set up correc
tly. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-unauthorized f
or help: Unauthorized for registry-1.docker.io/library/eclipse-temurin: 401 Unauthorized
[ERROR] {"details":"incorrect username or password"}
[ERROR] -> [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
How should I go about it? I've read the documentation on jib github repo on authenticating but I don't really understand how to procede and feel overwhelmed
UPDATE
I ran docker login and I get:
Authenticating with existing credentials...
Login Succeeded
but the error persists (and I figured I didn't include some part of the logging maybe:
[INFO] Using credentials from Docker config (C:\Users\david\.docker\config.json) for openjdk:17
[INFO] Executing tasks:
[INFO] [============ ] 40.0% complete
[INFO] > building image to Docker daemon
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.964 s
[INFO] Finished at: 2022-05-17T19:39:12+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.2.1:dockerBuild (default-cli) on project SpringBootFullStack: Build
to Docker daemon failed, perhaps you should make sure your credentials for 'registry-1.docker.io/library/openjdk' are set up correctly. See
Unauthorized for registry-1.docker.io/library/openjdk: 401 Unauthorized
[ERROR] {"details":"incorrect username or password"}
[ERROR] -> [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
UPDATE 2
this is also the content of the file logs refer to in order to get username and password:
{
"auths": {
"https://index.docker.io/v1/": {}
},
"credsStore": "desktop"
}
UPDATE 3
After two days of trying I decided to look for something else that would do the same job: https://spring.io/guides/gs/spring-boot-docker/
And with this the job was done in ~10 minutes. Life really is crazy
Just delete the credsStore property from the docker-config file.
You will find the config.json at your user-home dir.
the path is: $USER/.docker/config.json
and suppose the file contains the followings,
{
"auths": {
"https://index.docker.io/v1/": {}
},
"credsStore": "desktop"
}
and now delete the line :
"credsStore": "desktop"
So, the file will now contain the following
{
"auths": {
"https://index.docker.io/v1/": {}
}
}
{"details":"incorrect username or password"}
The response from the server is clear. Credentials were given to the server, and it says they are wrong.
Indeed, Jib did retrieve some (probably non-working) credentials from the Docker config.json file:
[INFO] Using credentials from Docker config (C:\Users\david\.docker\config.json) for openjdk:17
Try emptying config.json entirely or have just an empty {} block. Particularly, remove the entry for "https://index.docker.io/v1/" and credsStore. Deleting the file may or may not work, as Docker or other tools can regenerate it with wrong credentials again.
Probably the same kind of issue to this Stack Overflow question. Also take a look at this GitHub issue on the Jib repo.
I had the same issue on Mac.
And I found 2 ways how to solve it:
To do this, you can use the jib config:
<configuration>
...
<from>
<image>aws_account_id.dkr.ecr.region.amazonaws.com/my-base-image</image>
<auth>
<username>my_username</username>
<password>my_password</password>
</auth>
</from>
<to>
<image>gcr.io/my-gcp-project/my-app</image>
<auth>
<username>${env.REGISTRY_USERNAME}</username>
<password>${env.REGISTRY_PASSWORD}</password>
</auth>
</to>
...
</configuration>
https://github.com/GoogleContainerTools/jib/blob/master/jib-maven-plugin/README.md#auth-object
The second way is not about Windows, i fixed this issue on Mac OS but you can try to use my experience. I figured that it's strange if we're getting 401 unauthorized the most likely Jib trying to login with some wrong credentials.
In my case i found 2 rows in Keychain Access:
The first (wrong) with email in password (instead real password))
The second (correct) with real password
Jib tried to use first. The problem was solved after deleting the first value.
In windows case you can try to use Credential Manager or find some another credentials storage.
Additionally.
While i was researching it i found recommendations to change:
"credsStore": "desktop" -> "credStore": "desktop"
But it didn't work for me.
UPD
Same story on Windows use Credential Manager
I ran into the same problem on Windows.
Try removing the following creds:
..docker../acces-token
..docker../refresh-token
https://i.stack.imgur.com/G9aGR.png
If you don't want to go the extra credentials configuration step, pass them when running mvn package as below:
mvn package -D jib.to.auth.username="yourdockerUsername" -Djib.to.auth.password="yourDockerPassword"
It will build and push to docker Hub as required.
I had the issue on windows and solved the problem as follows:
Control Panel\All Control Panel Items\Credential Manager
From here I have removed in the Generic Credentials section all the entries related to docker
The from the powershell prompt:
docker login
and it worked!
faced same issue on win10 ... had to close docker desktop, I got some WARN related to credentials though, but it created the img
I have a problem deploying my springboot application to Heroku. After running git push heroku master, I am encountering the error below:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.350 s
[INFO] Finished at: 2020-12-22T06:33:14Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project audit: Fatal error compiling: invalid target release: 11 -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :audit
remote: ! Push rejected, failed to compile Java app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 31199a7acec03a3cb614ebaaf6c7720cee6684bd
remote: !
remote: ! We have detected that you have triggered a build from source code with version 31199a7acec03a3cb614ebaaf6c7720cee6684bd
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to tesda8app.
I am clueless into why this error occurred. I have two remote repositories on which I push my code, one from Heroku and one in Github. I have tried the command below based from the answer from this question, Heroku: If you are developing on a branch and deploying via git you must run:
git push heroku master:main
But still the error persists. Is there any command that I could try on the Heroku CLI to solve this problem?
After some few tries, I was thinking that the cause of the problem was maybe an interrupted git push heroku master command, which was then proceeded by a re-execution of the same command, causing the error below:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 31199a7acec03a3cb614ebaaf6c7720cee6684bd
remote: !
remote: ! We have detected that you have triggered a build from source code with version 31199a7acec03a3cb614ebaaf6c7720cee6684bd
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
So what I did was, I pushed another commit, then retried the same command git push heroku master, which resulted to a successful deployment.
Also, shoutout to RainXCat's answer and insights, now I know Heroku does not allow two git repositories on the same directory/folder.
I was having the same error on the same day as you, I don't know if it's the answer you are looking for but I somehow solved the issue. I was making a Django-Rest-Api.
REASON
you have created two git repositories in the same folder/directory and pushed the same code into their head and somehow Heroku doesn't want you to do that.
remember no two git repo on the same level.
about the git push heroku master:main thing
Heroku only deploy your code from the main/master branch
so if you are pushing from other than master, you have to use it like git push heroku <new branch>:main, using :main with master is meaningless(same).
SOLUTION
option 1 (not working for me)
I don't remember exactly where I get this but you have to make a new git branch,
do
git branch <new branch>
git checkout <new branch>
git add .
git commit -am "commit message"
git push heroku <new branch>:main
but it's giving the same error because you still have two git repo in your directory.
you can remove the repo like this.
rm -rf .git
I suggest you to do the experiment on a temporary copy.
option 2 (working for me)
All I did was copy all the files inside, made a new folder with a different name, pasted all files, deleted the old, and rename the new to the old one. by doing this you will have a git free directory then you can use the git init method to simply make a new repo.
here is how you should create
git init
heroku create
git add .
git commit -am "initial commit"
git push heroku master
This should resolve the error, It's solved for me so it's unlikely that I am going to work on it anymore but if my answer is not right in any manner please do tell me.
this worked for me!
git branch <new branch>
git checkout <new branch>
git add .
git commit -am "commit message"
git push heroku <new branch>:main
git push --set-upstream heroku <new branch>
this worked for me.
I deleted my package-lock.json file and do the following again
git init
git add .
git commit -m ""
git push heroku main
the purpose is to clear your build cache
I just made an empty commit and push again.
It worked for me.
git commit --allow-empty -m 'empty commit for pushing staging environment'
git push staging master
Install the Heroku CLI
Download and install the Heroku CLI.
If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.
$ heroku login
Clone the repository
Use Git to clone projects' source code to your local machine.
$ heroku git:clone -a project
$ cd project
Deploy your changes
Make some changes to the code you just cloned and deploy them to Heroku using Git.
$ git add .
$ git commit -am "make it better"
$ git push heroku master
I'm running Docker 1.12.0 on a Windows 10 machine. I'm developing a Java program, using Maven 3.3.9 as a dependency manager. I have a maven docker plugin (https://github.com/fabric8io/docker-maven-plugin), which gives the following error on clean install.
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.16:build (docker-build-start) on project integration-test: Execution docker-build-start of goal io.fabric8:docker-maven-plugin:0.15.16:build failed: No <dockerHost> or <machine> given, no DOCKER_HOST environment variable, and no read/writable '/var/run/docker.sock' -> [Help 1]
When I run a clean install with the following configuration option in the POM file:
<dockerHost>tcp://0.0.0.0:2376</dockerHost>
the following result is shown.
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.16:build (docker-build-start) on project integration-test: Cannot create docker access object: Cannot extract API version from server https://0.0.0.0:2376: Connect to 0.0.0.0:2376 [/0.0.0.0] failed: Connection refused: connect -> [Help 1]
My question: is there an IP address I can use to tell this maven plugin where it can reach the daemon? Normal docker commands work perfectly fine. The plugin works without any problems on OS X.
After nearly a day of fruitless Googling I found this solution by myself. Trivial, but might still help others.
You need to enable the checkbox 'Expose daemon on...' under Settings -> General
On Windows 10 with Docker for Windows, the Docker Engine API is available in these two locations:
npipe:////./pipe/docker_engine
http://localhost:2375
I recommend trying with the localhost one.
Details here: https://docs.docker.com/docker-for-windows/faqs/#/how-do-i-connect-to-the-remote-docker-engine-api
It seems the user which is running Maven goals doesn't have access to docker.sock . The error message is telling which options are there to resolve the problem.
No <dockerHost> or <machine> given, no DOCKER_HOST environment
variable, and no read/writable '/var/run/docker.sock'
Last option is the easiest one because it requires a file permission and it doesn't need to create any docker machine or set a DOCKER_HOST, On Linux you can change read/write permission of docker.sock with the following:
sudo chmod 776 /var/run/docker.sock
On windows go through this article : Microsoft article
I had the same issue when I tried to build a project in a custom GitLab CI/CD runner, with another than root user defined in a custom build image. I fixed by setting the read/write permission for users to the docker-socket.
chmod o+rw /var/run/docker.sock
If you are using Window and Maven in eclipse to build your java project
but continue seeing that error, then you have to perform these steps:
Step1:
You need to enable the checkbox 'Expose daemon on...' under Settings -> General
As mentioned by #Adriaan Koster
If step1 does not solve the issue,then
Step2: Run your eclipse in administration mode.
Now it should work without issues.
If someone just wants to skip fabric8 docker-maven-plugin execution that prevents build to succeed with error
No given, no DOCKER_HOST environment variable, no
read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and
no external provider like Docker machine configured
then this can be achieved with -Ddocker.skip=true according to https://dmp.fabric8.io/#global-configuration.
use docker-machine if you are using toolbox.
<machine>
<name>default</name>
<autoCreate>true</autoCreate>
<createOptions>
<driver>virtualbox</driver>
<virtualbox-cpu-count>2</virtualbox-cpu-count>
</createOptions>
</machine>
I have the following problem while trying to download the artifact bbb:
[ERROR] Failed to execute goal on project phoenix-model: Could not
resolve dependencies for project
aaa:jar:4.7.0-SNAPSHOT: Failed to
collect dependencies at
bbb:jar:1.0.24-SNAPSHOT: Failed to
read artifact descriptor for
bbb:jar:1.0.24-SNAPSHOT: Could not
transfer artifact
bbb:pom:1.0.24-SNAPSHOT from/to
nexus (https://s.s.com/nexus/content/groups/public):
Hostname 's.s.com' was not verified - [Help 1]
it tries to connect to s.s.com (not the real name) but could not find it in the cacerts keystore since the site doesn't use the name s.s.com in it's certificate but rather s.j.com (and i can't change that since i'm not the admin).
Any way to tell maven or jdk to bypass that?
I am running the command from the eclipse m2 tool plugin by adding the following in the jdk arguments:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Djsse.enableSNIExtension=false -Dmaven.wagon.http.ssl.ignore.validity.dates=true
currently using the embeded mvn of kepler which is at 3.2.1
any idea what is wrong?
if i used the same setting with the exception of mvn configured at external version 3.2.2 it runs perfectly fine.
Straight to specific problem
If I specify "fully qualified" SSH address with path in pom.xml
<scm>
<developerConnection>scm:git:username#hostname:/absolute/path/to/repo.git</developerConnection>
</scm>
and use it in command like
mvn --batch-mode release:prepare -Dtag=whatever -DreleaseVersion=3.0 -DdevelopmentVersion=4.0-SNAPSHOT
then I get error like
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project maven_dependencies: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: 'hostname/absolute/path/to/repo.git' does not appear to be a git repository
[ERROR] fatal: Could not read from remote repository.
NOTE: The semicolon between hostname and /absolute/path/to/repo.git which was in pom.xml disappeared in the error output!
Additional details
Absolute vs relative path
Actually, I'm able to use Git with non-absolute path in SSH URL (relative to usernname's home directory). For example, using
scm:git:username#hostname:path/to/repo.git
instead of
scm:git:username#hostname:/home/username/path/to/repo.git
works perfectly.
Official documentation
I've read official Maven Release documentation for Git and, because standard SSH-like URL already worked at least in relative path case, I deliberately ignore its weird URL specification:
scm:git:ssh://username#hostname[:port]/~/path/to/repository
The reason to rebel and ignore this syntax is inability to imply path relative to user's home (which SSH does by default if path does not start with /). Moreover, colon : after hostname for standard SSH-like URL is a delimiter between hostname and path (not a port number)!
This means that Git URLs for SSH have to be specifically re-formatted for Maven Release plugin - what a headache!