install a external jar to local repository according to maven's official tutorial,but failed - maven

the command I used(according to maven's official tutorial:maven):
mvn install:install-file -Dfile=algs4-1.0.4.jar -DgroupID=edu.princeton.cs -DartifactID=algs4 -Dversion=1.0.4 -Dpackaging=jar
the error info told groupID and artifactID are missing,so I try to modify the command:
mvn install:install-file -Dfile=algs4-1.0.4.jar -groupID=edu.princeton.cs -artifactID=algs4 -Dversion=1.0.4 -Dpackaging=jar
you know,that's even worse.
I also try some solution from some answers here,they don't work either.
expected result is,you know,install the jar.
actual results is:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) # standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.460 s
[INFO] Finished at: 2019-04-09T00:23:39+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: The artifact information is incomplete or not valid:
[ERROR] [0] 'groupId' is missing.
[ERROR] [1] 'artifactId' is missing.
[ERROR]
[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

You misspelled groupId and artifactId as groupID and artifactID.

Related

CodeHaus Maven JAXB2 plugin error MojoExecutionException: NoSchemasException

I am trying to build my project ,in that i got error called [ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.4:xjc (One) on project tg-tg-tems-ota-common-service: : MojoExecutionException: NoSchemasException -> [Help 1]
we are using java8 ,apache maven 3.6.3 ,jaxb2 plugin 2.4
Please find below error
INFO] Building TravelGrid-Tems-Ota-Service 3.0.0-SNAPSHOT [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # tg-tg-tems-ota-common-service ---
[INFO]
[INFO] --- jaxb2-maven-plugin:2.4:xjc (One) # tg-tg-tems-ota-common-service ---
[INFO] Created EpisodePath [D:\Sushma_Project\TG_UPGRADATION\Project\branches\3.0.0-SNAPSHOT\tems\tg-tems-servicelayer\tg-tems-ota-common-service\target\generated-sources\jaxb\emt\hotelSearchRequest\META-INF\JAXB]: true
[INFO] Ignored given or default xjbSources [D:\Sushma_Project\TG_UPGRADATION\Project\branches\3.0.0-SNAPSHOT\tems\tg-tems-servicelayer\tg-tems-ota-common-service\src\main\xjb], since it is not an existent file or directory.
[INFO] Ignored given or default sources [D:\Sushma_Project\TG_UPGRADATION\Project\branches\3.0.0-SNAPSHOT\tems\tg-tems-servicelayer\tg-tems-ota-common-service\src\main\xsd], since it is not an existent file or directory.
[WARNING] No XSD files found. Please check your plugin configuration.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for tg-servicelayer 3.0.0-SNAPSHOT:
[INFO]
[INFO] tg-servicelayer .................................... SUCCESS [ 0.697 s]
[INFO] TravelGrid-Tems-Ota-Service ........................ FAILURE [ 0.909 s]
[INFO] TravelGrid-Subsystems .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.941 s
[INFO] Finished at: 2020-06-30T15:50:30+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.4:xjc (One) on project tg-tg-tems-ota-common-service: : MojoExecutionException: NoSchemasException -> [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 :tg-tg-tems-ota-common-service
D:\Sushma_Project\TG_UPGRADATION\Project\branches\3.0.0-SNAPSHOT\tems\tg-tems-servicelayer>
I am new to jaxb plugin ,can anyone help me
Please user "mvn clean install" it will clean the target folder and regenerate everything from scratch.

How to prevent Unknown packaging "bundle" error when computing the effective POM

I am reading an effective POM from the command line (using the approach described here: How to specify an artifact in help:effective-pom?)
For the artifact:
<dependency>
<groupId>com.typesafe.scala-logging</groupId>
<artifactId>scala-logging_2.12</artifactId>
<version>3.7.2</version>
</dependency>
Using the command:
mvn help:effective-pom -Dartifact=com.typesafe.scala-logging:scala-logging_2.12:3.7.2
I get this error:
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< mvntmp:mvntmp >----------------------------
[INFO] Building mvntmp 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-help-plugin:3.2.0:effective-pom (default-cli) # mvntmp ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.540 s
[INFO] Finished at: 2020-05-20T15:26:34+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-help-plugin:3.2.0:effective-pom (default-cli) on project mvntmp: Unable to get the POM for the artifact 'com.typesafe.scala-logging:scala-logging_2.12:3.7.2'. Verify the artifact parameter.: Some problems were encountered while processing the POMs:
[ERROR] [ERROR] Unknown packaging: bundle # line 6, column 16: 1 problem was encountered while building the effective model for com.typesafe.scala-logging:scala-logging_2.12:3.7.2
[ERROR] [ERROR] Unknown packaging: bundle # line 6, column 16
[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

No pom found while creating new project from archetype

I am trying to execute this :
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple - DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT"
but it shows this error:
C:\TPMaven>mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple - DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.090 s
[INFO] Finished at: 2015-04-20T17:28:05+00:00
[INFO] Final Memory: 5M/108M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\TPMaven). Please verify you invoked Maven from the correct directory. -> [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]
What's wrong with my maven statement?
The right code should be:
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple -DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
If you use Win, running the code above in cmd.exe is ok.
If you run the code in PowerShell, please use the code below:
mvn archetype:generate "-DgroupId=org.sonatype.mavenbook.simple" "-DartifactId=simple" "-DpackageName=org.sonatype.mavenbook" "-Dversion=1.0-SNAPSHOT"
There are two errors in your code:
mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple - DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT"
- DpackageName
should be
-DpackageName
-Dversion=1.0-SNAPSHOT"
should be
-Dversion=1.0-SNAPSHOT
There is a space in between one of your command line arguments. Running your command:
acanby#PANAMERA /c/projects/mvntest $ mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple - DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.072 s
[INFO] Finished at: 2015-04-21T15:20:41+10:00
[INFO] Final Memory: 5M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (c:\projects\mvntest). Please verify you invoked Maven from the correct directory
. -> [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/MissingProjectException
Fixing the - DpackageName=... part to -DpackageName=...:
acanby#host /c/projects/mvntest$ mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple -DpackageName=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) # standalone-pom ---
[INFO] Generating project in Interactive mode

Install Maven jar with pom into local repository

I have an old jar (jsf-api-2.0.2.jar). In this jar there is a /META-INF/maven-Folder.
How do I install the jar into my local repository?
install:install-file says I need to specify the artifactId myself. How do I force it to use the information in jsf-api-2.0.2.jar!\META-INF\maven\com.sun.faces\jsf-api\pom.xml?
Output:
mvn install:install-file -Dfile=jsf-api-2.0.2.jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) # standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.410s
[INFO] Finished at: Sat Feb 01 12:52:34 CET 2014
[INFO] Final Memory: 13M/368M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default cli) on project standalone-pom: The artifact information is incomplete or not valid:
[ERROR] [0] 'groupId' is missing.
[ERROR] [1] 'artifactId' is missing.
[ERROR] [2] 'packaging' is missing.
[ERROR] [3] 'version' is missing.
[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
See http://maven.apache.org/plugins/maven-install-plugin/examples/custom-pom-installation.html
Just ensure you're using at least version 2.5, which introduced this feature.
And by the way: the goal is install-file, not install-jar

Maven - issue running mvn help:effective-pom

I am working through a basic Maven tutorial, and managed to create a simple archetype and run a mvn install. However, when trying to do a mvn help:effective-pom, I just seem to get this output:
mvn help:effective-pom [INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building simple 1.0-SNAPSHOT [INFO]
------------------------------------------------------------------------ [INFO] [INFO] --- maven-help-plugin:2.2:effective-pom (default-cli) #
simple --- Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 0.925s [INFO] Finished at: Mon May 13 21:41:09 BST
2013 [INFO] Final Memory: 9M/131M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-help-plugin:2.2:effective-pom
(default-cli) on project simple: Execution default-cli of goal
org.apache.maven.plugins:maven-help-plugin:2.2:effective-pom failed:
Plugin org.apache.maven.plugins:maven-help-plugin:2.2 or one of its
dependencies could not be resolved: Failed to collect dependencies for
org.apache.maven.plugins:maven-help-plugin:jar:2.2 (): Failed to read
artifact descriptor for
org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1: Could
not transfer artifact
org.apache.maven:maven-plugin-parameter-documenter:pom:2.2.1 from/to
central (http://repo1.maven.org/maven2): Access denied to:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
-> [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/PluginResolutionException
not much hope for me if I cant get past "Hello World" example...any advice appreciated.
Regards
i
One of your network components blocks access to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom, that's all.

Resources