Skip to content

Commit

Permalink
apache: how to add 3rd-party dependency in project (#263)
Browse files Browse the repository at this point in the history
* Update contribute.md

---------

Co-authored-by: imbajin <[email protected]> d62608a
  • Loading branch information
imbajin committed Jun 26, 2023
1 parent 3c9c49b commit a11e335
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cn/docs/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6487,7 +6487,7 @@
</span></span><span style=display:flex><span>vim hugegraph-core/src/main/java/org/apache/hugegraph/HugeFactory.java
</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic># run test locally (optional)</span>
</span></span><span style=display:flex><span>mvn <span style=color:#204a87>test</span> -Pcore-test,memory
</span></span></code></pre></div><p>Note: In order to be consistent with the code style easily, if you use <a href=https://www.jetbrains.com/idea/>IDEA</a> as your IDE, you can directly <a href=https://www.jetbrains.com/help/idea/configuring-code-style.html>import</a> our code style <a href=./hugegraph-style.xml>configuration file</a>.</p><h4 id=33-commit-changes-to-git-repo>3.3 Commit changes to git repo</h4><p>After the code has been completed, we submit them to the local git repo:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span><span style=color:#8f5902;font-style:italic># add files to local git index</span>
</span></span></code></pre></div><p>Note: In order to be consistent with the code style easily, if you use <a href=https://www.jetbrains.com/idea/>IDEA</a> as your IDE, you can directly <a href=https://www.jetbrains.com/help/idea/configuring-code-style.html>import</a> our code style <a href=./hugegraph-style.xml>configuration file</a>.</p><h5 id=321-添加第三方依赖>3.2.1 添加第三方依赖</h5><p>如果我们要在 <code>HugeGraph</code> 项目中添加新的第三方依赖, 我们需要做下面的几件事情:</p><ol><li>找到第三方依赖的仓库,将依赖的 <code>license</code> 文件放到 <a href=https://github.com/apache/incubator-hugegraph/tree/master/hugegraph-dist/release-docs/licenses>./hugegraph-dist/release-docs/licenses/</a> 路径下。</li><li>在<a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/LICENSE>./hugegraph-dist/release-docs/LICENSE</a> 中声明该依赖的 <code>LICENSE</code> 信息。</li><li>找到仓库里的 NOTICE 文件,将其追加到 <a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/NOTICE>./hugegraph-dist/release-docs/NOTICE</a> 文件后面(如果没有NOTICE文件则跳过这一步)。</li><li>本地执行<a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh>./hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh</a> 脚本来更新依赖列表<a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/known-dependencies.txt>known-dependencies.txt</a> (或者手动更新)。</li></ol><p><strong>例如</strong>:在项目中引入了第三方新依赖 -> <code>ant-1.9.1.jar</code></p><ul><li>项目源码位于:https://github.com/apache/ant/tree/rel/1.9.1</li><li>LICENSE 文件:https://github.com/apache/ant/blob/rel/1.9.1/LICENSE</li><li>NOTICE 文件:https://github.com/apache/ant/blob/rel/1.9.1/NOTICE</li></ul><p><code>ant-1.9.1.jar</code> 的 license 信息需要在 LICENSE 文件中指定,notice 信息需要在 NOTICE 文件中指定。 ant-1.9.1.jar 对应的详细 LICENSE 文件需要复制到我们的 licenses/ 目录下。最后更新 known-dependencies.txt 文件。</p><h4 id=33-commit-changes-to-git-repo>3.3 Commit changes to git repo</h4><p>After the code has been completed, we submit them to the local git repo:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span><span style=color:#8f5902;font-style:italic># add files to local git index</span>
</span></span><span style=display:flex><span>git add hugegraph-core/src/main/java/org/apache/hugegraph/HugeGraph.java
</span></span><span style=display:flex><span>git add hugegraph-core/src/main/java/org/apache/hugegraph/HugeFactory.java
</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic># commit to local git repo</span>
Expand Down
2 changes: 1 addition & 1 deletion cn/docs/contribution-guidelines/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</span></span><span style=display:flex><span>vim hugegraph-core/src/main/java/org/apache/hugegraph/HugeFactory.java
</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic># run test locally (optional)</span>
</span></span><span style=display:flex><span>mvn <span style=color:#204a87>test</span> -Pcore-test,memory
</span></span></code></pre></div><p>Note: In order to be consistent with the code style easily, if you use <a href=https://www.jetbrains.com/idea/>IDEA</a> as your IDE, you can directly <a href=https://www.jetbrains.com/help/idea/configuring-code-style.html>import</a> our code style <a href=./hugegraph-style.xml>configuration file</a>.</p><h4 id=33-commit-changes-to-git-repo>3.3 Commit changes to git repo</h4><p>After the code has been completed, we submit them to the local git repo:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span><span style=color:#8f5902;font-style:italic># add files to local git index</span>
</span></span></code></pre></div><p>Note: In order to be consistent with the code style easily, if you use <a href=https://www.jetbrains.com/idea/>IDEA</a> as your IDE, you can directly <a href=https://www.jetbrains.com/help/idea/configuring-code-style.html>import</a> our code style <a href=./hugegraph-style.xml>configuration file</a>.</p><h5 id=321-添加第三方依赖>3.2.1 添加第三方依赖</h5><p>如果我们要在 <code>HugeGraph</code> 项目中添加新的第三方依赖, 我们需要做下面的几件事情:</p><ol><li>找到第三方依赖的仓库,将依赖的 <code>license</code> 文件放到 <a href=https://github.com/apache/incubator-hugegraph/tree/master/hugegraph-dist/release-docs/licenses>./hugegraph-dist/release-docs/licenses/</a> 路径下。</li><li><a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/LICENSE>./hugegraph-dist/release-docs/LICENSE</a> 中声明该依赖的 <code>LICENSE</code> 信息。</li><li>找到仓库里的 NOTICE 文件,将其追加到 <a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/NOTICE>./hugegraph-dist/release-docs/NOTICE</a> 文件后面(如果没有NOTICE文件则跳过这一步)。</li><li>本地执行<a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh>./hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh</a> 脚本来更新依赖列表<a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/known-dependencies.txt>known-dependencies.txt</a> (或者手动更新)。</li></ol><p><strong>例如</strong>:在项目中引入了第三方新依赖 -> <code>ant-1.9.1.jar</code></p><ul><li>项目源码位于:https://github.com/apache/ant/tree/rel/1.9.1</li><li>LICENSE 文件:https://github.com/apache/ant/blob/rel/1.9.1/LICENSE</li><li>NOTICE 文件:https://github.com/apache/ant/blob/rel/1.9.1/NOTICE</li></ul><p><code>ant-1.9.1.jar</code> 的 license 信息需要在 LICENSE 文件中指定,notice 信息需要在 NOTICE 文件中指定。 ant-1.9.1.jar 对应的详细 LICENSE 文件需要复制到我们的 licenses/ 目录下。最后更新 known-dependencies.txt 文件。</p><h4 id=33-commit-changes-to-git-repo>3.3 Commit changes to git repo</h4><p>After the code has been completed, we submit them to the local git repo:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span><span style=color:#8f5902;font-style:italic># add files to local git index</span>
</span></span><span style=display:flex><span>git add hugegraph-core/src/main/java/org/apache/hugegraph/HugeGraph.java
</span></span><span style=display:flex><span>git add hugegraph-core/src/main/java/org/apache/hugegraph/HugeFactory.java
</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic># commit to local git repo</span>
Expand Down
8 changes: 4 additions & 4 deletions cn/docs/contribution-guidelines/contribute/index.html

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions cn/docs/contribution-guidelines/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># run test locally (optional)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mvn &lt;span style="color:#204a87">test&lt;/span> -Pcore-test,memory
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Note: In order to be consistent with the code style easily, if you use &lt;a href="https://www.jetbrains.com/idea/">IDEA&lt;/a> as your IDE, you can directly &lt;a href="https://www.jetbrains.com/help/idea/configuring-code-style.html">import&lt;/a> our code style &lt;a href="./hugegraph-style.xml">configuration file&lt;/a>.&lt;/p>
&lt;h5 id="321-添加第三方依赖">3.2.1 添加第三方依赖&lt;/h5>
&lt;p>如果我们要在 &lt;code>HugeGraph&lt;/code> 项目中添加新的第三方依赖, 我们需要做下面的几件事情:&lt;/p>
&lt;ol>
&lt;li>找到第三方依赖的仓库,将依赖的 &lt;code>license&lt;/code> 文件放到 &lt;a href="https://github.com/apache/incubator-hugegraph/tree/master/hugegraph-dist/release-docs/licenses">./hugegraph-dist/release-docs/licenses/&lt;/a> 路径下。&lt;/li>
&lt;li>在&lt;a href="https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/LICENSE">./hugegraph-dist/release-docs/LICENSE&lt;/a> 中声明该依赖的 &lt;code>LICENSE&lt;/code> 信息。&lt;/li>
&lt;li>找到仓库里的 NOTICE 文件,将其追加到 &lt;a href="https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/NOTICE">./hugegraph-dist/release-docs/NOTICE&lt;/a> 文件后面(如果没有NOTICE文件则跳过这一步)。&lt;/li>
&lt;li>本地执行&lt;a href="https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh">./hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh&lt;/a> 脚本来更新依赖列表&lt;a href="https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/known-dependencies.txt">known-dependencies.txt&lt;/a> (或者手动更新)。&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>例如&lt;/strong>:在项目中引入了第三方新依赖 -&amp;gt; &lt;code>ant-1.9.1.jar&lt;/code>&lt;/p>
&lt;ul>
&lt;li>项目源码位于:https://github.com/apache/ant/tree/rel/1.9.1&lt;/li>
&lt;li>LICENSE 文件:https://github.com/apache/ant/blob/rel/1.9.1/LICENSE&lt;/li>
&lt;li>NOTICE 文件:https://github.com/apache/ant/blob/rel/1.9.1/NOTICE&lt;/li>
&lt;/ul>
&lt;p>&lt;code>ant-1.9.1.jar&lt;/code> 的 license 信息需要在 LICENSE 文件中指定,notice 信息需要在 NOTICE 文件中指定。 ant-1.9.1.jar 对应的详细 LICENSE 文件需要复制到我们的 licenses/ 目录下。最后更新 known-dependencies.txt 文件。&lt;/p>
&lt;h4 id="33-commit-changes-to-git-repo">3.3 Commit changes to git repo&lt;/h4>
&lt;p>After the code has been completed, we submit them to the local git repo:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># add files to local git index&lt;/span>
Expand Down
15 changes: 15 additions & 0 deletions cn/docs/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2352,6 +2352,21 @@ HugeGraph支持多用户并行操作,用户可输入Gremlin查询语句,并
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># run test locally (optional)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mvn &lt;span style="color:#204a87">test&lt;/span> -Pcore-test,memory
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Note: In order to be consistent with the code style easily, if you use &lt;a href="https://www.jetbrains.com/idea/">IDEA&lt;/a> as your IDE, you can directly &lt;a href="https://www.jetbrains.com/help/idea/configuring-code-style.html">import&lt;/a> our code style &lt;a href="./hugegraph-style.xml">configuration file&lt;/a>.&lt;/p>
&lt;h5 id="321-添加第三方依赖">3.2.1 添加第三方依赖&lt;/h5>
&lt;p>如果我们要在 &lt;code>HugeGraph&lt;/code> 项目中添加新的第三方依赖, 我们需要做下面的几件事情:&lt;/p>
&lt;ol>
&lt;li>找到第三方依赖的仓库,将依赖的 &lt;code>license&lt;/code> 文件放到 &lt;a href="https://github.com/apache/incubator-hugegraph/tree/master/hugegraph-dist/release-docs/licenses">./hugegraph-dist/release-docs/licenses/&lt;/a> 路径下。&lt;/li>
&lt;li>在&lt;a href="https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/LICENSE">./hugegraph-dist/release-docs/LICENSE&lt;/a> 中声明该依赖的 &lt;code>LICENSE&lt;/code> 信息。&lt;/li>
&lt;li>找到仓库里的 NOTICE 文件,将其追加到 &lt;a href="https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/NOTICE">./hugegraph-dist/release-docs/NOTICE&lt;/a> 文件后面(如果没有NOTICE文件则跳过这一步)。&lt;/li>
&lt;li>本地执行&lt;a href="https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh">./hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh&lt;/a> 脚本来更新依赖列表&lt;a href="https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/known-dependencies.txt">known-dependencies.txt&lt;/a> (或者手动更新)。&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>例如&lt;/strong>:在项目中引入了第三方新依赖 -&amp;gt; &lt;code>ant-1.9.1.jar&lt;/code>&lt;/p>
&lt;ul>
&lt;li>项目源码位于:https://github.com/apache/ant/tree/rel/1.9.1&lt;/li>
&lt;li>LICENSE 文件:https://github.com/apache/ant/blob/rel/1.9.1/LICENSE&lt;/li>
&lt;li>NOTICE 文件:https://github.com/apache/ant/blob/rel/1.9.1/NOTICE&lt;/li>
&lt;/ul>
&lt;p>&lt;code>ant-1.9.1.jar&lt;/code> 的 license 信息需要在 LICENSE 文件中指定,notice 信息需要在 NOTICE 文件中指定。 ant-1.9.1.jar 对应的详细 LICENSE 文件需要复制到我们的 licenses/ 目录下。最后更新 known-dependencies.txt 文件。&lt;/p>
&lt;h4 id="33-commit-changes-to-git-repo">3.3 Commit changes to git repo&lt;/h4>
&lt;p>After the code has been completed, we submit them to the local git repo:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># add files to local git index&lt;/span>
Expand Down
2 changes: 1 addition & 1 deletion cn/sitemap.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6492,7 +6492,7 @@
</span></span><span style=display:flex><span>vim hugegraph-core/src/main/java/org/apache/hugegraph/HugeFactory.java
</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic># run test locally (optional)</span>
</span></span><span style=display:flex><span>mvn <span style=color:#204a87>test</span> -Pcore-test,memory
</span></span></code></pre></div><p>Note: In order to be consistent with the code style easily, if you use <a href=https://www.jetbrains.com/idea/>IDEA</a> as your IDE, you can directly <a href=https://www.jetbrains.com/help/idea/configuring-code-style.html>import</a> our code style <a href=./hugegraph-style.xml>configuration file</a>.</p><h4 id=33-commit-changes-to-git-repo>3.3 Commit changes to git repo</h4><p>After the code has been completed, we submit them to the local git repo:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span><span style=color:#8f5902;font-style:italic># add files to local git index</span>
</span></span></code></pre></div><p>Note: In order to be consistent with the code style easily, if you use <a href=https://www.jetbrains.com/idea/>IDEA</a> as your IDE, you can directly <a href=https://www.jetbrains.com/help/idea/configuring-code-style.html>import</a> our code style <a href=./hugegraph-style.xml>configuration file</a>.</p><h5 id=321-check-licenses>3.2.1 Check licenses</h5><p>If we want to add new third-party dependencies to the <code>HugeGraph</code> project, we need to do the following things:</p><ol><li>Find the third-party dependent repository, put the dependent <code>license</code> file into <a href=https://github.com/apache/incubator-hugegraph/tree/master/hugegraph-dist/release-docs/licenses>./hugegraph-dist/release-docs/licenses/</a> path.</li><li>Declare the dependency in <a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/LICENSE>./hugegraph-dist/release-docs/LICENSE</a> <code>LICENSE</code> information.</li><li>Find the NOTICE file in the repository and append it to <a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/NOTICE>./hugegraph-dist/release-docs/NOTICE</a> file (skip this step if there is no NOTICE file).</li><li>Execute locally <a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh>./hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh</a> to update the dependency list <a href=https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/known-dependencies.txt>known-dependencies.txt</a> (or manually update) .</li></ol><p><strong>Example</strong>: A new third-party dependency is introduced into the project -> <code>ant-1.9.1.jar</code></p><ul><li>The project source code is located at: <a href=https://github.com/apache/ant/tree/rel/1.9.1>https://github.com/apache/ant/tree/rel/1.9.1</a></li><li>LICENSE file: <a href=https://github.com/apache/ant/blob/rel/1.9.1/LICENSE>https://github.com/apache/ant/blob/rel/1.9.1/LICENSE</a></li><li>NOTICE file: <a href=https://github.com/apache/ant/blob/rel/1.9.1/NOTICE>https://github.com/apache/ant/blob/rel/1.9.1/NOTICE</a></li></ul><p>The license information of <code>ant-1.9.1.jar</code> needs to be specified in the LICENSE file, and the notice information needs to be specified in the NOTICE file. The detailed LICENSE file corresponding to ant-1.9.1.jar needs to be copied to our licenses/ directory. Finally update the known-dependencies.txt file.</p><h4 id=33-commit-changes-to-git-repo>3.3 Commit changes to git repo</h4><p>After the code has been completed, we submit them to the local git repo:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span><span style=color:#8f5902;font-style:italic># add files to local git index</span>
</span></span><span style=display:flex><span>git add hugegraph-core/src/main/java/org/apache/hugegraph/HugeGraph.java
</span></span><span style=display:flex><span>git add hugegraph-core/src/main/java/org/apache/hugegraph/HugeFactory.java
</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic># commit to local git repo</span>
Expand Down
Loading

0 comments on commit a11e335

Please sign in to comment.