Commonly used Maven Repository and encryption configuration

Commonly used Maven Repository

warehouse name Warehouse Address
Maven Central https://repo.maven.apache.org/maven2/
JCenter https://jcenter.bintray.com/
Alibaba Cloud public https://maven.aliyun.com/repository/public
Alibaba cloud google https://maven.aliyun.com/repository/google
Alibaba Cloud Spring https://maven.aliyun.com/repository/spring
Alibaba Cloud grails-core https://maven.aliyun.com/repository/grails-core
Alibaba Cloud mapr-public https://maven.aliyun.com/repository/mapr-public
Oracle https://maven.oracle.com
JBoss https://repository.jboss.org/nexus/content/groups/public/
https://repository.jboss.org/nexus/content/repositories/fs-releases
RedHat https://maven.repository.redhat.com/ga/
http://maven.repository.redhat.com/techpreview/all/
Pentaho http://public.nexus.pentaho.org/content/repositories/pentaho-public-release-repos/
JasperReports CE Releases http://jaspersoft.jfrog.io/jaspersoft/jr-ce-releases
JasperReports thirdparty http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/

Note: Oracle Repository needs to provide an account, and the dependency configuration in POM is as follows:

<dependency>
    <groupId>com.oracle.jdbc</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.4</version>
    <exclusions>
        <exclusion>
            <groupId>*</groupId>
            <artifactId>*</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Maven settings encryption configuration

  1. Create a file settings-security.xml under .m2 to save the master password

Use the following command to generate the master password:

mvn -encrypt-master-password <any_master_password>
或
mvn -emp <any_master_password>

The contents of settings-security.xml are as follows:

<settingsSecurity>
  <master>{By8wW7YcTxAHof0MF4Z3wPKboywhGJvxHD9m0NvHA2U=}</master>
</settingsSecurity>
  1. Configure settings.xml

Use the following command to encrypt the user password:

mvn -encrypt-password <any_master_password>
或
mvn -ep <any_master_password>

Configure users and repository:

<servers>
  <server>
    <id>maven.oracle.com</id>
    <username>[email protected]</username>
    <password>{pnwmhVnzdM8H3UAneUKLmaHGZCoaprbMQ/Ac5UktvsM=}</password>
    <configuration>
      <basicAuthScope>
        <host>ANY</host>
        <port>ANY</port>
        <realm>OAM 11g</realm>
      </basicAuthScope>
      <httpConfiguration>
        <all>
          <params>
            <property>
              <name>http.protocol.allow-circular-redirects</name>
              <value>%b,true</value>
            </property>
          </params>
        </all>
      </httpConfiguration>
    </configuration>
  </server>
</servers>

<profiles>
  <profile>
    <id>main</id>
    <activation>
      <activeByDefault>true</activeByDefault>
    </activation>
    <repositories>
      <repository>
        <id>maven.oracle.com</id>
        <url>https://maven.oracle.com</url>
        <layout>default</layout>
        <releases>
          <enabled>true</enabled>
        </releases>
      </repository>
    </repositories>
  </profile>
</profiles>

参考文档
Get Oracle JDBC drivers and UCP from Oracle Maven Repository
Configuring the Oracle Maven Repository
Oracle Database JDBC driver
Maven Password Encryption

Guess you like

Origin blog.51cto.com/7308310/2643345