Sand'o Can
Sand'o Can

Reputation: 53

Maven release:perform error with assembly plugin (Multi module project)

I have a maven multi-module project. In one module, we create 2 ZIP files with the maven-assembly-plugin. The configuration for this:

    <configuration>
            <finalName>${sample.source.zip.filename}</finalName>
            <appendAssemblyId>false</appendAssemblyId>
            <outputDirectory>${project.build.directory}/zip</outputDirectory>
            <descriptors>                                
                <descriptor>src/main/assembly/sample-source.xml</descriptor>
            </descriptors>
        </configuration>


at the war packaging, we put this 2 zip files into the war files, with the maven-war-plugin

    ...
    <resource>
        <directory>${project.build.directory}/zip</directory>
        <targetPath>client</targetPath>
    </resource>
    ... </code></pre>

It is OK. But in the install phase, maven 'copy' these zip files into the local repository on the same file name!!! (module_name & version_number &.zip) And I don't know, why it renames tha zip files!? (zip files needed inside the war, but not in single files in the repository.) But if maven would like to copy its to there, it is ok for me, but why is the rename???

have anybody any idea? Is there any way to exclude files at the install? It is very big problem because, at deploy maven would like to upload the zip files with the same name to the maven repository, but at the second copy it fails. (because there is a zip files with the same name.... )

Upvotes: 2

Views: 459

Answers (1)

Ryan Stewart
Ryan Stewart

Reputation: 128829

It's standard behavior for the assembly plugin to attach the assemblies it produces to the project so they'll be installed and deployed as artifacts of the project. If there's a naming conflict it's because you haven't given the two assemblies distinct ids. The id of the assembly is used in constructing the final file name. This is the proper way to resolve naming conflicts between assemblies.

To stop an assembly from being attached to the project as an artifact and thus prevent it from being installed or deployed, set attach = false, in the assembly plugin's configuration.

Upvotes: 3

Related Questions