美文网首页IntelliJ Idea
mac上的Idea maven项目迁移到win10

mac上的Idea maven项目迁移到win10

作者: Jefitar | 来源:发表于2018-09-16 22:50 被阅读79次

    以 BayesPro 项目为例。

    1. mac上的Idea maven项目结构

    BayesPro Strcture.png

    可以看出,maven依赖配置文件 pom.xml 位于项目的根目录。
    打包项目,生成 BayesPro.zip,拷贝至 windows 10,解压:


    bayes.png

    2. 解压后目录结构分析

    BayesPro.png

    BayesPro目录下,多了一个 _MACOSX目录,与之平行的BayesPro才是真正的BayesPro项目目录,如下图所示:


    BayesPro/ByaesPro.png

    2. 迁移

    2.1. Windows上打开 Idea,点击“Import Project”

    import project.png

    如果打开Idea后,自动打开了一个项目,可以“File->New->Project from Existing Sources... ”:


    import project.png

    2.2. 选择源码目录(目录2):

    select directory.png

    2.3. 选择 maven

    image.png

    点击 next:


    image.png

    2.4. 选择待导入的maven项目

    image.png

    如果在2.2中选择了目录1,执行到本步骤时,会出现如下提示(没发现maven项目):


    nothing to show.png

    2.5. 选择SDK

    select project SDK.png

    这里选择了 JDK 9,因为 mac上的项目也是选择的 JDK 9。

    2.6. 设置项目路径和项目名

    image.png

    点击finish,提示输入的路径不存在,将由idea创建:


    image.png

    点击 ok。
    稍等片刻,等待resolve和index完成,如下图所示,项目成功导入:


    image.png
    如果没有上图红框中的maven依赖,则需要在terminal中,执行mvn install:
    image.png

    相关文章

      网友评论

        本文标题:mac上的Idea maven项目迁移到win10

        本文链接:https://www.haomeiwen.com/subject/egixnftx.html