1

We have a multi module project with following modules:

  • Database
  • Persistence
  • Business
  • Application

The 'Database' project is a jar project that creates an additional assembly using the 'maven-assembly-plugin'. This additional assembly contains the database schema.

The plugin configuration is as follows:

  <plugin>
    <!-- create a zip file that contains all the db migration scripts. -->
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.2.1</version>
    <executions>
      <execution>
        <id>attach-schema</id>
        <phase>package</phase>
        <goals>
          <goal>single</goal>
        </goals>
        <configuration>
          <descriptors>
            <descriptor>db-schema-descriptor.xml</descriptor>
          </descriptors>
        </configuration>
      </execution>
    </executions>
  </plugin>

The 'Application' project creates a zipped version of the the application directory structure. Therefore it references the schema assembly in order to extract and copy it to the appropriate location in the application directory structure. The reference is expressed as ordinary maven dependency:

<dependency>
  <groupId>my.application</groupId>
  <artifactId>persistence</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <classifier>db-schema</classifier>
</dependency>

At least there is a multi module project that aggregates the 4 sub modules in order to build the application in one step.

Running 'mvn deploy' on the aggregate project works fine. The database schema assembly is extracted and copied. But when running a 'mvn release:prepare' on the aggregate project building the 'Application' project fails with the error notification that maven is unable to find the schema assembly with version '0.0.1'. The log file states that the 'Persistence' project has been built before the 'Application' project and that the 'database schema' assembly has been built.

Anyone an idea what I am doing wrong?

woelfle
  • 557
  • 1
  • 7
  • 23
  • Related to http://stackoverflow.com/questions/2244344/deploying-assembly-package-with-maven-release-plugin – Raghuram Mar 18 '11 at 01:57
  • It is not really a problem of the 'deploy' goal. Calling 'mvn deploy' works fine. The problem arises when calling 'mvn release:prepare' – woelfle Mar 18 '11 at 07:09

2 Answers2

0

See http://www.mail-archive.com/users@maven.apache.org/msg117321.html for an answer

woelfle
  • 557
  • 1
  • 7
  • 23
0

Using the command line 'mvn -DpreparationGoals=install release:prepare' solves the problem. With that command line the prepare release:prepare goals runs the install goal first which installs the release assemblies in the local repository. Later these assemblies can be referenced during the release process.

woelfle
  • 557
  • 1
  • 7
  • 23