zoukankan      html  css  js  c++  java
  • maven引入本地包

    使用maven-install-plugin

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>

    实例:

    在maven工程根目录新建lib文件夹,里头有个demo.jar纳入管理

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                    <executions>
                        <execution>
                            <id>install-demo-jar</id>
                            <phase>clean</phase>
                            <configuration>
                                <repositoryLayout>default</repositoryLayout>
                                <groupId>com.example</groupId>
                                <artifactId>demojar</artifactId>
                                <version>1.0.0</version>
                                <file>${project.basedir}/lib/demo.jar</file>
                                <packaging>jar</packaging>
                                <generatePom>true</generatePom>
                            </configuration>
                            <goals>
                                <goal>install-file</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

    安装

    mvn clean install(eclipse clean)

    添加依赖

            <dependency>
                <groupId>com.example</groupId>
                <artifactId>demojar</artifactId>
                <version>1.0.0</version>
            </dependency>

    这样就大功告成了,可以打成fat jar

  • 相关阅读:
    BZOJ3439: Kpm的MC密码
    BZOJ2819: Nim
    BZOJ1901: Zju2112 Dynamic Rankings
    Bzoj3230: 相似子串
    Bzoj4504: K个串
    CF609E. Minimum spanning tree for each edge
    bzoj1832: [AHOI2008]聚会
    css 笔记1
    namespace 相关
    cmd 命令
  • 原文地址:https://www.cnblogs.com/JAYIT/p/13139785.html
Copyright © 2011-2022 走看看