Install Maven jar with pom into local repository - maven

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

Related

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

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

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.

The POM for hibernate:hibernate3:jar:3.2.3.GA is missing,

I have this error intalling a maven project:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SpringExample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for hibernate:hibernate3:jar:3.2.3.GA is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.326 s
[INFO] Finished at: 2015-11-17T20:57:54+01:00
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SpringExample: Could not resolve dependencies for project com.mkyong.common:SpringExample:jar:1.0-SNAPSHOT: Failure to find hibernate:hibernate3:jar:3.2.3.GA in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [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/DependencyResolutionException
But I have no idea but to do to fix it ! I've tried all the options !

Error when deploy github site with maven

With this maven pom file : https://gist.github.com/PhilippeGeek/44f62827bf73bc7d9368, I can't create a blob, the output is:
[INFO] ------------------------------------------------------------------------
[INFO] Building SpeleoGraph 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- site-maven-plugin:0.6:site (default-cli) # SpeleoGraph ---
[INFO] Creating 102 blobs
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.270s
[INFO] Finished at: Sat Jul 13 23:48:01 CEST 2013
[INFO] Final Memory: 9M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.6:site (default-cli) on project SpeleoGraph: Error creating blob: Unexpected end of file from server -> [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
This problem come form an out-dated version of site-maven-plugin, you should use version 0.8 or more recent.
This may happen with version 0.8 and 0.9 also, when the binary to be deployed to github is over about 30MB.
Issue on github (see comments)
Reference to a work-around for reducing the size of the binary

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