Permalink
Browse files

Merge branch 'master' of github.com:grails/grails-maven

  • Loading branch information...
2 parents 79664bd + 135b7bc commit f5f2b4d87e2b1ecf665fd7cfa3a274e059bf0260 @graemerocher graemerocher committed Apr 26, 2012
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/main/java/org/grails/maven/plugin/MvnValidateMojo.java
@@ -64,22 +64,25 @@ public void execute() throws MojoExecutionException, MojoFailureException {
"application.properties is different of the artifactId [" + artifactId + "] in the pom.xml");
}
- // We have to set the application version in grails settings for old versions
- if (grailsProject.getAppVersion() == null) {
+ // We have to set the application version in grails settings for old versions
+ if (grailsProject.getAppVersion() == null &&
+ !"grails-binary-plugin".equals(project.getPackaging()) &&
+ !"grails-plugin".equals(project.getPackaging())) {
grailsProject.setAppVersion(GrailsProject.DEFAULT_APP_VERSION);
getLog().warn("application.properties didn't contain an app.version property");
getLog().warn("Setting to default value '" + grailsProject.getAppVersion() + "'.");
getGrailsServices().writeProjectDescriptor(getBasedir(), grailsProject);
- }
+ final String pomVersion = version.trim();
+ final String grailsVersion = grailsProject.getAppVersion().trim();
- final String pomVersion = version.trim();
- final String grailsVersion = grailsProject.getAppVersion().trim();
+ if (!grailsVersion.equals(pomVersion)) {
+ throw new MojoFailureException("app.version [" + grailsVersion + "] in " +
+ "application.properties is different of the version [" + pomVersion + "] in the pom.xml");
+ }
- if (!grailsVersion.equals(pomVersion)) {
- throw new MojoFailureException("app.version [" + grailsVersion + "] in " +
- "application.properties is different of the version [" + pomVersion + "] in the pom.xml");
}
+
}
}

0 comments on commit f5f2b4d

Please sign in to comment.