How to debug "The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found"? - maven

This is what I am trying to do. I have installed Maven. Set the path till bin folder of Maven.
C:\Workspace\Eaxample>mvn archetype:generate -DgroupId=com.mkyong -DartifactId=N
umberGenerator
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Error transferring file: Connecti
on timed out: connect
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Tue Nov 24 14:04:15 IST 2015
[INFO] Final Memory: 5M/122M

You forget archetypeArtifactId :
Do this :
mvn archetype:generate -DgroupId={project-packaging}
-DartifactId={project-name}
-DarchetypeArtifactId=maven-archetype-quickstart
-DinteractiveMode=false
http://www.mkyong.com/maven/how-to-create-a-java-project-with-maven/

Related

Build with frontend-maven-plugin fails on mac M1: Could not download Node.js

The frontend-maven-plugin tries to download a node file which does not exist.
When I look into https://nodejs.org/dist/v10.15.3 I can only see a file named node-v10.15.3-darwin-x64.tar.gz
[INFO] --- frontend-maven-plugin:1.7.5:install-node-and-npm (install node and npm) # oauth-ui-authorization-code-angular-zuul ---
[INFO] Installing node version v10.15.3
[INFO] Downloading https://nodejs.org/dist/v10.15.3/node-v10.15.3-darwin-arm64.tar.gz to /Users/me/.m2/repository/com/github/eirslett/node/10.15.3/node-10.15.3-darwin-arm64.tar.gz
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] mymodule 2.2.6.RELEASE FAILURE [ 4.536 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.930 s
[INFO] Finished at: 2022-09-28T14:28:09+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.5:install-node-and-npm (install node and npm) on project mymodule: Could not download Node.js: Got error code 404 from the server. -> [Help 1]
[ERROR]
This is a bug in the frontend-maven-plugin.
An upgrade to the current version should help:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
...
Thanks to:
https://github.com/apache/druid/issues/10804
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/m1-mac-cant-build-wknd-tutorial-get-quot-could-not-download-node/m-p/399462

"Auth fail" error with maven-scm-provider-jgit during release:prepare

I am on a windows machine where git command line is not installed. I have installed GitExtensions and an EGit and this is sufficient for me (until now).
Now I wanted to perform a maven release to BinTray, following this guide:
Publishing releases using Github, Bintray and maven-release-plugin
Running:
mvn -Prelease release:prepare
Produces this output:
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxxx 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.4.1:prepare (default-cli) # xxxxx ---
[INFO] Resuming release from phase 'scm-commit-release'
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
[INFO] Working directory: C:\Users\jbr\git\yyyyyyyyyyyyyyy
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.770 s
[INFO] Finished at: 2015-09-12T20:17:24+02:00
[INFO] Final Memory: 20M/989M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project xxxxx: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-add command failed.
[ERROR] Command output:
[ERROR] 'git' is not recognized as an internal or external command,
[ERROR] operable program or batch file.
Absolutely fair, I never use the git command from the windows shell and I never set up the pageant.exe stuff. (for details see this answer to the question “Why git can't remember my passphrase under Windows”).
My second idea was to use the maven-scm-provider-jgit to not depend on the git command line.
The output is now:
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxxx 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.4.1:prepare (default-cli) # xxxxx ---
[INFO] Change the default 'git' provider implementation to 'jgit'.
[INFO] Resuming release from phase 'scm-commit-release'
[INFO] Checking in modified POMs...
[INFO] push changes to remote... refs/heads/master:refs/heads/master
[INFO] fetch url: git#github.com:jmini/yyyyyyyyyyyyyyy.git
[INFO] push url: git#github.com:jmini/yyyyyyyyyyyyyyy.git
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project xxxxx: An error is occurred in the checkin process: Exception while executing SCM command. JGit checkin failure! git#github.com:jmini/yyyyyyyyyyyyyyy.git: Auth fail -> [Help 1]
Much better, but still no luck.
My guess is that the private key and the passphrase are not loaded. How should I configure them?
This answer suggests that for some SCM providers, it is possible to specify the credentials in the <servers> section of settings.xml. The domain name of the repository should be used as <id>.
According to the last comment with scm:git:ssh://git#bitbucket.org/{account}/{project} used in the <developerConnection>, this entry is working in the settings.xml:
<server>
<id>bitbucket.org</id>
<privateKey>/c/Users/neil.hunt/.ssh/id_rsa</privateKey>
</server>
Is this construct supported by the JGit SCM provider?
When searching for “Auth failed” error, I found this related question (plain JGit, no maven plugin):
How do you set the configuration for jschconfigsessionfactory for jgit so that pull and push work?

oozie3.3.2 Build failure while mkdistro.sh command execution

I Getting oozie 3.3.2 from apache.package.org. I can't installed oozie3.3.2 in my system. but I have installed maven in my system.
**Maven version :Apache Maven 2.2.1
Java version: 1.7.0_55**
$/oozie/bin$ ./mkdistro.sh -DskipTests
This line is not executed......
Detailed Error which i am getting
**[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Project 'org.apache.oozie:oozie-hadoop' is duplicated in the reactor
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Fri May 02 15:49:31 IST 2014
[INFO] Final Memory: 5M/117M
[INFO] ------------------------------------------------------------------------
ERROR, Oozie distro creation failed.**
The system requirements specify the necessary version:
Maven 3.0.1+
The mailing list confirms this:
Maven 3 is required for oozie 3.2.

maven tomcat7:shutdown

I start my application using mvn tomcat7:run and its working but when I use mvn tomcat7:shutdown to stop it its showing build success but the embedded tomcat is not shutting down
I get this result
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.xxx.yy.ci:ci:war:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found d
uplicate declaration of plugin org.apache.maven.plugins:maven-dependency-plugin
# line 95, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CI Web Application 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- tomcat7-maven-plugin:2.0:shutdown (default-cli) # ci ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.391s
[INFO] Finished at: Wed Apr 10 14:32:04 IST 2013
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
Any help appreciated!
mvn tomcat7:run need to use ctrl+c to shutdown as it's attached to the current maven run.
So you don't need to use shutdown goal.
Maybe I miss something ?

Unable to find the mojo 'generate-sources'

When I try to install playn, I get that :
[INFO] ------------------------------------------------------------------------
[INFO] Building PlayN Tests Android
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [enforcer:enforce {execution: enforce-maven}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources': Unable to find the mojo 'generate-sources' (or one of its required components) in the plugin 'com.jayway.maven.plugins.android.generation2:android-maven-plugin'
Component descriptor cannot be found in the component repository: org.sonatype.aether.RepositorySystem.
The error is caused by using Maven 2 when you need to be using Maven 3.

Resources