Java – how to set up the Use the user name and password in the factory Maven plugin in XML?

Here is a configuration example of the factory Maven plugin:

<build>
    <plugins>
        ...
        <plugin>
            <groupId>org.jfrog.buildinfo</groupId>
            <artifactId>artifactory-maven-plugin</artifactId>
            <version>2.6.1</version>
            <inherited>false</inherited>
            <executions>
                <execution>
                    <id>build-info</id>
                    <goals>
                        <goal>publish</goal>
                    </goals>
                    <configuration>
                        <deployProperties>
                            <gradle>awesome</gradle>
                            <review.team>qa</review.team>
                        </deployProperties>
                        <publisher>
                            <contextUrl>https://oss.jfrog.org</contextUrl>
                            <username>deployer</username>
                            <password>{DESede}...</password>
                            <repoKey>libs-release-local</repoKey>
                            <snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
                        </publisher>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

In this case, I have to manually set contexturl, username and password Although the standard Maven deployment plug-in uses from setting XML parameters (like that):

<servers>
  <server>
    <username>username</username>
    <id>server-id</id>
    <password>pass</password>
  </server>
</servers>

Why does jfrom not use from setting XML username, URL,..., etc? Is there a way to specify only the server ID without pass and username?

Of course, someone can define attributes in the setup XML and use them in the plug-in definition, but in this case, these attributes can be easily shared with all projects and output to the console by anyone during third-party construction

<properties>
   <username></username>
</properties>

Solution

Official documentation actually proposes a different approach:

Therefore, the reference settings. Is not actually implemented The expected function of the server identity defined in XML

Note on the one hand: in order to implement good practice, the Maven repository deployment should be performed automatically by the continuous integration server (i.e. Jenkins) In this case, the artifact plugin of CI server (i.e. artifact Jenkins plugin) will handle it in a safe way, centralizing this mechanism in only one place (CI server), so as to avoid accidental operations from local machines after user management and governance Things that might otherwise go wrong (published from the local machine):

>The code may not be aligned under version control, and it is more difficult to solve the artifact problem in release > the test may have been skipped, and potential errors may be released > build may only be reproduced on this computer, and non reconfigurable artifacts may be released

Put it in POM XML may indeed be exposed to the above problems in some way (some people in the team may trigger it by mistake), and automated processes and gates will ensure certain steps

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>