CONTRIBUTING.md 2.94 KB
Newer Older
cdanger's avatar
cdanger committed
1
## Contributing
Cyril Dangerville's avatar
Cyril Dangerville committed
2
3
4
5
6
7
### Coding Rules
Follow these Java coding guidelines:
* [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html), except braces must follow the Allman style instead of K & R style;
* *Effective Java, Second Edition*, by Joshua Bloch;
* [Oracle Secure Coding Guidelines for Java SE](http://www.oracle.com/technetwork/java/seccodeguide-139067.html).

Cyril Dangerville's avatar
Cyril Dangerville committed
8
### Testing
9
For every new major functionality, there must be unit tests added to some unit test class that is part of the automated test suite of [pdp-engine's MainTest.java](pdp-engine/src/test/java/org/ow2/authzforce/core/pdp/impl/test/MainTest.java). If the functionality has any impact on XACML - any Request/Response/Policy(Set) element - processing and/or change XACML standard conformance in any way, make sure you add relevant integration and/or conformance tests to the test suite run by [pdp-testutils's MainTest.java](pdp-testutils/src/test/java/org/ow2/authzforce/core/pdp/testutil/test/MainTest.java).
Cyril Dangerville's avatar
Cyril Dangerville committed
10

Cyril Dangerville's avatar
Cyril Dangerville committed
11
12
13
14
15
16
17
18
19
20
21
22
You may run the tests as follows from your local copy of the repository:
<pre><code>
    $ mvn test
</code></pre>

### Building the project

You may build the project and generate the JAR as follows from your local copy of the repository:
<pre><code>
    $ mvn package
</code></pre>

23
24
Note that you must use Java 8 to run Maven when building the project.

Cyril Dangerville's avatar
Cyril Dangerville committed
25
### Dependency management
cdanger's avatar
cdanger committed
26
No SNAPSHOT dependencies allowed on "develop" and "master" branches.
cdanger's avatar
cdanger committed
27

cdanger's avatar
cdanger committed
28
### Releasing
29
1. From the develop branch, prepare a release (example using an HTTP proxy):
cdanger's avatar
cdanger committed
30
<pre><code>
31
    $ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 jgitflow:release-start
cdanger's avatar
cdanger committed
32
33
</code></pre>
1. Update the CHANGELOG according to keepachangelog.com.
cdanger's avatar
cdanger committed
34
35
2. To perform the release (example using an HTTP proxy):
   <pre><code>
36
    $ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 jgitflow:release-finish
cdanger's avatar
cdanger committed
37
   </code></pre>
cdanger's avatar
cdanger committed
38
    If, after deployment, the command does not succeed because of some issue with the branches. Fix the issue, then re-run the same command but with 'noDeploy' option set to true to avoid re-deployment:
cdanger's avatar
cdanger committed
39
   <pre><code>
40
    $ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 -DnoDeploy=true jgitflow:release-finish
cdanger's avatar
cdanger committed
41
42
43
44
45
46
47
   </code></pre>
   More info on jgitflow: http://jgitflow.bitbucket.org/
3. Connect and log in to the OSS Nexus Repository Manager: https://oss.sonatype.org/
4. Go to Staging Profiles and select the pending repository authzforce-*... you just uploaded with `jgitflow:release-finish`
5. Click the Release button to release to Maven Central.
6. Create a new Release on GitHub (copy-paste the description from previous releases and update the versions)
7. If the [PDP configuration XSD](pdp-engine/src/main/resources/pdp.xsd) has changed with the new release, publish the new schema document in HTML form on https://authzforce.github.io (example for XSD version 8.1) by following the instructions here: https://github.com/authzforce/authzforce.github.io#generating-documentation-for-pdp-configuration-xsd .