`
adapterofcoms
  • 浏览: 72293 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

Eclipse&Maven&Nexus

 
阅读更多

 

Nexus2:
nexus\bin\jsw\windows-x86-64\install-nexus   #install it to Wndows Service.

nexus3 oss:
https://www.sonatype.com/download-oss-sonatype
http://blog.csdn.net/rekadowney/article/details/52492587
http://blog.csdn.net/qq250782929/article/details/51605965

 

nexus-default.properties

nexus /install /uninstall /run

 

目前较快的maven镜像:

http://central.maven.org/maven2/ http://repo1.maven.org/maven2/  #中有.index目录:nexus-maven-repository-index.gz nexus-maven-repository-index.properties

快速的获取nexus-maven-repository-index.gz和nexus-maven-repository-index.properties的方法:先下载这2个文件,再copy到Tomcat ROOT 构建maven2/.index目录(win下尝试在cmd下mkdir),并修改到80端口。

修改 Remote Storage Location : http://127.0.0.1/maven2

update index , eclipse rebuild index

右键central repository

switch Allow Proxy / Block Proxy


如果setting.xml中指定的中央仓库为nexus/content/groups/public,在nexus中就应对相应的Public Repositories进行repair index, 如果只对nexus中的Central做repair index,那么eclipse中的maven index不能更新。

index updating:
首先对nexus中setting.xml中指定的中央仓库进行update index,然后对eclipse中的Global Repositories中的中央仓库Rebuild Index即可。

 

#ref--> http://blog.163.com/benbenfafa_88/blog/static/6493016220130451915187/

1.在Maven setting.xml文件中配置Nexus仓库,profile mirror  ?
本地仓库 >profile > pom中的repository > mirror 但是如果<mirrorOf>*</mirrorOf>,maven会忽略掉其他设置的各种类型仓库,只在mirror里面找。
中央仓库(central,Central Repository), 中央仓库是maven核心自带的远程仓库,默认url在 MAVEN_HOME/lib/maven-model-builder-3.X.jar,
org/apache/maven/model/pom-4.0.0.xml  -->
<repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>
  <build>
    <directory>${project.basedir}/target</directory>
    。。。。。。

e.g:【<dependency>
    <groupId>xxx</groupId>
    <artifactId>xxx</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/xxx.jar</systemPath>
</dependency>】
在setting.xml中:
<mirror> 
        <id>nexus</id> 
        <name>Nexus Public Mirror</name> 
        <url>http://localhost:8081/nexus/content/groups/public</url> 
        <mirrorOf>central</mirrorOf><!--override the default central repository[https://repo.maven.apache.org/maven2]-->
    </mirror>

project's pom.xml中的repositories只是补充central repository而非替代!

 

2.Hosted upload ?   部署构件到Nexus仓库?

 <distributionManagement>
    <repository>
        <id>releases</id>
        <name>Releases</name>
        <url>http://192.168.0.21:8081/nexus/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
        <id>snapshots</id>
        <name>Snapshots</name>
        <url>http://192.168.0.21:8081/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
</distributionManagement>

Maven:

 M2_HOME

 

 

 

 update project--->.lastUpdated
 针对私服与中央仓库或第三方仓库之间网络传输问题
 Browser Storage--->找到相应的package 先update index,再expire cache

 

Eclipse:

 Maven Preferences-->installations: MAVEN_HOME , User Settings: MAVEN_HOME
pom.xml -->JDK VERSION CFG :
<build>
    <finalName>project name</finalName>
    <plugins> 
      <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <configuration> 
          <source>1.7</source> 
          <target>1.7</target>
          <compilerId>eclipse</compilerId> 默认是javac
        </configuration>
        <dependencies> 
                        <dependency> 
                            <groupId>org.codehaus.plexus</groupId> 
                            <artifactId>plexus-compiler-eclipse</artifactId>  使用eclipse JDT,不兼容的类型,推断类型不符合上限
                            <version>2.6</version> 
                        </dependency> 
           </dependencies> 
      </plugin> 
    </plugins>
  </build>

 Eclipse IDE debug keyboard shortcuts---> F5(进入函数)/F6(下一行)/F7(跳出当前函数)/F8(下一断点)

 

 

 

 

分享到:
评论

相关推荐

    ECLIPSE实现MAVEN项目自动部署NEXUS中

    将Eclise中的Maven工程自动部署到nexus服务器

    nexus-maven-repository-index文件2

    maven官方索引文件包,由于eclipse-maven中rebuild index非常慢,自己下载索引文件,使用tomcat模拟索引服务器,更新索引,共3个包

    nexus-maven-repository-index文件

    maven官方索引文件包,由于eclipse-maven中rebuild index非常慢,自己下载索引文件,使用tomcat模拟索引服务器,更新索引

    maven nexus 安装包.rar

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护仓库中的每个Artifact。Nexus是一套“开箱即用”的系统不...

    解决为什么每次打开Eclipse新的workspace需要更新nexus-maven-repository-index问题

    NULL 博文链接:https://xiaorao.iteye.com/blog/476577

    Myeclipse+maven+nexus且m2eclipse插件带索引的完美组合

    Myeclipse+maven+nexus且m2eclipse插件带索引的完美组合

    Maven入门巨无霸视频教程(2.24G)

    使用Maven核心概念介绍(坐标、依赖、仓库、插件、生命周期等)、Maven与第三方Elicpse整合及如何在Eclipse中使用Maven、什么是私服、Maven为什么使用私服、Maven私服Nexus的安装使用、如何使用Maven构建Web应用、使用...

    maven nexus私服

    图文介绍了在windows环境下面使用nexus1.9搭建maven私服,并且在eclipse创建maven项目时使用本地私服与工具包

    Nexus2.7.2-03 + Maven3.1.1 + JAVA Project 管理

    包括: 1 Nexus 研究汇总(概念、作用、安装、管理操作) 2 Maven3 研究汇总(概念、作用、安装、核心流程、生命周期和阶段等核心、实用技术) 3用nexus搭建maven私服 4 eclipse+nexus+maven+JAVA Project管理实战

    nexus-maven-repository-index文件1

    maven官方索引文件包,由于eclipse-maven中rebuild index非常慢,自己下载索引文件,使用tomcat模拟索引服务器,更新索引,共3个包

    maven+j2ee+nexus的搭建

    详细地教你如何用Eclipse搭建Maven2,同时也对私服(nexus)的搭建有详细的说明,一个很好的学习资料。

    maven私服nexus安装配置

    nexus是一个强大的maven仓库管理器,它极大的简化了本地内部仓库的维护和外部仓库的访问. nexus是一套开箱即用的系统不需要数据库,它使用文件系统加Lucene来组织数据 nexus使用ExtJS来开发界面,利用Restlet来...

    Maven3实战视频教程(14集)

    Maven3_03_在eclipse中建立简单的项目 Maven3_04_maven的依赖特性 Maven3_05_maven的聚合和继承 Maven3_06_复习maven的基本内容 Maven3_07_nexus的介绍和安装 Maven3_08_nexus的配置 Maven3_09_发布项目到nexus中 ...

    Maven环境配置

    Maven环境配置包含了Maven的配置,eclipse配置Maven,使用eclipse创建java、javaWeb项目,配置Maven环境Nexus本地仓库环境。

    nexus3.x上传jar包的eclipse插件

    nexus3.x版本取消了jar包上传的功能,命令的方式又太麻烦,所有做了个eclipse的小插件。

    maven服务器---nexus的使用

    本文档为maven使用手册的后续说明,用于介绍maven服务器---nexus的使用(不会使用m2eclipse插件的,建议先参考m2eclipse插件的使用),与前面的文档一样,都配置了详细的图解,基本做到傻瓜式的照着图片做,就能顺利...

    nexus-3.23.0-03-win64.rar-Nexus Repository Oss

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护仓库中的每个Artifact。Nexus是一套“开箱即用”的系统不...

    nexus-2.14.8-01.zip

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护仓库中的每个Artifact。Nexus是一套“开箱即用”的系统不...

    nexus-3.27.0-03-win64.zip

    最新版的maven私服安装包,nexus-3.27.0-03-win64.zip 。Nexus是一个强大的...Nexus 使用ExtJS来开发界面,利用Restlet来提供完整的REST APIs,通过m2eclipse与Eclipse集成使用。Nexus支持WebDAV与LDAP安全身份认证

    nexus-3.31.1-01-win64.zip

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护仓库中的每个Artifact。Nexus是一套“开箱即用”的系统不...

Global site tag (gtag.js) - Google Analytics