`
chenqi210
  • 浏览: 76983 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

不让archiva 2.1.1在${user.home}/.m2下自动生成archiva.xml的解决方法

 
阅读更多

  目前apache archiva的最新稳定版已经到了2.1.1. 相比1.3.x版本来说,界面看起来更卡通了一些,也加上了大量的ajax。不知道这样是好还是不好。反正对于纯文本之类的w3m来说,肯定是件坏事。

  这个版本的archiva有个毛病,会自作主张地在${user.home}/.m2/下面产生一个archiva.xml,而不管你是否在安装目录下面已经预置了一个archiva.xml. 而这样会影响到老版本的archiva.一般情况下如果是用的standalone安装文件,那么它是不会这么去做的。因为archiva读取archiva.xml的优先顺序是

http://archiva.apache.org/docs/1.3.6/adminguide/standalone.html 写道
Configuring Archiva

Archiva's configuration is loaded from the following files, in order of most precedent:

~/.m2/archiva.xml
$ARCHIVA_BASE/conf/archiva.xml
conf/archiva.xml in the Archiva installation

When Archiva saves it's configuration, all configuration is stored to a single file. The file chosen is by the following rules:

If ~/.m2/archiva.xml exists, it is saved there
Otherwise, if $ARCHIVA_BASE/conf/archiva.xml exists, it is saved there
If neither apply, it is saved to ~/.m2/archiva.xml.

The configuration will never be saved in the Archiva installation directory if you are using a separate base directory.

Note that the configuration can be edited, but only when Archiva is not running as it will not reload a changed configuration file, and will save over it if something is changed in the web interface.

 

  所以,在${user.home}/.m2下生成的archiva.xml会把其他的以standalone方式安装的archiva的配置搅乱。在仔细对比文件之后发现1.3.6和1.3.9下面都有一个application.xml的配置文件,如下:

 

./apache-archiva-1.3.6/apps/archiva/WEB-INF/classes/META-INF/plexus/application.xml
./apache-archiva-1.3.9/apps/archiva/WEB-INF/classes/META-INF/plexus/application.xml

       但是2.1.1下面却没有这个文件。把这个文件也拷贝过来。例如:

./apache-archiva-2.1.1/apps/archiva/WEB-INF/classes/META-INF/application.xml

     删掉已经生成的archiva.xml,再测试,发现确实就不再生成archiva.xml了。虽然放的目录少了一截plexus,但是也能正常工作。

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics