Skip to content
This repository
Browse code

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

  • Loading branch information...
commit f5f2b4d87e2b1ecf665fd7cfa3a274e059bf0260 2 parents 79664bd + 135b7bc
graemerocher graemerocher authored

Showing 1 changed file with 11 additions and 8 deletions. Show diff stats Hide diff stats

  1. +11 8 src/main/java/org/grails/maven/plugin/MvnValidateMojo.java
19 src/main/java/org/grails/maven/plugin/MvnValidateMojo.java
@@ -64,22 +64,25 @@ public void execute() throws MojoExecutionException, MojoFailureException {
64 64 "application.properties is different of the artifactId [" + artifactId + "] in the pom.xml");
65 65 }
66 66
67   - // We have to set the application version in grails settings for old versions
68   - if (grailsProject.getAppVersion() == null) {
  67 + // We have to set the application version in grails settings for old versions
  68 + if (grailsProject.getAppVersion() == null &&
  69 + !"grails-binary-plugin".equals(project.getPackaging()) &&
  70 + !"grails-plugin".equals(project.getPackaging())) {
69 71 grailsProject.setAppVersion(GrailsProject.DEFAULT_APP_VERSION);
70 72 getLog().warn("application.properties didn't contain an app.version property");
71 73 getLog().warn("Setting to default value '" + grailsProject.getAppVersion() + "'.");
72 74
73 75 getGrailsServices().writeProjectDescriptor(getBasedir(), grailsProject);
74   - }
  76 + final String pomVersion = version.trim();
  77 + final String grailsVersion = grailsProject.getAppVersion().trim();
75 78
76   - final String pomVersion = version.trim();
77   - final String grailsVersion = grailsProject.getAppVersion().trim();
  79 + if (!grailsVersion.equals(pomVersion)) {
  80 + throw new MojoFailureException("app.version [" + grailsVersion + "] in " +
  81 + "application.properties is different of the version [" + pomVersion + "] in the pom.xml");
  82 + }
78 83
79   - if (!grailsVersion.equals(pomVersion)) {
80   - throw new MojoFailureException("app.version [" + grailsVersion + "] in " +
81   - "application.properties is different of the version [" + pomVersion + "] in the pom.xml");
82 84 }
83 85
  86 +
84 87 }
85 88 }

0 comments on commit f5f2b4d

Please sign in to comment.
Something went wrong with that request. Please try again.