Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven localhost上的Sonatype Nexus服务器不';t缓存工件_Maven_Nexus - Fatal编程技术网

Maven localhost上的Sonatype Nexus服务器不';t缓存工件

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

我已经在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/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
?是的。我还尝试以管理员身份运行它,甚至转移到另一个驱动器。