Maven localhost上的Sonatype Nexus服务器不';t缓存工件
我已经在64位本地主机Windows上安装了nexus-2.11。我正在Eclipse中通过ant任务在Maven localhost上的Sonatype Nexus服务器不';t缓存工件,maven,nexus,Maven,Nexus,我已经在64位本地主机Windows上安装了nexus-2.11。我正在Eclipse中通过ant任务在build.xml中运行mvn。我已将.m2/settings.xml中的nexus服务器设置为主镜像: <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://localhost:8081/nexus/content/gro
build.xml
中运行mvn
。我已将.m2/settings.xml
中的nexus服务器设置为主镜像:
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public/</url>
</mirror>
关系
*
http://localhost:8081/nexus/content/groups/public/
运行mvn
命令时,将解析依赖项,并在日志中显示它们是从Nexus服务器下载的。问题在于Nexus缓存:Nexus不缓存任何东西。我的意思是sonatype work
文件夹是空的,所有工件都在.m2
中
登录管理面板,我可以看到工件的完整索引,但是sonatypework
中没有jar文件或元数据。(下载所有工件后,我想将sonatype work
的内容放入主服务器,因为安全原因,主服务器处于脱机状态。)
这可能是什么原因造成的?您是否在
settings.xml
的profiles
部分插入了类似的内容
<profile>
<id>company-nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url> <!-- use a not existing URL!! -->
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
公司关系
中心的
http://central
真的
真的
中心的
http://central
真的
真的
这会导致maven查看
镜像
定义。您是否在设置.xml的配置文件
部分插入了类似的内容
<profile>
<id>company-nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url> <!-- use a not existing URL!! -->
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
公司关系
中心的
http://central
真的
真的
中心的
http://central
真的
真的
这会导致maven查看镜像
定义。根据sonatype work/README.txt
,我将环境变量PLEXUS\u NEXUS\u work
设置为sonatype work
的路径,然后,NEXUS开始缓存到工作文件夹中
可以使用环境变量覆盖各个工作文件夹的位置。例如,可以使用PLEXUS_Nexus_work定义Nexus工作位置。如果未定义,则使用此默认值
根据sonatype work/README.txt
,我将环境变量PLEXUS\u NEXUS\u work
设置为sonatype work
的路径,然后,NEXUS开始缓存到工作文件夹中
可以使用环境变量覆盖各个工作文件夹的位置。例如,可以使用PLEXUS_Nexus_work定义Nexus工作位置。如果未定义,则使用此默认值
是的。像下载这样的消息:http://localhost:8081/nexus/content/groups/public/...
在运行命令时显示。所以,它确实看了镜子的定义。是的,我看了。像下载这样的消息:http://localhost:8081/nexus/content/groups/public/...
在运行命令时显示。因此,它确实查看了镜像定义。Nexus进程(我相信是Jetty)是否具有对文件夹sonatype work
的写访问权限?是的。我还尝试以管理员身份运行它,甚至移动到另一个驱动器。Nexus进程(我相信Jetty)是否具有对文件夹的写入权限sonatype work
?是的。我还尝试以管理员身份运行它,甚至转移到另一个驱动器。