idea 创建mvn 骨架 并导入到nexus私服中
一、 安装nexus 2.X版本私服,
1. 下载安装包: https://help.sonatype.com/repomanager2/download 自行下载。
2. 安装nexus: 解压后,* / nexus-2.14.10-01-bundle\nexus-2.14.10-01\bin\jsw
3. 设置mvn setting.xml
4. idea 创建mvn骨架项目
pom文件导入插件:
<build> <extensions> <extension> <groupId>org.apache.maven.archetype</groupId> <artifactId>archetype-packaging</artifactId> <version>2.2</version> </extension> </extensions> <pluginManagement> <plugins> <plugin> <artifactId>maven-archetype-plugin</artifactId> <version>2.2</version> </plugin> </plugins> </pluginManagement> </build>
5. 在项目根目录 执行:mvn archetype:create-from-project
生成图片所示内容
6. 编辑上图中pom.xml 注意:上图中的pom文件。
<distributionManagement> <repository> <id>nexus-releases</id> <name>Micaicms Releases</name> <url>http://localhost:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Micaicms Releases</name> <url>http://localhost:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
注意:此处id 要和setting.xml 中对应。上传nexus私服需要密码。
7. 上图archetype目录作为目标目录,执行mvn deploy 命令
8. 关闭 idea
9. 在项目根目录 执行:mvn archetype:update-local-catalog
10 . 启动myeclipse
11. 通过浏览器 输入:localhost:8081 可以查看nexus私服