Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact: enhance root pom & sub-modules settings #399

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
* text=auto !eol

# ignored file when package to source.tgz
.gitattributes export-ignore
.gitignore export-ignore
.asf.yaml export-ignore
checkstyle.xml export-ignore
apache-release.sh export-ignore
.licenserc.yaml export-ignore

# ignored directory
.github/ export-ignore
hugegraph-dist/scripts/ export-ignore
# only exclude the root
/assembly/ export-ignore
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ target/
**.db
logs/
ui
node_modules
node_modules/
upload-files/
demo*
gen-java
build

### STS ###
.apt_generated
Expand All @@ -23,7 +22,6 @@ build
.svn

### IntelliJ IDEA ###
.idea
.idea/
*.iws
*.iml
Expand All @@ -32,9 +30,9 @@ build
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
dist/
build/

### VS Code ###
Expand Down Expand Up @@ -76,11 +74,12 @@ yarn-error.log*
*.pyc

# maven ignore
apache-hugegraph-*-incubating-*/
output/
*.war
*.zip
*.tar
*.tar.gz
*.tar.gz*
tree.txt
*.versionsBackup
.flattened-pom.xml
Expand Down
104 changes: 30 additions & 74 deletions hugegraph-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<url>https://github.com/apache/incubator-hugegraph-toolchain/tree/master/hugegraph-client</url>
<url>https://github.com/apache/hugegraph-toolchain/tree/master/hugegraph-client</url>
<description>
hugegraph-client is a Java-written client of HugeGraph, providing
operations of graph, schema, gremlin, variables and traversals etc.
</description>

<properties>
<hugegraph.common.version>1.0.0</hugegraph.common.version>
<jersey.version>3.0.3</jersey.version>
<mockito.version>2.8.47</mockito.version>
</properties>
Expand All @@ -44,7 +43,6 @@
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-common</artifactId>
<version>${hugegraph.common.version}</version>
</dependency>
<dependency>
<groupId>org.lz4</groupId>
Expand All @@ -66,35 +64,29 @@

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${compiler.source}</source>
<target>${compiler.target}</target>
<compilerArguments>
<Xmaxerrs>500</Xmaxerrs>
</compilerArguments>
<compilerArgs>
<arg>-Xlint:unchecked</arg>
</compilerArgs>
</configuration>
</plugin>

<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <source>${compiler.source}</source>-->
<!-- <target>${compiler.target}</target>-->
<!-- <compilerArguments>-->
<!-- <Xmaxerrs>500</Xmaxerrs>-->
<!-- </compilerArguments>-->
<!-- <compilerArgs>-->
<!-- <arg>-Xlint:unchecked</arg>-->
<!-- </compilerArgs>-->
<!-- </configuration>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addDefaultImplementationEntries>
false
</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>
true
</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>false</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<!-- Must be on one line, otherwise the automatic
Expand All @@ -104,7 +96,6 @@
</archive>
</configuration>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand Down Expand Up @@ -138,56 +129,21 @@

<profiles>
<profile>
<id>release</id>
<id>apache-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-source-plugin</artifactId>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-javadoc-plugin</artifactId>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-gpg-plugin</artifactId>-->
<!-- </plugin>-->
</plugins>
</build>
</profile>
Expand Down
1 change: 0 additions & 1 deletion hugegraph-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<filesets>
<fileset>
Expand Down
100 changes: 100 additions & 0 deletions hugegraph-dist/scripts/apache-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

GROUP="hugegraph"
# current repository name
REPO="${GROUP}-toolchain"
# release version (input by committer)
RELEASE_VERSION=$1
USERNAME=$2
PASSWORD=$3
# git release branch (check it carefully)
GIT_BRANCH="release-${RELEASE_VERSION}"

RELEASE_VERSION=${RELEASE_VERSION:?"Please input the release version behind script"}

WORK_DIR=$(cd "$(dirname "$0")" || exit; pwd)
cd "${WORK_DIR}" || exit
echo "In the work dir: $(pwd)"

# clean old dir then build a new one
rm -rfv dist && mkdir -p dist/apache-${REPO}

# step1: package the source code
cd ../../ || exit
git archive --format=tar.gz \
--output="${GROUP}-dist/scripts/dist/apache-${REPO}/apache-${REPO}-incubating-${RELEASE_VERSION}-src.tar.gz" \
--prefix="apache-${REPO}-incubating-${RELEASE_VERSION}-src/" "${GIT_BRANCH}" || exit

cd - || exit

# step2: copy the binary file (Optional)
# Note: it's optional for project to generate binary package (skip this step if not need)
cp -v ../../target/apache-${REPO}-incubating-"${RELEASE_VERSION}".tar.gz \
dist/apache-${REPO} || exit

# step3: sign + hash
##### 3.1 sign in source & binary package
gpg --version 1>/dev/null || exit
cd ./dist/apache-${REPO} || exit
for i in *.tar.gz; do
echo "$i" && gpg --armor --output "$i".asc --detach-sig "$i"
done

##### 3.2 Generate SHA512 file
shasum --version 1>/dev/null || exit
for i in *.tar.gz; do
echo "$i" && shasum -a 512 "$i" >"$i".sha512
done

#### 3.3 check signature & sha512
for i in *.tar.gz; do
echo "$i"
gpg --verify "$i".asc "$i" || exit
done

for i in *.tar.gz; do
echo "$i"
shasum -a 512 --check "$i".sha512 || exit
done

# step4: upload to Apache-SVN
SVN_DIR="${GROUP}-svn-dev"
cd ../
rm -rfv ${SVN_DIR}

##### 4.1 pull from remote & copy files
svn co "https://dist.apache.org/repos/dist/dev/incubator/${GROUP}" ${SVN_DIR}
mkdir -p ${SVN_DIR}/"${RELEASE_VERSION}"
cp -v apache-${REPO}/*tar.gz* "${SVN_DIR}/${RELEASE_VERSION}"
cd ${SVN_DIR} || exit

##### 4.2 check status first
svn status
svn add --parents "${RELEASE_VERSION}"/apache-${REPO}-*
# check status again
svn status

##### 4.3 commit & push files
if [ "$USERNAME" = "" ]; then
svn commit -m "submit files for ${REPO} ${RELEASE_VERSION}"
else
svn commit -m "submit files for ${REPO} ${RELEASE_VERSION}" --username "${USERNAME}" --password "${PASSWORD}"
fi

echo "Finished all, please check all steps in script manually again!"
1 change: 0 additions & 1 deletion hugegraph-hubble/hubble-be/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-common</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
Expand Down
1 change: 1 addition & 0 deletions hugegraph-hubble/hubble-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<includes>
<include>*.tar.gz</include>
<include>${final.name}/**</include>
<include>.flattened-pom.xml</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
Expand Down
2 changes: 1 addition & 1 deletion hugegraph-hubble/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<packaging>pom</packaging>

<name>${project.artifactId}</name>
<url>https://github.com/apache/incubator-hugegraph-toolchain/tree/master/hugegraph-hubble</url>
<url>https://github.com/apache/hugegraph-toolchain/tree/master/hugegraph-hubble</url>
<description>
hugegraph-hubble is a graph management and analysis platform that provides features:
graph data load, schema management, graph relationship analysis and graphical display.
Expand Down
Loading