Skip to content

Commit af7c76a

Browse files
committed
Merge tag 'v1.0.1'
[maven-release-plugin] copy for tag v1.0.1
2 parents 467555b + c16f218 commit af7c76a

20 files changed

Lines changed: 341 additions & 279 deletions

File tree

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Simply add `buildversion-plugin` to your pom, executing the `set-properties` goa
2323
<plugin>
2424
<groupId>com.code54.mojo</groupId>
2525
<artifactId>buildversion-plugin</artifactId>
26-
<version>1.0.0</version>
26+
<version>1.0.1</version>
2727
<executions>
2828
<execution>
2929
<goals><goal>set-properties</goal></goals>
@@ -50,14 +50,21 @@ add these repos to your `settings.xml` or your project `pom.xml`. Example:
5050
```xml
5151
<pluginRepositories>
5252
<pluginRepository>
53-
<id>sonatype-snapshots</id>
53+
<id>sonatype-releases</id>
5454
<url>http://oss.sonatype.org/content/repositories/releases</url>
5555
</pluginRepository>
5656
<pluginRepository>
5757
<id>clojars.org</id>
5858
<url>http://clojars.org/repo</url>
5959
</pluginRepository>
60+
61+
<!-- If you want to try SNAPSHOT versions, you need Sonatype's snapshots repo: -->
62+
<pluginRepository>
63+
<id>sonatype-snapshots</id>
64+
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
65+
</pluginRepository>
6066
</pluginRepositories>
67+
6168
```
6269

6370

@@ -69,6 +76,11 @@ add these repos to your `settings.xml` or your project `pom.xml`. Example:
6976
<th>Default</th>
7077
<th>Description</th>
7178
</tr>
79+
<tr>
80+
<td>gitCmd</td>
81+
<td>git</td>
82+
<td>Name for 'git' executable to use. You may specify an absolute pathname or a command in you "PATH".</td>
83+
</tr>
7284
<tr>
7385
<td>tstampFormat</td>
7486
<td>yyyyMMddHHmmss</td>
@@ -88,7 +100,7 @@ Example:
88100
<plugin>
89101
<groupId>com.code54.mojo</groupId>
90102
<artifactId>buildversion-plugin</artifactId>
91-
<version>1.0.0</version>
103+
<version>1.0.1</version>
92104
<executions>
93105
<execution>
94106
<goals><goal>set-properties</goal></goals>

ReleaseNotes.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Release Notes - buildversion-plugin
2+
3+
## v1.0.1
4+
5+
* New gitCmd option let's you specify location of 'git' command to use
6+
7+
* Does not depend on bash anymore
8+
9+
* Better error handling and logging when invoking git
10+
11+
* Fix: use ${basedir} instead of "." as location for git repo.
12+
This resolves problem when calling maven from within Eclipse.
13+
14+
15+
## v1.0.0 First release
16+
17+

TODO.org

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*** DONE write basic assertion (verify.sh) to validate Mojo's output
88
** DONE Clean up Mojo's output on execution.
99
** SOMEDAY Improve error handling? (need more test cases?)
10+
*** DONE Don't depend on bash
11+
*** DONE On debug (-X) print forked commands to stdout
12+
*** DONE On debug (-X) pring lines as they are processed by git-describe-log-lines
1013
** TODO Write example pom.xml/project (may be same as integration test?)
1114
*** add filtering of propeties file
1215
*** add field on jar MANIFEST
@@ -31,7 +34,7 @@
3134
* TODO Generalize protocol for potential non-git implementations
3235
** see https://github.com/Raynes/bultitude
3336
* SOMEDAY Learn more about Plexus and how Maven uses it
34-
* TODO Propose a defmojo macro for clojure-maven project?
37+
* Propose a defmojo macro for clojure-maven project?
3538
** DONE Implement
3639
(defmojo
3740
"This is an example Maven Plugin written in Clojure"

finish-release.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# finish the release after updating release notes
4+
5+
if [[ $# -lt 1 ]]; then
6+
echo "usage: $(basename $0) new-version" >&2
7+
exit 1
8+
fi
9+
10+
version=$1
11+
12+
echo "finish release of $version"
13+
14+
echo -n "commiting release notes and readme. enter to continue:" && read x \
15+
&& git add ReleaseNotes.md README.md \
16+
&& git commit -m "Updated release notes and readme for $version" \
17+
&& echo -n "Peform release. enter to continue:" && read x \
18+
&& mvn release:clean \
19+
&& mvn release:prepare -Dgpg.keyname=02FCB552 \
20+
&& mvn release:perform -Dgpg.keyname=02FCB552 \
21+
#&& mvn nexus:staging-close \
22+
#&& mvn nexus:staging-promote \
23+
&& git flow release finish -n $version
24+

pom.xml

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
43

54
<modelVersion>4.0.0</modelVersion>
65

@@ -12,7 +11,7 @@
1211

1312
<groupId>com.code54.mojo</groupId>
1413
<artifactId>buildversion-plugin</artifactId>
15-
<version>1.0.0</version>
14+
<version>1.0.1</version>
1615
<packaging>maven-plugin</packaging>
1716

1817
<name>buildversion-plugin</name>
@@ -36,14 +35,46 @@
3635
<connection>scm:git:git://github.com/code54/buildversion-plugin.git</connection>
3736
<developerConnection>scm:git:ssh://git@github.com:code54/buildversion-plugin.git</developerConnection>
3837
<url>https://github.com/code54/buildversion-plugin</url>
38+
<tag>v1.0.1</tag>
3939
</scm>
4040

4141
<properties>
42-
<!-- <clojureMaven.version>0.3.2-SNAPSHOT</clojureMaven.version> -->
43-
<clojureMaven.version>0.3.1</clojureMaven.version>
42+
<clojureMaven.version>0.3.2</clojureMaven.version>
4443
<maven.version>3.0.4</maven.version>
4544
</properties>
4645

46+
47+
<profiles>
48+
<profile>
49+
<id>release-sign-artifacts</id>
50+
<activation>
51+
<property>
52+
<name>performRelease</name>
53+
<value>true</value>
54+
</property>
55+
</activation>
56+
<build>
57+
<plugins>
58+
<plugin>
59+
<groupId>org.apache.maven.plugins</groupId>
60+
<artifactId>maven-gpg-plugin</artifactId>
61+
<version>1.1</version>
62+
<executions>
63+
<execution>
64+
<id>sign-artifacts</id>
65+
<phase>verify</phase>
66+
<goals>
67+
<goal>sign</goal>
68+
</goals>
69+
</execution>
70+
</executions>
71+
</plugin>
72+
</plugins>
73+
</build>
74+
</profile>
75+
</profiles>
76+
77+
4778
<build>
4879
<sourceDirectory>src/main/clojure</sourceDirectory>
4980
<resources>
@@ -149,6 +180,19 @@
149180
</initScript>
150181
</configuration>
151182
</plugin>
183+
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-release-plugin</artifactId>
187+
<version>2.3.2</version>
188+
<configuration>
189+
<tagNameFormat>v@{project.version}</tagNameFormat>
190+
<autoVersionSubmodules>true</autoVersionSubmodules>
191+
<localCheckout>true</localCheckout>
192+
<pushChanges>false</pushChanges>
193+
194+
</configuration>
195+
</plugin>
152196
</plugins>
153197

154198
</build>
@@ -168,11 +212,11 @@
168212
<scope>test</scope>
169213
</dependency>
170214

171-
<!-- <dependency> -->
172-
<!-- <groupId>org.cloudhoist</groupId> -->
173-
<!-- <artifactId>clojure-maven-mojo</artifactId> -->
174-
<!-- <version>${clojureMaven.version}</version> -->
175-
<!-- </dependency> -->
215+
<dependency>
216+
<groupId>org.cloudhoist</groupId>
217+
<artifactId>clojure-maven-mojo</artifactId>
218+
<version>${clojureMaven.version}</version>
219+
</dependency>
176220

177221
<dependency>
178222
<groupId>org.cloudhoist</groupId>

project.clj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
(defproject buildversion-maven-plugin "1.0.0"
1+
(defproject buildversion-maven-plugin/buildversion-maven-plugin "1.0.1-SNAPSHOT"
2+
:compile-path "/home/ferd/repos/buildversion-plugin/target/classes"
23
:dependencies [[org.clojure/clojure "1.3.0"]
3-
;[org.cloudhoist/clojure-maven-mojo-annotations "0.3.2-SNAPSHOT"]
4-
[org.cloudhoist/clojure-maven-mojo-annotations "0.3.1"]
5-
;[org.cloudhoist/clojure-maven-mojo "0.3.2-SNAPSHOT"]
6-
[org.cloudhoist/clojure-maven-mojo "0.3.1"]
4+
[org.cloudhoist/clojure-maven-mojo-annotations
5+
"0.3.2"]
6+
[org.cloudhoist/clojure-maven-mojo "0.3.2"]
77
[org.apache.maven/maven-plugin-api "3.0.3"]
88
[org.clojure/tools.trace "0.7.1"]
99
[conch "0.2.1"]]
10-
:dev-dependencies [[lein-swank "1.4.4"]
11-
[lein-pprint "1.1.1"]
12-
[radagast "1.1.0"]]
13-
14-
:source-path "src/main/clojure"
15-
:compile-path "target/classes"
16-
:library-path "target/dependency"
17-
:test-path "src/test/clojure"
18-
:resources-path "src/main/resource"
19-
:target-dir "target"
20-
)
10+
:source-paths ["src/main/clojure"]
11+
:jar-dir "/home/ferd/repos/buildversion-plugin/target"
12+
:profiles {:dev {:dependencies [[radagast "1.1.0"]]}}
13+
:repositories {"sonatype-releases"
14+
"http://oss.sonatype.org/content/repositories/releases"}
15+
:resource-paths ["src/main/resource"]
16+
:target-dir "/home/ferd/repos/buildversion-plugin/target"
17+
:min-lein-version "2.0.0"
18+
:plugins [[lein-swank "1.4.4"] [lein-pprint "1.1.1"]]
19+
:test-paths ["src/test/clojure"]
20+
:warn-on-reflection true)

src/it/README

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/src/it/
2+
3+
These are integration-tests which exercise the packaged plugin from a separate
4+
instance of Maven using maven-invoker-plugin.
5+
6+
See http://maven.apache.org/plugins/maven-invoker-plugin/.
7+

src/it/custom-properties/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
<plugin>
1919
<groupId>com.code54.mojo</groupId>
2020
<artifactId>buildversion-plugin</artifactId>
21-
<version>1.0.0-SNAPSHOT</version>
21+
<version>1.0.1-SNAPSHOT</version>
2222
<executions>
2323
<execution>
2424
<goals><goal>set-properties</goal></goals>
2525
<configuration>
2626
<tstampFormat>yyyy-MM-dd</tstampFormat>
2727
<customProperties>
28-
{ :build-tag-lowercase (clojure.string/lower-case build-tag) }
28+
{ :build-commit-uppercase (clojure.string/upper-case build-commit) }
2929
</customProperties>
3030
</configuration>
3131
</execution>

src/it/custom-properties/verify.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ def build_log = new File("target/it/custom-properties/build.log").text
66

77
boolean tstamp = (build_log =~ /build-tstamp: \d\d\d\d-\d\d-\d\d/)
88

9-
boolean customLowerCaseProperty = ( build_log =~ /build-tag-lowercase: n\/a/ )
109

11-
return tstamp && customLowerCaseProperty
10+
// expect an all-uppercased git commit hash
11+
boolean customProperty = ( build_log =~ /build-commit-uppercase: [0-9A-F]{40}/ )
12+
13+
return tstamp && customProperty
1214

src/it/setting-git-cmd/git.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
git "$@"

0 commit comments

Comments
 (0)