Skip to content

Commit

Permalink
Log message should reflect the default property name (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
japzio authored May 21, 2022
1 parent 98ae777 commit 6777e67
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ target
.classpath
.project
*.iml
.idea/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This is the [buildnumber-maven-plugin](http://www.mojohaus.org/buildnumber-maven
## Releasing

* Make sure `gpg-agent` is running.
* subversion `svn` is also needed for running tests
* Make sure all tests pass `mvn clean verify -Prun-its`
* Execute `mvn -B release:prepare release:perform`

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/codehaus/mojo/build/CreateMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ private void buildNumberAndTimeStampForReactorProjects( Date now, String tainted
project.getProperties().put( timestampPropertyName, timestamp );

String scmBranch = getScmBranch();
getLog().info( "Storing buildScmBranch: " + scmBranch );
getLog().info( "Storing scmBranch: " + scmBranch );
project.getProperties().put( scmBranchPropertyName, scmBranch );

// Add the revision and timestamp properties to each project in the reactor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void basicItTest()
FileUtils.copyDirectoryStructure( new File( testDir, "dotSvnDir" ), new File( testDir, ".svn" ) );
result = mavenExec.execute( "clean", "verify" );
result.assertLogText( "Storing buildNumber: 14069" );
result.assertLogText( "Storing buildScmBranch: trunk" );
result.assertLogText( "Storing scmBranch: trunk" );

File artifact = new File( testDir, "target/buildnumber-maven-plugin-basic-it-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Expand All @@ -83,7 +83,7 @@ public void basicItGitTest()
FileUtils.copyDirectoryStructure( new File( testDir, "dotGitDir" ), new File( testDir, ".git" ) );
result = mavenExec.execute( "clean", "verify" );
result.assertLogText( "Storing buildNumber: 6d36c746e82f00c5913954f9178f40224497b2f3" );
result.assertLogText( "Storing buildScmBranch: master" );
result.assertLogText( "Storing scmBranch: master" );

File artifact = new File( testDir, "target/buildnumber-maven-plugin-basic-it-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Expand All @@ -103,7 +103,7 @@ public void basicItClearcaseScmTest()
MavenExecutionResult result = mavenExec.execute( "clean", "verify" );
File testDir = result.getBasedir();
result.assertLogText( "Storing buildNumber: foo" );
result.assertLogText( "Storing buildScmBranch: UNKNOWN_BRANCH" );
result.assertLogText( "Storing scmBranch: UNKNOWN_BRANCH" );

File artifact = new File( testDir, "target/buildnumber-maven-plugin-basic-it-clearcase-scm-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Expand All @@ -128,7 +128,7 @@ public void basicItNoDevScmTest()
FileUtils.copyDirectoryStructure( new File( testDir, "dotSvnDir" ), new File( testDir, ".svn" ) );
result = mavenExec.execute( "clean", "verify" );
result.assertLogText( "Storing buildNumber: 14069" );
result.assertLogText( "Storing buildScmBranch: trunk" );
result.assertLogText( "Storing scmBranch: trunk" );

File artifact = new File( testDir, "target/buildnumber-maven-plugin-basic-it-no-devscm-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Expand All @@ -153,7 +153,7 @@ public void basicItSvnJavaTest()
FileUtils.copyDirectoryStructure( new File( testDir, "dotSvnDir" ), new File( testDir, ".svn" ) );
result = mavenExec.execute( "clean", "verify" );
result.assertLogText( "Storing buildNumber: 19665" );
result.assertLogText( "Storing buildScmBranch: trunk" );
result.assertLogText( "Storing scmBranch: trunk" );

File artifact = new File( testDir, "target/buildnumber-maven-plugin-basic-it-svnjava-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Expand Down Expand Up @@ -235,7 +235,7 @@ public void gitBasicItMBUILDNUM66Test()
FileUtils.fileWrite( foo, "hello" );
FileUtils.copyDirectoryStructure( new File( basedir, "dotGitDir" ), new File( basedir, ".git" ) );
result = mavenExec.execute( "verify" );
result.assertLogText( "Storing buildScmBranch: master" );
result.assertLogText( "Storing scmBranch: master" );
File testDir = result.getBasedir();
File artifact = new File( testDir, "target/buildnumber-maven-plugin-basic-it-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Expand Down Expand Up @@ -398,4 +398,4 @@ private static boolean isSvn18()

return false;
}
}
}

0 comments on commit 6777e67

Please sign in to comment.