V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nutting
V2EX  ›  程序员

pom 私有库迁移?

  •  
  •   nutting · 2020-11-30 09:31:55 +08:00 · 1926 次点击
    这是一个创建于 1214 天前的主题,其中的信息可能已经有所发展或是发生改变。
    现在项目换到另一个系统的内网,他有很多公共包,这个不是问题,但是私有包需要一个个手动上传吗。最关键的是,现在的项目有个 parent 依赖,我搞了半天也不行
    5 条回复    2020-11-30 13:43:22 +08:00
    nutting
        1
    nutting  
    OP
       2020-11-30 09:49:22 +08:00
    parent 里还有 parent,很多级
    RagingSweet
        2
    RagingSweet  
       2020-11-30 10:32:16 +08:00   ❤️ 1
    ali 有个 maven 私库批量迁移工具,migrate-local-repo-tool.jar ,可以试试,挺好用的
    cs419
        3
    cs419  
       2020-11-30 11:10:00 +08:00
    不一定要放仓库 也可以是本地文件

    方案 1
    ```
    <dependency>
    <groupId>fluffy.mo</groupId>
    <artifactId>hello</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/world.jar</systemPath>
    </dependency>
    ```

    方案 2
    ```
    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
    <compilerArguments>
    <extdirs>src\main\webapp\WEB-INF\lib</extdirs>
    </compilerArguments>
    </configuration>
    </plugin>
    </plugins>
    </build>
    ```
    bianjp
        4
    bianjp  
       2020-11-30 12:46:25 +08:00
    如果 Maven 私服使用的是 Nexus OSS, 那么它支持导入 Maven 仓库: https://help.sonatype.com/repomanager3/system-configuration/tasks/repository-import
    zhangsen1992
        5
    zhangsen1992  
       2020-11-30 13:43:22 +08:00
    nexus 有批量导入
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   945 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 21:23 · PVG 05:23 · LAX 14:23 · JFK 17:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.