maven-本地安装jar包

Posted luohaonan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven-本地安装jar包相关的知识,希望对你有一定的参考价值。

maven 安装本地jar包,通过install插件的install-file mojo进行工作,具体可通过如下命令进行查看

mvn help:describe -Dplugin=install -Ddetail

 

 

 

下面是一个实例:

mvn install:install-file -Dfile=X:/core-3.3.1-SNAPSHOT.jar -DgroupId=com.google.zxing -DartifactId=zxing-parent -Dversion=3.3.1-SNAPSHOT -Dpackaging=jar

 

 

 

 

下面是我运行的部分相关的结果:

install:install-file
  Description: Installs a file in the local repository.
  Implementation: org.apache.maven.plugin.install.InstallFileMojo
  Language: java

  Available parameters:

    artifactId
      User property: artifactId
      ArtifactId of the artifact to be installed. Retrieved from POM file if
      one is specified.

    classifier
      User property: classifier
      Classifier type of the artifact to be installed. For example, sources
      or javadoc. Defaults to none which means this is the projects main
      artifact.

    createChecksum (Default: false)
      User property: createChecksum
      Flag whether to create checksums (MD5, SHA-1) or not.

    file
      Required: true
      User property: file
      The file to be installed in the local repository.

    generatePom
      User property: generatePom
      Generate a minimal POM for the artifact if none is supplied via the
      parameter pomFile. Defaults to true if there is no existing POM in the
      local repository yet.

    groupId
      User property: groupId
      GroupId of the artifact to be installed. Retrieved from POM file if one
      is specified.

    javadoc
      User property: javadoc
      The bundled API docs for the artifact.

    localRepositoryPath
      User property: localRepositoryPath
      The path for a specific local repository directory. If not specified the
      local repository path configured in the Maven settings will be used.

    packaging
      User property: packaging
      Packaging type of the artifact to be installed. Retrieved from POM file
      if one is specified.

    pomFile
      User property: pomFile
      Location of an existing POM file to be installed alongside the main
      artifact, given by the file parameter.

    repositoryLayout (Default: default)
      Required: true
      User property: repositoryLayout
      The type of remote repository layout to install to. Try legacy for a
      Maven 1.x-style repository layout.

    sources
      User property: sources
      The bundled sources for the artifact.

    updateReleaseInfo (Default: false)
      User property: updateReleaseInfo
      Whether to update the metadata to make the artifact a release version.

    version
      User property: version
      Version of the artifact to be installed. Retrieved from POM file if one
      is specified.

 

以上是关于maven-本地安装jar包的主要内容,如果未能解决你的问题,请参考以下文章

如何在maven中添加本地jar包

maven-本地安装jar包

Maven将本地jar包安装到仓库

Maven 将远程仓库jar包安装至本地仓库

Maven 将远程仓库jar包安装至本地仓库

Maven 将远程仓库jar包安装至本地仓库