|
| 1 | +--- |
| 2 | +{ |
| 3 | +"title": "How to deploy to Maven Central Repository", |
| 4 | +"language": "en" |
| 5 | +} |
| 6 | +--- |
| 7 | + |
| 8 | +<!-- |
| 9 | +Licensed to the Apache Software Foundation (ASF) under one |
| 10 | +or more contributor license agreements. See the NOTICE file |
| 11 | +distributed with this work for additional information |
| 12 | +regarding copyright ownership. The ASF licenses this file |
| 13 | +to you under the Apache License, Version 2.0 (the |
| 14 | +"License"); you may not use this file except in compliance |
| 15 | +with the License. You may obtain a copy of the License at |
| 16 | +
|
| 17 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 18 | +
|
| 19 | +Unless required by applicable law or agreed to in writing, |
| 20 | +software distributed under the License is distributed on an |
| 21 | +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 22 | +KIND, either express or implied. See the License for the |
| 23 | +specific language governing permissions and limitations |
| 24 | +under the License. |
| 25 | +--> |
| 26 | + |
| 27 | +## Prepare |
| 28 | + |
| 29 | +### 0. Requirements |
| 30 | + |
| 31 | +1. apache account ID |
| 32 | +2. apache password |
| 33 | +3. gpg key |
| 34 | + |
| 35 | +### 1. Prepare the local maven environment |
| 36 | + |
| 37 | +1. Generate the master password: `mvn --encrypt-master-password <password>` This password is only used to encrypt other subsequent passwords, and the output is similar to `{VSb+6+76djkH/43...}` and then create` ~/.m2/settings-security.xml` file, the content is |
| 38 | + |
| 39 | + ``` |
| 40 | + <settingsSecurity> |
| 41 | + <master>{VSb+6+76djkH/43...}</master> |
| 42 | + </settingsSecurity> |
| 43 | + ``` |
| 44 | + |
| 45 | +2. Encrypt apache password: `mvn --encrypt-password <password>` This password is the password of the apache account. The output is similar to the above `{GRKbCylpwysHfV...}` and added in `~/.m2/settings.xml` |
| 46 | + ``` |
| 47 | + <servers> |
| 48 | + <!-- To publish a snapshot of your project --> |
| 49 | + <server> |
| 50 | + <id>apache.snapshots.https</id> |
| 51 | + <username>yangzhg</username> |
| 52 | + <password>{GRKbCylpwysHfV...}</password> |
| 53 | + </server> |
| 54 | + <!-- To stage a release of your project --> |
| 55 | + <server> |
| 56 | + <id>apache.releases.https</id> |
| 57 | + <username>yangzhg</username> |
| 58 | + <password>{GRKbCylpwysHfV...}</password> |
| 59 | + </server> |
| 60 | + </servers> |
| 61 | + ``` |
| 62 | + |
| 63 | +3. Optional, (you can also pass -Darguments="-Dgpg.passphrase=xxxx" during deployment), add the following content in `~/.m2/settings.xml`, if the profiles tag already exists, this is only required Just add profile to profiles, activeProfiles is the same as above, xxxx is the passphrase of the gpg key |
| 64 | + ``` |
| 65 | + <profiles> |
| 66 | + <profile> |
| 67 | + <id>gpg</id> |
| 68 | + <properties> |
| 69 | + <gpg.executable>gpg</gpg.executable> |
| 70 | + <gpg.passphrase>xxxx</gpg.passphrase> |
| 71 | + </properties> |
| 72 | + </profile> |
| 73 | + </profiles> |
| 74 | + <activeProfiles> |
| 75 | + <activeProfile>gpg</activeProfile> |
| 76 | + </activeProfiles> |
| 77 | + ``` |
| 78 | +### Publish to SNAPSHOT |
| 79 | +### 1. Deploy flink connector |
| 80 | + |
| 81 | +Switch to the flink connector directory, let’s take flink version 1.11.6 and scalar 2.12 as examples |
| 82 | + |
| 83 | + ``` |
| 84 | + cd incubator-doris/extension/flink-doris-connector |
| 85 | + export DORIS_HOME=$PWD/../../ |
| 86 | + source ${DORIS_HOME}/env.sh |
| 87 | + if [ -f ${DORIS_HOME}/custom_env.sh ]; then source ${DORIS_HOME}/custom_env.sh; fi |
| 88 | + export FLINK_VERSION="1.11.6" |
| 89 | + export SCALA_VERSION="2.12" |
| 90 | + mvn deploy |
| 91 | + ``` |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +### 2. Deploy Spark connector |
| 96 | + |
| 97 | +Switch to the spark connector directory, let’s take spark version 2.3.4 and scalar 2.11 as examples |
| 98 | + |
| 99 | + ``` |
| 100 | + cd incubator-doris/extension/spark-doris-connector |
| 101 | + export DORIS_HOME=$PWD/../../ |
| 102 | + source ${DORIS_HOME}/env.sh |
| 103 | + if [ -f ${DORIS_HOME}/custom_env.sh ]; then source ${DORIS_HOME}/custom_env.sh; fi |
| 104 | + export SPARK_VERSION="2.3.4" |
| 105 | + export SCALA_VERSION="2.11" |
| 106 | + mvn deploy |
| 107 | + ``` |
0 commit comments