LoginSignup
1
3

More than 5 years have passed since last update.

[Java][Maven] 3rdパーティのjarファイルをローカルレポジトリへ登録するpom.xmlの雛形

Last updated at Posted at 2017-07-05

Mavenレポジトリにない野良(?)jarファイルを、ローカルのレポジトリに登録するときに使うpom.xmlファイルの雛形です。

pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId><!-- TODO:適当に --></groupId>
    <artifactId><!-- TODO:適当に --></artifactId>
    <version><!-- TODO:適当に --></version>
    <packaging>pom</packaging>
    <properties>
        <groupId><!-- TODO:登録したいgroupIdに置き換え -->p</groupId>
        <artifactId><!-- TODO:登録したいartifactIdに置き換え --></artifactId>
        <version><!-- TODO:登録したいversionに置き換え --></version>
        <packaging>jar</packaging>
        <file><!-- TODO:jarファイルの名前に置き換え --></file>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
                <executions>
                    <execution>
                        <id>default-install</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>install-file</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

まいどまいどmvnコマンドのinstall:install-fileターゲットの使い方をぐぐるのは面倒

グループメンバーにコマンド教えるのも面倒

そんなときに使ってください。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3