From a06cd8f04ce4fed80d9fa1197c222bafb4624e41 Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Sun, 14 Nov 2010 22:11:49 +0100 Subject: first commit --- .../src/site/apt/examples/checking-version.apt.vm | 251 +++++++++++++++++++++ enforcer-rule/src/site/apt/index.apt | 37 +++ enforcer-rule/src/site/apt/usage.apt.vm | 84 +++++++ enforcer-rule/src/site/site.xml | 34 +++ 4 files changed, 406 insertions(+) create mode 100644 enforcer-rule/src/site/apt/examples/checking-version.apt.vm create mode 100644 enforcer-rule/src/site/apt/index.apt create mode 100644 enforcer-rule/src/site/apt/usage.apt.vm create mode 100644 enforcer-rule/src/site/site.xml (limited to 'enforcer-rule/src/site') diff --git a/enforcer-rule/src/site/apt/examples/checking-version.apt.vm b/enforcer-rule/src/site/apt/examples/checking-version.apt.vm new file mode 100644 index 0000000..f86c745 --- /dev/null +++ b/enforcer-rule/src/site/apt/examples/checking-version.apt.vm @@ -0,0 +1,251 @@ +#* + * This software is licensed under the Apache 2 license, quoted below. + * + * Copyright 2010 Julien Eluard + * + * Licensed 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. + *# + +Checking a project's version against older releases + +* Basic example + + In order to check your project's version against an older release, you must add the enforcer rule as a dependency to + the maven-enforcer-plugin and then configure your the maven-enforcer-plugin to run the rule: + +--- + + ... + + ... + + ... + + maven-enforcer-plugin + 1.0-beta-1 + ... + + ... + + ${project.groupId} + ${project.artifactId} + ${project.version} + + ... + + ... + + .... + + check-version + verify + + enforce + + + + + ... + 1.0.0 + ... + + + + + ... + + ... + + ... + + ... + + ... + +--- + + Once you have configured your project with details of the previous version to check, maven-enforcer will be able to + throw a build error if current version is not backward compatible with previous one. + +* Including classes + + By default all classes will be considered during checking process. You might want to only check a subset of classes/packages. This is achieved by specifying <<>>. + +--- + + ... + + ... + + ... + + maven-enforcer-plugin + 1.0-beta-1 + ... + + ... + + ${project.groupId} + ${project.artifactId} + ${project.version} + + ... + + ... + + .... + + check-version + verify + + enforce + + + + + ... + 1.0.0 + + org.project.MyClass + + ... + + + + + ... + + ... + + ... + + ... + + ... + +--- + + We can specify multiple classes or packages. For example, to include <<>> class and <<>> package you would use a configuration like: + +--- + + ... + + ... + + ... + + maven-enforcer-plugin + 1.0-beta-1 + ... + + ... + + ${project.groupId} + ${project.artifactId} + ${project.version} + + ... + + ... + + .... + + check-version + verify + + enforce + + + + + ... + 1.0.0 + + org.project.MyClass + org.project.internal + + ... + + + + + ... + + ... + + ... + + ... + + ... + +--- + +* Excluding classes + + You may also want to exclude some classes/packages. For instance internal code might evolve independently from published API. This is achieved by specifying <<>>. + +--- + + ... + + ... + + ... + + maven-enforcer-plugin + 1.0-beta-1 + ... + + ... + + ${project.groupId} + ${project.artifactId} + ${project.version} + + ... + + ... + + .... + + check-version + verify + + enforce + + + + + ... + 1.0.0 + + org.project.MyClass + + ... + + + + + ... + + ... + + ... + + ... + + ... + +--- \ No newline at end of file diff --git a/enforcer-rule/src/site/apt/index.apt b/enforcer-rule/src/site/apt/index.apt new file mode 100644 index 0000000..ff30f76 --- /dev/null +++ b/enforcer-rule/src/site/apt/index.apt @@ -0,0 +1,37 @@ +~~ +~~ This software is licensed under the Apache 2 license, quoted below. +~~ +~~ Copyright 2010 Julien Eluard +~~ +~~ Licensed 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. +~~ + +Semantic Versioning Enforcer Rule + + The Semantic Versioning Enforcer Rule is used to check your classes against previously released classes. + Depending on changes your version number will be valid or not according to {{{http://semver.org}semantic versioning}} rules. + +* Rules Overview + + The Semantic Versioning Enforcer Rule has the following rule. + + * <<>> checks a project version number against an older release. + +* Examples + + To provide you with better understanding of some usages of Semantic Versioning Enforcer Rule, + you can take a look into the following example: + + * {{{examples/checking-version.html}Checking a project's version against an older release}} + + [] \ No newline at end of file diff --git a/enforcer-rule/src/site/apt/usage.apt.vm b/enforcer-rule/src/site/apt/usage.apt.vm new file mode 100644 index 0000000..b1491a9 --- /dev/null +++ b/enforcer-rule/src/site/apt/usage.apt.vm @@ -0,0 +1,84 @@ +#* + * This software is licensed under the Apache 2 license, quoted below. + * + * Copyright 2010 Julien Eluard + * + * Licensed 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. + *# + +Usage + + The enforcer rule offers a rule for checking project's version against a previously released artifact. + +* Basic Usage + +** Checking a project's version + + In order to check your project's version, you must add the enforcer rule as a dependency to + the maven-enforcer-plugin and then configure the maven-enforcer-plugin to run the rule: + +--- + + ... + + ... + + ... + + maven-enforcer-plugin + 1.0-beta-1 + ... + + ... + + ${project.groupId} + ${project.artifactId} + ${project.version} + + ... + + ... + + .... + + check + verify + + enforce + + + + + ... + 1.0.0 + ... + + + + + ... + + ... + + ... + + ... + + ... + +--- + + Once you have configured your project with details of the previous version to check, maven-enforcer will be able to + throw a build error if current version is not backward compatible with previous one. + + Some more detailed {{{examples/checking-version.html}examples}} of the <<>> rule. \ No newline at end of file diff --git a/enforcer-rule/src/site/site.xml b/enforcer-rule/src/site/site.xml new file mode 100644 index 0000000..6320bdf --- /dev/null +++ b/enforcer-rule/src/site/site.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + -- cgit v1.2.3