Files
wahyd4.github.com/source/_posts/maven-compile-nexus.md
Hermes Bot 232ecd7c22 Rebuild blog source from GitHub Pages artifact
- 308 posts reverse-extracted from wahyd4.github.com (Hexo 6.3.0 + NexT 8.25)
- Hexo project with NexT theme, reading-experience custom styles
- publish-post.sh: write post -> hexo build -> PR (master untouched)
2026-08-04 09:44:07 +10:00

1.3 KiB

title, date, tags
title date tags
使用maven编译Sonatype Nexus源码 2012-07-03 00:00:00
maven
Nexus
github

首先需要使用git客户端从github下载nexus的最新源码:https://github.com/sonatype/nexus

因为nexus本身就是一个非常复杂的maven项目,因为我们只能使用maven来编译。如果我直接编译,nexus就会报各种找不到包的错误。

原因是我们需要把nexus官方的一个仓库加入到maven的settings文件中。代码为:

  
    
      sonatype-forge
      
        
          sonatype-forge
          http://repository.sonatype.org/content/groups/forge/
          
            true
          
          
            true
          
        
      
      
        
          sonatype-forge
          http://repository.sonatype.org/content/groups/forge/
          
            true
          
          
            true
          
        
      
    
  
  
    sonatype-forge
  

然后再次编译,就应该可以构建成功了。由于nexus的仓库在国外,个人感觉速度比maven中央仓库要慢一个等级。在编译过程中,maven会自动执行一些插件和完成相关的单元测试。大概等待1-2个小时左右(由电脑性能和网络决定),就可以编译完成了。