Cannot release Vaadin project

I cannot perform a release on an
out-of-the-box
Vaadin 7.6.6 project.

Here’s what I do:

  1. Create a standard Vaadin project using the
    vaadin-archetype-application-multimodule
    Maven archetype.
  2. Add

    section to the project’s parent POM. (required for Maven release) and added

    section (requried for Maven deploy)
  3. On the parent:
    mvn clean build
    (just to make Maven download appropriate stuff and see if the build actually works)
  4. On the parent:
    mvn clean
  5. On the parent:
    mvn -Pproduction release:prepare
    (this passes without problems)
  6. On the parent:
    mvn -Pproduction release:perform

The latter step fails with

[ERROR]
 Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy)
on project myvaadintest-production:
The packaging for this project did not assign a file to the build artifact -> [Help 1]

Ok, so the
-production
module doesn’t actually produce a build artifact … or at least not when executed with the
production
profile. But that’s the whole point: When doing releases you would want the
production
profile to be active, wouldn’t you?

This is all purely out-of-the-box.

Shouldn’t the ambition be that this would work out-of-the-box ? (or am I the only creature in the world to be performing proper releases with Maven and Vaadin?)

Peter

I believe I’ve solved it. The archetype cannot be blamed. :slight_smile:

It is a consequence of how the Maven Release Plugin works: Command line arguments (like
-Pproduction
) on the parent doesn’t get propagated when the Release Plugin executes mvn sub-tasks on sub-modules. The fix for that is the
arguments property
which can (and should) be used both on
release:prepare
and
release:perform
.

In other words step 5 and 6 above becomes

  1. On the parent:
    mvn -Pproduction -Darguments=“-Pproduction” release:prepare
  2. On the parent:
    mvn -Pproduction -Darguments=“-Pproduction” release:perform

I’m guessing the
-Pproduction
on its own is now redundant but I’ve kept as I do not know if it actually has an effect or not.
Enjoy.
This is perhaps worthy of its own blog post.