笔记_maven 学习

1.maven 的安装

1.1 ieada 自带了的对应的maven工程定义的代码,新建maven 工程,就可以切换到对应的Maven 工程

视图,就可以对ieda中的操作进行对应的视图操作了。

1.2 需要安装命令行的

首先要配置的java _home jdk 变量。

一定要先先配置 java_homne.在配置maven 可能会出现。并非jre 的问题。或者直接打开对应的试图即可/

2.maven 的编译

2.1 使用内置的IDE ,注意这里需要更改对应的setting.xml 文件,

3.maven 的安装,测试,打包:

4.maven 的生命周期

5.maven 的部署

6.上传到私服

贴上私服代码,nesux代码:

<repositories>
    <repository>
        <id>moku-nexus</id>
        <name>Mokucloud.com Nexus</name>
        <url>http://10.0.1.65:8081/nexus/content/groups/public/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>moku-nexus-snapshots</id>
        <name>Mokucloud.com Nexus Snapshots</name>
        <url>http://10.0.1.65:8081/nexus/content/repositories/snapshots/</url>
        <layout>default</layout>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>

</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>central</id>
        <name>Central Repository</name>
        <url>http://10.0.1.65:8081/nexus/content/repositories/central/</url>
        <layout>default</layout>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <updatePolicy>never</updatePolicy>
        </releases>
    </pluginRepository>
</pluginRepositories>

<distributionManagement>
    <snapshotRepository>
        <id>moku-nexus-snapshots</id>
        <name>nexus distribution snapshot repository</name>
        <url>http://10.0.1.65:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
        <id>moku-nexus-releases</id>
        <name>nexus distribution repository</name>
        <url>http://10.0.1.65:8081/nexus/content/repositories/releases/</url>
    </repository>
</distributionManagement>

在这里出现了401错误,鉴权失败,找到对应的maven ,IDE 要找到对应的目录,maven 要找到安装路径,

conf 增加密码文件配置即可。

运行结果:

参考资料:

 https://www.w3cschool.cn/maven/

https://www.cnblogs.com/wql025/p/5215570.html

给出测试demo:

maven 测试代码

猜你喜欢

转载自blog.csdn.net/xiamaocheng/article/details/83148915