Skip to content

Commit c39cec1

Browse files
committed
Initial port from Clojure to Java 8
1 parent 5078316 commit c39cec1

34 files changed

Lines changed: 1025 additions & 875 deletions

.gitignore

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
*jar
2-
/lib
3-
/classes
4-
/native
5-
/.lein-failures
6-
/checkouts
7-
/.lein-deps-sum
8-
/.lein-plugins
9-
/target
10-
*iml
11-
/.idea
12-
1+
.idea/
2+
target/

LICENSE

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
Eclipse Public License - v 1.0
2+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
3+
ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
4+
THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
5+
6+
1. DEFINITIONS
7+
8+
"Contribution" means:
9+
10+
a) in the case of the initial Contributor, the initial code and documentation
11+
distributed under this Agreement, and
12+
13+
b) in the case of each subsequent Contributor:
14+
15+
i) changes to the Program, and
16+
17+
ii) additions to the Program;
18+
19+
where such changes and/or additions to the Program originate from and are
20+
distributed by that particular Contributor. A Contribution 'originates'
21+
from a Contributor if it was added to the Program by such Contributor itself
22+
or anyone acting on such Contributor's behalf. Contributions do not include
23+
additions to the Program which: (i) are separate modules of software
24+
distributed in conjunction with the Program under their own license agreement,
25+
and (ii) are not derivative works of the Program.
26+
27+
"Contributor" means any person or entity that distributes the Program.
28+
29+
"Licensed Patents" mean patent claims licensable by a Contributor which are
30+
necessarily infringed by the use or sale of its Contribution alone or when
31+
combined with the Program.
32+
33+
"Program" means the Contributions distributed in accordance with this Agreement.
34+
35+
"Recipient" means anyone who receives the Program under this Agreement,
36+
including all Contributors.
37+
38+
2. GRANT OF RIGHTS
39+
40+
a) Subject to the terms of this Agreement, each Contributor hereby grants
41+
Recipient a non-exclusive, worldwide, royalty-free copyright license to
42+
reproduce, prepare derivative works of, publicly display, publicly perform,
43+
distribute and sublicense the Contribution of such Contributor, if any, and
44+
such derivative works, in source code and object code form.
45+
46+
b) Subject to the terms of this Agreement, each Contributor hereby grants
47+
Recipient a non-exclusive, worldwide, royalty-free patent license under
48+
Licensed Patents to make, use, sell, offer to sell, import and otherwise
49+
transfer the Contribution of such Contributor, if any, in source code and
50+
object code form. This patent license shall apply to the combination of the
51+
Contribution and the Program if, at the time the Contribution is added by the
52+
Contributor, such addition of the Contribution causes such combination to be
53+
covered by the Licensed Patents. The patent license shall not apply to any
54+
other combinations which include the Contribution. No hardware per se is
55+
licensed hereunder.
56+
57+
c) Recipient understands that although each Contributor grants the licenses to
58+
its Contributions set forth herein, no assurances are provided by any
59+
Contributor that the Program does not infringe the patent or other intellectual
60+
property rights of any other entity. Each Contributor disclaims any liability
61+
to Recipient for claims brought by any other entity based on infringement of
62+
intellectual property rights or otherwise. As a condition to exercising the
63+
rights and licenses granted hereunder, each Recipient hereby assumes sole
64+
responsibility to secure any other intellectual property rights needed, if any.
65+
For example, if a third party patent license is required to allow Recipient to
66+
distribute the Program, it is Recipient's responsibility to acquire that
67+
license before distributing the Program.
68+
69+
d) Each Contributor represents that to its knowledge it has sufficient
70+
copyright rights in its Contribution, if any, to grant the copyright
71+
license set forth in this Agreement.
72+
73+
3. REQUIREMENTS
74+
75+
A Contributor may choose to distribute the Program in object code form under
76+
its own license agreement, provided that:
77+
78+
a) it complies with the terms and conditions of this Agreement; and
79+
80+
b) its license agreement:
81+
82+
i) effectively disclaims on behalf of all Contributors all warranties and
83+
conditions, express and implied, including warranties or conditions of title
84+
and non-infringement, and implied warranties or conditions of merchantability
85+
and fitness for a particular purpose;
86+
87+
ii) effectively excludes on behalf of all Contributors all liability for
88+
damages, including direct, indirect, special, incidental and consequential
89+
damages, such as lost profits;
90+
91+
iii) states that any provisions which differ from this Agreement are offered by
92+
that Contributor alone and not by any other party; and
93+
94+
iv) states that source code for the Program is available from such Contributor,
95+
and informs licensees how to obtain it in a reasonable manner on or through a
96+
medium customarily used for software exchange.
97+
98+
When the Program is made available in source code form:
99+
100+
a) it must be made available under this Agreement; and
101+
102+
b) a copy of this Agreement must be included with each copy of the Program.
103+
104+
Contributors may not remove or alter any copyright notices contained within the
105+
Program.
106+
107+
Each Contributor must identify itself as the originator of its Contribution, if
108+
any, in a manner that reasonably allows subsequent Recipients to identify the
109+
originator of the Contribution.
110+
111+
4. COMMERCIAL DISTRIBUTION
112+
113+
Commercial distributors of software may accept certain responsibilities with
114+
respect to end users, business partners and the like. While this license is
115+
intended to facilitate the commercial use of the Program, the Contributor who
116+
includes the Program in a commercial product offering should do so in a manner
117+
which does not create potential liability for other Contributors. Therefore, if
118+
a Contributor includes the Program in a commercial product offering, such
119+
Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
120+
every other Contributor ("Indemnified Contributor") against any losses, damages
121+
and costs (collectively "Losses") arising from claims, lawsuits and other legal
122+
actions brought by a third party against the Indemnified Contributor to the
123+
extent caused by the acts or omissions of such Commercial Contributor in
124+
connection with its distribution of the Program in a commercial product
125+
offering. The obligations in this section do not apply to any claims or Losses
126+
relating to any actual or alleged intellectual property infringement. In
127+
order to qualify, an Indemnified Contributor must: a) promptly notify the
128+
Commercial Contributor in writing of such claim, and b) allow the Commercial
129+
Contributor to control, and cooperate with the Commercial Contributor in, the
130+
defense and any related settlement negotiations. The Indemnified Contributor
131+
may participate in any such claim at its own expense.
132+
133+
For example, a Contributor might include the Program in a commercial product
134+
offering, Product X. That Contributor is then a Commercial Contributor. If that
135+
Commercial Contributor then makes performance claims, or offers warranties
136+
related to Product X, those performance claims and warranties are such
137+
Commercial Contributor's responsibility alone. Under this section, the
138+
Commercial Contributor would have to defend claims against the other
139+
Contributors related to those performance claims and warranties, and if a court
140+
requires any other Contributor to pay any damages as a result, the Commercial
141+
Contributor must pay those damages.
142+
143+
5. NO WARRANTY
144+
145+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
146+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
147+
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
148+
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
149+
Each Recipient is solely responsible for determining the appropriateness of
150+
using and distributing the Program and assumes all risks associated with its
151+
exercise of rights under this Agreement , including but not limited to the
152+
risks and costs of program errors, compliance with applicable laws, damage to
153+
or loss of data, programs or equipment, and unavailability or interruption of
154+
operations.
155+
156+
6. DISCLAIMER OF LIABILITY
157+
158+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
159+
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
160+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
161+
LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
162+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
163+
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
164+
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
165+
POSSIBILITY OF SUCH DAMAGES.
166+
167+
7. GENERAL
168+
169+
If any provision of this Agreement is invalid or unenforceable under applicable
170+
law, it shall not affect the validity or enforceability of the remainder of the
171+
terms of this Agreement, and without further action by the parties hereto, such
172+
provision shall be reformed to the minimum extent necessary to make such
173+
provision valid and enforceable.
174+
175+
If Recipient institutes patent litigation against any entity (including a
176+
cross-claim or counterclaim in a lawsuit) alleging that the Program itself
177+
(excluding combinations of the Program with other software or hardware)
178+
infringes such Recipient's patent(s), then such Recipient's rights granted
179+
under Section 2(b) shall terminate as of the date such litigation is filed.
180+
181+
All Recipient's rights under this Agreement shall terminate if it fails to
182+
comply with any of the material terms or conditions of this Agreement and does
183+
not cure such failure in a reasonable period of time after becoming aware of
184+
such noncompliance. If all Recipient's rights under this Agreement terminate,
185+
Recipient agrees to cease use and distribution of the Program as soon as
186+
reasonably practicable. However, Recipient's obligations under this Agreement
187+
and any licenses granted by Recipient relating to the Program shall continue
188+
and survive.
189+
190+
Everyone is permitted to copy and distribute copies of this Agreement, but in
191+
order to avoid inconsistency the Agreement is copyrighted and may only be
192+
modified in the following manner. The Agreement Steward reserves the right to
193+
publish new versions (including revisions) of this Agreement from time to time.
194+
No one other than the Agreement Steward has the right to modify this Agreement.
195+
The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation
196+
may assign the responsibility to serve as the Agreement Steward to a suitable
197+
separate entity. Each new version of the Agreement will be given a
198+
distinguishing version number. The Program (including Contributions) may always
199+
be distributed subject to the version of the Agreement under which it was
200+
received. In addition, after a new version of the Agreement is published,
201+
Contributor may elect to distribute the Program (including its Contributions)
202+
under the new version. Except as expressly stated in Sections 2(a) and 2(b)
203+
above, Recipient receives no rights or licenses to the intellectual property of
204+
any Contributor under this Agreement, whether expressly, by implication,
205+
estoppel or otherwise. All rights in the Program not expressly granted under
206+
this Agreement are reserved.
207+
208+
This Agreement is governed by the laws of the State of New York and the
209+
intellectual property laws of the United States of America. No party to this
210+
Agreement will bring a legal action under this Agreement more than one year
211+
after the cause of action arose. Each party waives its rights to a jury trial
212+
in any resulting litigation.

README.md

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# buildversion-maven-plugin
1+
# Build Version Maven Plugin
2+
3+
[![Java 8](https://img.shields.io/badge/java-8-blue.svg)](https://adoptopenjdk.net/)
4+
[![License](https://img.shields.io/badge/license-EPL%201.0-blue.svg)](https://www.eclipse.org/legal/epl/epl-v10.html)
5+
6+
**NOTE** This is a port from Clojure to Java of the original code from: https://github.com/code54/buildversion-plugin
27

38
This is a maven plugin that extracts current build information from git
49
projects, including: the latest commit hash, timestamp, most recent tag, number
@@ -43,27 +48,6 @@ By default, the plugin runs on Maven's `initialize` phase. Any plugin running af
4348
* `build-tstamp`: A date and time stamp of the current commit (HEAD). The pattern is configurable. Example: `20120407001823`.
4449

4550

46-
*Note:* `buildversion-plugin` is currently hosted at the `oss.sonatype.org` maven
47-
repository, and may depend on artifacts on the Clojars repository. You'd need to
48-
add these repos to your `settings.xml` or your project `pom.xml`. Example:
49-
50-
```xml
51-
<pluginRepositories>
52-
<pluginRepository>
53-
<id>sonatype-releases</id>
54-
<url>http://oss.sonatype.org/content/repositories/releases</url>
55-
</pluginRepository>
56-
57-
<!-- If you want to try SNAPSHOT versions, you need Sonatype's snapshots repo: -->
58-
<pluginRepository>
59-
<id>sonatype-snapshots</id>
60-
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
61-
</pluginRepository>
62-
</pluginRepositories>
63-
64-
```
65-
66-
6751
## Configuration Parameters
6852

6953
<table>
@@ -85,7 +69,7 @@ add these repos to your `settings.xml` or your project `pom.xml`. Example:
8569
<tr>
8670
<td>customProperties</td>
8771
<td>-</td>
88-
<td>Optional. A Clojure snippet of code you may specify in order to modify or create new properties. The code must evaluate to a Map. The name of the keys in the Map become Maven properties on the project. For convenience, for each `build-*` property you have a local variable with the same name already defined for you. See below for an example.</td>
72+
<td>Optional. A Groovy snippet of code you may specify in order to modify or create new properties. The code must evaluate to a Map. The name of the keys in the Map become Maven properties on the project. For convenience, for each `build-*` property you have a local variable with the same name already defined for you. See below for an example.</td>
8973
</tr>
9074
</table>
9175

@@ -138,40 +122,8 @@ Reference:
138122
* [GIT mailing list discussion](http://kerneltrap.org/mailarchive/git/2010/9/21/40071/thread) about `git describe`'s logic and lack of `--first-parent`.
139123
* Here's a [working patch to add `--first-parent` to `git describe`](https://github.com/git/git/tree/mrb/describe-first-parent)
140124

141-
## Future
142-
143-
Some ideas:
144-
145-
* Find a way to inject the project version from git tags into the project's
146-
pom. The goal is to stop maintaining the project version inside
147-
`pom.xml`: just leave the pom version fixed at 0.0.0 and let the plugin infer it from
148-
git. We tried the obvious: calling project.setVersion(), but some Maven phases
149-
still "see" the version that is in the `pom.xml` file. Need to research
150-
further.
151-
* Expose more configuration options (like, the pattern to match candidate tags)
152-
* Add a mechanism for the plugin to generate a properties file (or, better, any
153-
file from a template)
154-
* Support for other repos? (SVN, git-svn, mercurial)
155-
156125
## FAQ
157126

158127
* Why don't you just use `buildnumber-maven-plugin`?
159128
Because it does not provide information about tagging and number of commits
160129
since tag. See "About git-describe" above for details.
161-
162-
* Why is it implemented in Clojure?
163-
Because I like the language and wanted to test its Java interoperability. I
164-
thought a Maven plugin was a good test-bed given that it's very Java-centric,
165-
including custom annotations, custom classloaders, and a DI container
166-
(Plexus) for Java objects.
167-
168-
## Acknowledgments
169-
170-
Thanks to Hugo Duncan for his work on
171-
[clojure-maven](https://github.com/pallet/clojure-maven) and accepting my
172-
[`defmojo`](https://github.com/pallet/clojure-maven/commit/1e41d02d32ec3430925765b2a88e2fce89d96307)
173-
addition. He did the heavy-lifting to integrate Clojure with Maven and Plexus.
174-
175-
## License
176-
Licensed under the [Eclipse Public License](http://www.eclipse.org/legal/epl-v10.html).
177-
Copyright 2012 Fernando Dobladez & Code54 S.A. (http://code54.com)

ReleaseNotes.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)