发生了蚂蚁的构建感应:HTTP授权失败



我正在使用maven-antrun-plugin下载JRE。如果我的配置为

,我可以下载
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>artifactory-jre</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <!-- download file -->
                                <get src="${download.url}/${download.file}${download.filePostfix}"
                                     dest="${project.build.directory}/${download.file}${download.filePostfix}"
                                     verbose="true"
                                     usetimestamp="true"
                                     username="user"
                                     password="password123"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

但我不想在pom文件中提供usernamepassword,我尝试在settings.xml中添加服务器条目,例如

   <server>
      <username>user</username>
      <password>password123</password>
      <id>artifactory-jre</id>
    </server>

但我正在遵循异常。

[错误]无法执行目标org.apache.maven.plugins:maven-antrun-plugin:1.8:run(artifactory-jre(project name.abuchen.zulu.zulu.jre.jre.jre.win32.x86_64:a发生了蚂蚁的构建感应:HTTP授权失败[错误]在ant零件周围...... @ 4:315 in C: users downloads bundled-jre-master bundled-jre-master bundles bundles name.abuchen.zulu.jre.jre.win32.x86_64 target antrun build-main.xml

如何在不提供pom文件中提供的ant中提供用户名和密码。

用于解决方案。我在setting.xml中创建了属性,并在pom.xml

中使用了该属性

我的设置.xml看起来像

<properties>
<user>user_name</user>
<password>my_password</password>
</properties>

pom.xml中,我将此属性用作其他任何属性。

最新更新