Initial commit of the hacking guide

This commit is contained in:
jbertram 2015-05-13 12:49:42 -05:00
parent 042a8f556a
commit 70258865a5
17 changed files with 556 additions and 389 deletions

332
README.md
View File

@ -1,107 +1,27 @@
# ActiveMQ Artemis
This file describes some minimum 'stuff one needs to know' to get
started coding in this project.
This file describes some minimum 'stuff one needs to know' to get started coding in this project.
## Source
The project's source code is hosted at:
https://git-wip-us.apache.org/repos/asf/activemq-artemis.git
### Git usage:
Pull requests should be merged without fast forwards '--no-ff'. An easy way to achieve that is to use
```% git config branch.master.mergeoptions --no-ff```
## Maven
The minimum required Maven version is 3.0.0.
Do note that there are some compatibility issues with Maven 3.X still
unsolved [1]. This is specially true for the 'site' plugin [2].
[1]: <https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html>
[2]: <https://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html>
## building the distribution
If you want to build the full release with documentation, Javadocs and the full web site then run the following:
```% mvn -Prelease package```
If you want to install it to your local maven repo then run
```% mvn -Prelease install```
The full release uses gitbook to build a static website from the documentation, if you don't have gitbook installed then
install gitbook using npm
```npm install -g gitbook gitbook-cli```
### Installing NPM
If you don't have npm installed then you would need to install it first.
#### On Fedora
```yum install npm```
#### On Mac-OS
The easiest way would be through brew [brew]
You first install brew using the instructions on the [brew] website.
After you installed brew you can install npm by:
```brew install npm```
[brew]: <http://brew.sh>
#### Build without docs
It is possible to build a distribution with out the manuals and javadocs if you dont have or want gitbook installed,
simply run
```% mvn package```
## Tests
To run the unit tests:
```% mvn -Ptests test```
Generating reports from unit tests:
```% mvn install site```
Running tests individually
```% mvn -Ptests -DfailIfNoTests=false -Dtest=<test-name> test ```
where &lt;test-name> is the name of the Test class without its package name
For details about the modifying the code, building the project, running tests, IDE integration, etc. see
our [Hacking Guide](./docs/hacking-guide/en/README.md).
## Examples
To run an example firstly make sure you have run
```% mvn -Prelease install```
$ mvn -Prelease install
If the project version has already been released then this is unnecessary.
then you will need to set the following maven options, on Linux by
```export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"```
$ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
and the finally run the examples by
```% mvn verify```
$ mvn verify
You can also run individual examples by running the same command from the directory of which ever example you want to run.
NB for this make sure you have installed examples/common.
@ -110,241 +30,5 @@ NB for this make sure you have installed examples/common.
If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies:
```
# if trying to modify the 'topic' example:
cd examples/jms/topic && mvn dependency:list
```
## Eclipse
We recommend using Eclipse Kepler (4.3), due to the built-in support
for Maven and Git. Note that there are still some Maven plugins used
by sub-projects (e.g. documentation) which are not supported even in
Eclipse Kepler (4.3).
Eclipse [m2e] is already included in "Eclipse IDE for Java Developers", or it
can be installed from [Eclipse Kepler release repository].
[m2e]: http://eclipse.org/m2e/
[Eclipse Kepler release repository]: http://download.eclipse.org/releases/kepler
## IntelliJ IDEA
### Importing the Project
The following steps show how to import ActiveMQ Artemis source into IntelliJ IDEA and setup the correct maven profile to allow
running of JUnit tests from within the IDE. (Steps are based on version: 13.1.4)
* File --> Import Project --> Select the root directory of the ActiveMQ Artemis source folder. --> Click OK
This should open the import project wizard. From here:
* Select "Import from existing model" toggle box, then select Maven from the list box below. Click Next.
* Leave the defaults set on this page and click next.
* On the "Select profiles page", select the checkbox next to "tests" and click next.
* From here the default settings should suffice. Continue through the wizard, clicking next until the wizard is complete.
Once the project has been imported and IDEA has caught up importing all the relevant dependencies, you should be able to
run JUnit tests from with the IDE. Select any test class in the tests -> integration tests folder. Right click on the
class in the project tab and click "Run <classname>". If the "Run <classname>" option is present then you're all set to go.
### Style Templates for Idea
We have shared the style templates that are good for this project. If you want to apply them use these steps:
* File->Import Settings
* Select the file under ./artemis-cloned-folder/etc/IDEA-style.jar
* Select both Code Style Templates and File templates (it's the default option)
* Select OK and restart Idea
### Issue: My JUnit tests are not runnable with in the IDE.
If the "Run <classname>" or "Run all tests" option is not present. It is likely that the default profile has not been
imported properly. To (re)import the "tests" Maven profile in an existing project.
* Open the Maven Projects Tool Window: View -> Tool Windows -> Maven Projects
* Select the "profiles" drop down
* Unselect then reselect the checkbox next to "tests".
* Click on the "Reimport all maven projects" button in the top left hand corner of the window. (It looks like a ciruclar
blue arrow.
* Wait for IDEA to reload and try running a JUnit test again. The option to run should now be present.
### Annotation Pre-Processing
ActiveMQ Artemis uses [JBoss Logging] and that requires source code generation from Java
annotations. In order for it to 'just work' in Eclipse you need to install the
_Maven Integration for Eclipse JDT Annotation Processor Toolkit_ [m2e-apt]. See
this [JBoss blog post] for details.
[JBoss Logging]: <https://community.jboss.org/wiki/JBossLoggingTooling>
[m2e-apt]: https://github.com/jbosstools/m2e-apt
[JBoss blog post]: https://community.jboss.org/en/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out
### M2E Connector for Javacc-Maven-Plugin
Eclipse Indigo (3.7) has out-of-the-box support for it.
As of this writing, Eclipse Kepler (4.3) still lacks support for
Maven's javacc plugin. The available [m2e connector for
javacc-maven-plugin] requires a downgrade of Maven components to be
installed. manual installation instructions (as of this writing you
need to use the development update site). See [this post] for how to
do this with Eclipse Juno (4.2).
The current recommended solution for Eclipse Kepler is to mark
`javacc-maven-plugin` as ignored by Eclipse, run Maven from the
command line and then modify the project `activemq-core-client` adding
the folder `target/generated-sources/javacc` to its build path.
[m2e connector for javacc-maven-plugin]: https://github.com/objectledge/maven-extensions
[this post]:
http://dev.eclipse.org/mhonarc/lists/m2e-users/msg02725.html
### Use _Project Working Sets_
Importing all ActiveMQ Artemis subprojects will create _too many_ projects in Eclipse,
cluttering your _Package Explorer_ and _Project Explorer_ views. One way to address
that is to use [Eclipse's Working Sets] feature. A good introduction to it can be
found at a [Dzone article on Eclipse Working Sets].
[Eclipse's Working Sets]: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fcworkset.htm
[Dzone article on Eclipse Working Sets]: http://eclipse.dzone.com/articles/categorise-projects-package
### Code Formatting
Eclipse code formatting and (basic) project configuration files can be found at
the ```etc/``` folder. You should manually copy them _after importing all your
projects_:
```
for settings_dir in `find . -type d -name .settings`; do
\cp -v etc/org.eclipse.jdt.* $settings_dir
done
```
Do not use the [maven-eclipse-plugin] to copy the files as it conflicts with [m2e].
[maven-eclipse-plugin]: https://maven.apache.org/plugins/maven-eclipse-plugin/
[m2e]: http://eclipse.org/m2e/
## Committing Changes
### Repositories
The code repository for ActiveMQ Artemis is hosted by Apache org and lives here: https://git-wip-us.apache.org/repos/asf/activemq-artemis.git.
We also host a mirror of the ActiveMQ Artemis repository on GitHub: https://github.com/apache/activemq-artemis. We use this mirror for all code submissions and reviews. To submit code to ActiveMQ Artemis please open a Pull Request as outlined as part of the GitHub workflow described here: https://guides.github.com/introduction/flow/index.html. Once a pull request is opened it will be reviewed and commented on. Any further changes as a result of comments / review process should be addressed and reflected in the original pull request as outlined in the GitHub workflow. When the pull request has went through the review process and ready to merge, the reviewer should comment with "Ack, Ready to Push". Once an Ack message is received one of the ActiveMQ Artemis core team members will push the changes to upstream Apache ActiveMQ Artemis repository and close the pull request.
### Commit Messages
We follow the 50/72 git commit message format. An ActiveMQ Artemis commit message should be formatted in the following manner:
* Add the ACTIVEMQ6 JIRA or Bugzilla reference (if one exists) followed by a brief description of the change in the first line.
* Insert a single blank line after the first line.
* Provide a detailed description of the change in the following lines, breaking paragraphs where needed.
* The first line should be limited to 50 characters
* Subsequent lines should be wrapped at 72 characters.
An example correctly formatted commit message:
```
ACTIVEMQ6-123 Add new commit msg format to README
Adds a description of the new commit message format as well as examples
of well formatted commit messages to the README.md. This is required
to enable developers to quickly identify what the commit is intended to
do and why the commit was added.
```
### Adding New Dependencies
Due to incompatibilities between some open source licenses and the Apache v2.0 license (that this project is licensed under)
care must be taken when adding new dependencies to the project. The Apache Software Foundation 3rd party
licensing policy has more information here: http://www.apache.org/legal/3party.html
To keep track of all licenses in ActiveMQ Artemis, new dependencies must be added in either the top level pom.xml or in test/pom.xml
(depending on whether this is a test only dependency or if it is used in the main code base). The dependency should be
added under the dependency management section with version and labelled with a comment highlighting the license for the
dependency version. See existing dependencies in the main pom.xml for examples. The dependency can then be added to
individual ActiveMQ Artemis modules *without* the version specified (the version is implied from the dependency management
section of the top level pom). This allows ActiveMQ Artemis developers to keep track of all dependencies and licenses.
### Core Contributers
Core ActiveMQ Artemis members have write access to the Apache ActiveMQ Artemis repositories and will be responsible for Ack'ing and pushing commits contributed via pull requests on GitHub. The follow steps can be used as an example for how to set up relevant ActiveMQ Artemis repositories for reviewing and pushing changes.
To setup repositories for reviewing and pushing:
```bash
# Clone the GitHub Mirror of ActiveMQ Artemis Repo:
git clone git@github.com:apache/activemq-artemis.git
# Add the following section to your <artemis-repo>/.git/config statement to fetch all pull requests sent to the GitHub mirror. Note that the remote name for git@github.com:apache/activemq-artemis.git may be different. Be sure to edit all references to the remote name. In this case "activemq".
[remote "origin"]
url = git@github.com:apache/activemq-artemis.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
# Add the Apache repository as a remote
git remote add upstream https://git-wip-us.apache.org/repos/asf/activemq-artemis.git
# Fetch
git fetch --all
```
To push commits from a pull request to the apache repository:
```bash
cd <artemis-repo>
# Download all the remote branches etc... including all the pull requests.
git fetch --all
# Checkout the pull request you wish to review
git checkout pr/2
# Review is done... READY TO MERGE.
# Check out the master branch.
git checkout master
# Ensure you are up to date
git pull
# Create a new merge commit from the
git merge --no-ff pr/2
# IMPORTANT: In this commit message be sure to write something along the lines of: "Merge Pull Request #2" Where 2 is the Pull Request ID. "#2" shows up as a link in the GitHub UI for navigating to the PR from the commit message.
# Pushes to the upstream repo.
git push upstream master
```
#### Notes:
The GitHub mirror repository is cloning the Apache ActiveMQ Artemis repository (The root repository). There maybe a slight delay between when a commit is pushed to the Apache repo and when that commit is reflected in the GitHub mirror. This may cause some difficulty when trying to push a PR to upstream (Apache) that has been merged on an out of date GitHub (mirror) master. You can wait for the mirror to update before performing the steps above. A solution to this is to change local master branch to track the upstream (Apache) master, rather than GitHub (mirror) master by editing your config to look like this:
```bash
[branch "master"]
remote = upstream
merge = refs/heads/master
```
Where upstream points to the Apache Repo.
If you'd like master to always track GitHub master, then another way to acheive this is to add another branch that tracks upstream master and push from that branch to upstream master e.g.
```bash
# .git/config entry
[branch "umaster"]
remote = upstream
merge = refs/heads/master
git checkout umaster
git pull
git merge --no-ff pr/2
git push upstream umaster:master # Push local branch umaster to upstream branch master.
```
# if trying to modify the 'topic' example:
cd examples/jms/topic && mvn dependency:list

View File

@ -27,43 +27,44 @@
<packaging>jar</packaging>
<name>ActiveMQ Artemis Web</name>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-journal</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-selector</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-journal</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-selector</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<properties>
<activemq.basedir>${project.basedir}/..</activemq.basedir>
<webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
<webapp-outdir>${basedir}/target/classes/user-manual</webapp-outdir>
<activemq.basedir>${project.basedir}/..</activemq.basedir>
<webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
<webapp-outdir-user-manual>${basedir}/target/classes/user-manual</webapp-outdir-user-manual>
<webapp-outdir-hacking-guide>${basedir}/target/classes/hacking-guide</webapp-outdir-hacking-guide>
</properties>
<build>
@ -109,35 +110,42 @@
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target>
<condition property="gitbook.cmd" value="gitbook.cmd" else="gitbook">
<os family="windows" />
</condition>
<!-- lets generate the gitbook -->
<mkdir dir="${webapp-outdir}/gitbook" />
<echo>executing ${gitbook.cmd}</echo>
<exec executable="${gitbook.cmd}">
<arg value="build" />
<arg value="${basedir}/../docs/user-manual/en" />
<arg value="--output=${webapp-outdir}" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<phase>generate-sources</phase>
<configuration>
<target>
<condition property="gitbook.cmd" value="gitbook.cmd" else="gitbook">
<os family="windows"/>
</condition>
<!-- lets generate the gitbook -->
<mkdir dir="${webapp-outdir-user-manual}/gitbook"/>
<echo>executing ${gitbook.cmd}</echo>
<exec executable="${gitbook.cmd}">
<arg value="build"/>
<arg value="${basedir}/../docs/user-manual/en"/>
<arg value="--output=${webapp-outdir-user-manual}"/>
</exec>
<mkdir dir="${webapp-outdir-hacking-guide}/gitbook"/>
<echo>executing ${gitbook.cmd}</echo>
<exec executable="${gitbook.cmd}">
<arg value="build"/>
<arg value="${basedir}/../docs/hacking-guide/en"/>
<arg value="--output=${webapp-outdir-hacking-guide}"/>
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</plugin>
</plugins>
</build>
</profile>
</profiles>

View File

@ -0,0 +1,24 @@
<!--
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.
-->
<h1>User Manual</h1>
<p>If you are seeing this message, it is because the Hacking Guide was not built during the Apache ActiveMQ Artemis build. To
build Apache ActiveMQ Artemis with the Hacking Guide you must use the maven release profile:
<code>mvn clean install -Prelease</code>.</p>

View File

@ -52,6 +52,7 @@
<ul>
<li><a target="_blank" href="api/index.html">API</a></li>
<li><a target="_blank" href="user-manual/index.html">User Manual</a></li>
<li><a target="_blank" href="hacking-guide/index.html">Hacking Guide</a></li>
<li><a href="examples/index.html">Examples</a></li>
<li><a href="http://activemq.apache.org/artemis">Apache ActiveMQ Artemis Website</a></li>
</ul>

View File

@ -21,6 +21,4 @@ under the License.
<p>If you are seeing this message, it is because the User Manual was not built during the Apache ActiveMQ Artemis build. To
build Apache ActiveMQ Artemis with the User Manual you must use the maven release profile:
<code>mvn clean install -Prelease</code>.</p>
<p>Please see the README in the source distribution for more information.</p>
<code>mvn clean install -Prelease</code>.</p>

View File

@ -0,0 +1,7 @@
![ActiveMQ Artemis logo](images/artemis-logo.jpg)
Apache ActiveMQ Artemis Hacking Guide
=====================================
This hacking guide outlines how developers can get involved in contributing to the Apache ActiveMQ Artemis project.

View File

@ -0,0 +1,10 @@
# Summary
* [Legal Notice](notice.md)
* [Working with the Code](code.md)
* [IDE Integration](ide.md)
* [Building](building.md)
* [Tests](tests.md)
* [Code Formatting](formatting.md)
* [Notes for Maintainers](maintainers.md)

View File

@ -0,0 +1,11 @@
{
"title": "ActiveMQ Artemis Documentation",
"description": "ActiveMQ Artemis Hacking Guide",
"github": "apache/activemq-artemis",
"githubHost": "https://github.com/",
"links": {
"home": "http://activemq.apache.org/",
"issues": "http://activemq.apache.org/",
"contribute": "http://activemq.apache.org/contributing.html"
}
}

View File

@ -0,0 +1,48 @@
# Building
We use Apache Maven to build the code, docs, distribution, etc. and to manage dependencies.
The minimum required Maven version is 3.0.0.
Note that there are some [compatibility issues with Maven 3.X](https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Compatibility+Notes)
still unsolved. This is specially true for the ['site' plugin](https://maven.apache.org/plugins-archives/maven-site-plugin-3.3/maven-3.html).
## Full Release
The full release uses `gitbook` to build a static website from the documentation, if you don't have `gitbook` installed
then you can build the distribution without docs (see below) or install `gitbook` using `npm`:
$ npm install -g gitbook gitbook-cli
If you don't have `npm` installed then you would need to install it first.
#### Install npm On Fedora
$ yum install npm
#### Install npm On Mac-OS
The easiest way would be through brew [brew]
You first install brew using the instructions on the [brew] website.
After you installed brew you can install npm by:
brew install npm
[brew]: <http://brew.sh>
To build the full release with documentation, Javadocs, and the full web site:
$ mvn -Prelease package
To install it to your local maven repo:
$ mvn -Prelease install
## Build the distribution without docs
It is possible to build a distribution with out the manuals and Javadocs if you don't have or want `gitbook` installed,
simply run
$ mvn package

View File

@ -0,0 +1,164 @@
# Working with the Code
While the canonical Apache ActiveMQ Artemis git repository is hosted on Apache hardware at https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git
the developers use a mirror on GitHub for collaboration and pull-request review functionality.
## Initial Steps
1. Create a github account if you don't have one already
http://github.com
1. Fork the apache-artemis repository into your account
https://github.com/apache/activemq-artemis
1. Clone your newly forked copy onto your local workspace:
$ git clone git@github.com:<your-user-name>/activemq-artemis.git
Cloning into 'activemq-artemis'...
remote: Counting objects: 63800, done.
remote: Compressing objects: 100% (722/722), done.
remote: Total 63800 (delta 149), reused 0 (delta 0), pack-reused 62748
Receiving objects: 100% (63800/63800), 18.28 MiB | 3.16 MiB/s, done.
Resolving deltas: 100% (28800/28800), done.
Checking connectivity... done.
$ cd activemq-artemis
1. Add a remote reference to `upstream` for pulling future updates
$ git remote add upstream https://github.com/apache/activemq-artemis
1. Build with Maven
Typically developers will want to build using the `dev` profile which disables license and code style checks. For
example:
$ mvn -Pdev install
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ActiveMQ Artemis Parent ........................... SUCCESS [2.298s]
[INFO] ActiveMQ Artemis Commons .......................... SUCCESS [1.821s]
[INFO] ActiveMQ Artemis Selector Implementation .......... SUCCESS [0.767s]
[INFO] ActiveMQ Artemis Native POM ....................... SUCCESS [0.189s]
[INFO] ActiveMQ Artemis Journal .......................... SUCCESS [0.646s]
[INFO] ActiveMQ Artemis Core Client ...................... SUCCESS [5.969s]
[INFO] ActiveMQ Artemis JMS Client ....................... SUCCESS [2.110s]
[INFO] ActiveMQ Artemis Server ........................... SUCCESS [11.540s]
...
[INFO] ActiveMQ Artemis stress Tests ..................... SUCCESS [0.332s]
[INFO] ActiveMQ Artemis performance Tests ................ SUCCESS [0.174s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
## Typical development cycle
1. Identify a task (e.g. a bug to fix or feature to implement)
https://issues.apache.org/jira/browse/ACTIVEMQ6
1. Create a topic branch in your local git repo to do your work
$ git checkout -b my_cool_feature
1. Make the changes and commit one or more times
$ git commit
<a name="commitMessageDetails"></a> When you commit your changes you will need to supply a commit message. We follow the
50/72 git commit message format. An ActiveMQ Artemis commit message should be formatted in the following manner:
1. Add the ACTIVEMQ6 JIRA (if one exists) followed by a brief description of the change in the first line. This line
should be limited to 50 characters.
1. Insert a single blank line after the first line.
1. Provide a detailed description of the change in the following lines, breaking paragraphs where needed. These lines
should be wrapped at 72 characters.
An example correctly formatted commit message:
ACTIVEMQ6-123 Add new commit msg format to README
Adds a description of the new commit message format as well as examples
of well formatted commit messages to the README.md. This is required
to enable developers to quickly identify what the commit is intended to
do and why the commit was added.
1. Occasionally you'll want to push your commit(s) to GitHub for safe-keeping and/or sharing with others.
git push origin my_cool_feature
Note that git push references the branch you are pushing and defaults to `master`, not your working branch.
1. Discuss your planned changes (if you want feedback)
On mailing list - http://activemq.apache.org/mailing-lists.html
On IRC - irc://irc.freenode.org/apache-activemq or https://webchat.freenode.net/?channels=apache-activemq
1. Once you're finished coding your feature/fix then rebase your branch against the latest master (applies your patches
on top of master)
git fetch upstream
git rebase -i upstream/master
# if you have conflicts fix them and rerun rebase
# The -f, forces the push, alters history, see note below
git push -f origin my_cool_feature
The `rebase -i` triggers an interactive update which also allows you to combine commits, alter commit messages etc.
It's a good idea to make the commit log very nice for external consumption (e.g. by squashing all related commits
into a single commit. Note that rebasing and/or using `push -f` can alter history. While this is great for making a
clean patch, it is unfriendly to anyone who has forked your branch. Therefore you'll want to make sure that you
either work in a branch that you don't share, or if you do share it, tell them you are about to revise the branch
history (and thus, they will then need to rebase on top of your branch once you push it out).
1. Get your changes merged into upstream
1. Send a github pull request, by clicking the pull request link while in your repo's fork.
1. An email will automatically be sent to the ActiveMQ developer list.
1. As part of the review you may see an automated test run comment on your request.
1. After review a maintainer will merge your PR into the canonical git repository at which point those changes will
be synced with the GitHub mirror repository (i.e. your `master`) and your PR will be closed by the `asfgit` bot.
## Other common tasks
1. Pulling updates from upstream
$ git pull --rebase upstream master
(`--rebase` will automatically move your local commits, if any, on top of the latest branch you pull from; you can leave
it off if you do not have any local commits).
One last option, which some prefer, is to avoid using pull altogether, and just use fetch + rebase (this is of course
more typing). For example:
$ git fetch upstream
$ git pull
1. Pushing pulled updates (or local commits if you aren't using topic branches) to your private github repo (origin)
$ git push
Counting objects: 192, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (44/44), done.
Writing objects: 100% (100/100), 10.67 KiB, done.
Total 100 (delta 47), reused 100 (delta 47)
To git@github.com:<your-user-name>/apache-artemis.git
3382570..1fa25df master -> master
You might need to say -f to force the changes.
## Adding New Dependencies
Due to incompatibilities between some open source licenses and the Apache v2.0 license (that this project is licensed under)
care must be taken when adding new dependencies to the project. The Apache Software Foundation 3rd party licensing
policy has more information here: http://www.apache.org/legal/3party.html
To keep track of all licenses in ActiveMQ Artemis, new dependencies must be added in either the top level pom.xml or in test/pom.xml
(depending on whether this is a test only dependency or if it is used in the main code base). The dependency should be
added under the dependency management section with version and labelled with a comment highlighting the license for the
dependency version. See existing dependencies in the main pom.xml for examples. The dependency can then be added to
individual ActiveMQ Artemis modules *without* the version specified (the version is implied from the dependency management
section of the top level pom). This allows ActiveMQ Artemis developers to keep track of all dependencies and licenses.

View File

@ -0,0 +1,11 @@
# Code Formatting
Eclipse code formatting and (basic) project configuration files can be found at the `etc/` folder. You should manually
copy them _after importing all your projects_:
for settings_dir in `find . -type d -name .settings`; do
\cp -v etc/org.eclipse.jdt.* $settings_dir
done
Do not use the [maven-eclipse-plugin](https://maven.apache.org/plugins/maven-eclipse-plugin/) to copy the files as it
conflicts with [m2e](http://eclipse.org/m2e/).

View File

@ -0,0 +1,79 @@
# IDE Integration
## IntelliJ IDEA
### Importing the Project
The following steps show how to import ActiveMQ Artemis source into IntelliJ IDEA and setup the correct maven profile to allow
running of JUnit tests from within the IDE. (Steps are based on version: 13.1.4)
* File --> Import Project --> Select the root directory of the ActiveMQ Artemis source folder. --> Click OK
This should open the import project wizard. From here:
* Select "Import from existing model" toggle box, then select Maven from the list box below. Click Next.
* Leave the defaults set on this page and click next.
* On the "Select profiles page", select the checkbox next to "dev" and click next.
* From here the default settings should suffice. Continue through the wizard, clicking next until the wizard is complete.
Once the project has been imported and IDEA has caught up importing all the relevant dependencies, you should be able to
run JUnit tests from with the IDE. Select any test class in the tests -> integration tests folder. Right click on the
class in the project tab and click "Run <classname>". If the "Run <classname>" option is present then you're all set to go.
### Style Templates for Idea
We have shared the style templates that are good for this project. If you want to apply them use these steps:
* File->Import Settings
* Select the file under ./artemis-cloned-folder/etc/IDEA-style.jar
* Select both Code Style Templates and File templates (it's the default option)
* Select OK and restart Idea
### Issue: My JUnit tests are not runnable with in the IDE.
If the "Run <classname>" or "Run all tests" option is not present. It is likely that the default profile has not been
imported properly. To (re)import the "tests" Maven profile in an existing project.
* Open the Maven Projects Tool Window: View -> Tool Windows -> Maven Projects
* Select the "profiles" drop down
* Unselect then reselect the checkbox next to "tests".
* Click on the "Reimport all maven projects" button in the top left hand corner of the window. (It looks like a ciruclar
blue arrow.
* Wait for IDEA to reload and try running a JUnit test again. The option to run should now be present.
## Eclipse
We recommend using Eclipse Kepler (4.3), due to the built-in support for Maven and Git. Note that there are still some
Maven plugins used by sub-projects (e.g. documentation) which are not supported even in Eclipse Kepler (4.3).
Eclipse [m2e](http://eclipse.org/m2e/) is already included in "Eclipse IDE for Java Developers", or it can be installed
from [Eclipse Kepler release repository](http://download.eclipse.org/releases/kepler).
### Annotation Pre-Processing
ActiveMQ Artemis uses [JBoss Logging](https://community.jboss.org/wiki/JBossLoggingTooling) and that requires source
code generation from Java annotations. In order for it to 'just work' in Eclipse you need to install the
_Maven Integration for Eclipse JDT Annotation Processor Toolkit_ [m2e-apt](https://github.com/jbosstools/m2e-apt). See
this [JBoss blog post](https://community.jboss.org/en/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out)
for details.
### M2E Connector for Javacc-Maven-Plugin
Eclipse Indigo (3.7) has out-of-the-box support for it.
As of this writing, Eclipse Kepler (4.3) still lacks support for Maven's javacc plugin. The available [m2e connector for
javacc-maven-plugin](https://github.com/objectledge/maven-extensions) requires a downgrade of Maven components to be
installed. manual installation instructions (as of this writing you need to use the development update site). See
[this post](http://dev.eclipse.org/mhonarc/lists/m2e-users/msg02725.html) for how to do this with Eclipse Juno (4.2).
The current recommended solution for Eclipse Kepler is to mark `javacc-maven-plugin` as ignored by Eclipse, run Maven
from the command line and then modify the project `activemq-core-client` adding the folder
`target/generated-sources/javacc` to its build path.
### Use _Project Working Sets_
Importing all ActiveMQ Artemis subprojects will create _too many_ projects in Eclipse, cluttering your _Package Explorer_
and _Project Explorer_ views. One way to address that is to use
[Eclipse's Working Sets](http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fcworkset.htm)
feature. A good introduction to it can be found at a
[Dzone article on Eclipse Working Sets](http://eclipse.dzone.com/articles/categorise-projects-package).

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,90 @@
# Notes for Maintainers
Core ActiveMQ Artemis members have write access to the Apache ActiveMQ Artemis repositories and will be responsible for
acknowledging and pushing commits contributed via pull requests on GitHub.
## Commit Messages
Please ensure the commit messages follow the 50/72 format as described [here](code.md#commitMessageDetails).
## Configuring git repositories
Aside from the traditional `origin` and `upstream` repositories committers will need an additional reference for the
canonical Apache git repository where they will be merging and pushing pull-requests. For the purposes of this document,
let's assume these ref/repo associations already exist as described in the [Working with the Code](code.md) section:
- `origin` : https://github.com/(your-user-name)/activemq-artemis.git
- `upstream` : https://github.com/apache/activemq-artemis
1. Add the canonical Apache repository as a remote. Here we call it `apache`.
$ git remote add apache https://git-wip-us.apache.org/repos/asf/activemq-artemis.git
1. Add the following section to your <artemis-repo>/.git/config statement to fetch all pull requests sent to the GitHub
mirror. We are using `upstream` as the remote repo name (as noted above), but the remote repo name may be different
if you choose. Just be sure to edit all references to the remote repo name so it's consistent.
[remote "upstream"]
url = git@github.com:apache/activemq-artemis.git
fetch = +refs/heads/*:refs/remotes/upstream/*
fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*
## Merging and pushing pull requests
Here are the basic commands to retrieve pull requests, merge, and push them to the canonical Apache repository:
1. Download all the remote branches etc... including all the pull requests.
$ git fetch --all
Fetching origin
Fetching upstream
remote: Counting objects: 566, done.
remote: Compressing objects: 100% (188/188), done.
remote: Total 566 (delta 64), reused 17 (delta 17), pack-reused 351
Receiving objects: 100% (566/566), 300.67 KiB | 0 bytes/s, done.
Resolving deltas: 100% (78/78), done.
From github.com:apache/activemq-artemis
* [new ref] refs/pull/105/head -> upstream/pr/105
1. Checkout the pull request you wish to review
$ git checkout pr/105
1. Once you've reviewed the change and are ready to merge checkout `master`.
$ git checkout master
1. Ensure you are up to date
$ git pull
1. Create a new merge commit from the pull-request. IMPORTANT: The commit message here should be something like: "This
closes #105" where "105" is the pull request ID. The "#105" shows up as a link in the GitHub UI for navigating to
the PR from the commit message.
$ git merge --no-ff pr/105
1. Push to the canonical Apache repo.
$ git push apache master
#### Notes:
The GitHub mirror repository (i.e. `upstream`) is cloning the canonical Apache repository. Because of this there may be
a slight delay between when a commit is pushed to the Apache repo and when that commit is reflected in the GitHub mirror.
This may cause some difficulty when trying to push a PR to `apache` that has been merged on the out-of-date GitHub mirror.
You can wait for the mirror to update before performing the steps above or you can change your local master branch to
track the master branch on the canonical Apache repository rather than the master branch on the GitHub mirror:
$ git branch master -u apache/master
Where `apache` points to the canonical Apache repository.
If you'd like your local master branch to always track `upstream/master` (i.e. the GitHub mirror) then another way to
achieve this is to add another branch that tracks `apache/master` and push from that branch e.g.
$ git checkout master
$ git branch apache_master --track apache/master
$ git pull
$ git merge --no-ff pr/105
$ git push

View File

@ -0,0 +1,17 @@
Legal Notice
============
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.

View File

@ -0,0 +1,15 @@
# Tests
To run the unit tests:
$ mvn -Ptests test
Generating reports from unit tests:
$ mvn install site
Running tests individually
$ mvn -Ptests -DfailIfNoTests=false -Dtest=<test-name> test
where &lt;test-name> is the name of the Test class without its package name

View File

@ -949,8 +949,8 @@
<exclude>**/*.txt</exclude>
<exclude>**/*.md</exclude>
<exclude>etc/org.eclipse.*</exclude>
<exclude>docs/user-manual/en/*.json</exclude>
<exclude>docs/user-manual/en/_book/</exclude>
<exclude>docs/**/*.json</exclude>
<exclude>docs/**/_book/</exclude>
<exclude>**/target/</exclude>
<exclude>**/META-INF/services/*</exclude>
<exclude>**/*.iml</exclude>