Maven Assembly Plugin
  1. Maven Assembly Plugin
  2. MASSEMBLY-592

Cannot create an assembly for use during the build process

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I am trying to create a zip file for use in an intermediate process. I then use that zip file to include in an installer. I then need it to zip up the installer file to use as an artifact for other builds. I use the plug in once in the compile step, and then once in the packaging step. The problem is that the one in the packaging step seems to use the configuration settings from the compile step even though they are redefined. Am I using the plug-in the wrong way? I just need a way to build a zip to be used later in the same build project.

      	<plugin>
      		<groupId>org.apache.maven.plugins</groupId>
      		<artifactId>maven-assembly-plugin</artifactId>
      		<configuration>
      		<finalName>${file1.name}</finalName>
      			<descriptors>
      				<descriptor>${file1.name}-assembly.xml</descriptor>
      			</descriptors>
      		</configuration>
      		<executions>
      			<execution>
      				<id>make-${file1.name}-assembly</id>
      				<phase>compile</phase>
      				<goals>
      				    <goal>single</goal>
      				</goals>
      			</execution>
      		</executions>
      	</plugin>
      
             <!-- build the installer -->
             ...
      
      	<plugin>
      	<!-- Zip up the relevant build artifacts -->
      		<groupId>org.apache.maven.plugins</groupId>
      		<artifactId>maven-assembly-plugin</artifactId>
      		<configuration>
      			<finalName>${file2.name}</finalName>
      			<descriptors>
      				<descriptor>${file2.name}-assembly.xml</descriptor>
      			</descriptors>
      		</configuration>
      		<executions>
      			<execution>
      				<id>make-${file2.name}-assembly</id>
      				<phase>package</phase>
      				<goals>
      					<goal>single</goal>
      				</goals>
      			</execution>
      		</executions>
      	</plugin>
      

        Activity

        Hide
        D'ar Gog added a comment -

        when the second assembly bit is run, it uses the $

        {file1.name}

        -assembly.xml as it's descriptor even though I've redefined it.

        Show
        D'ar Gog added a comment - when the second assembly bit is run, it uses the $ {file1.name} -assembly.xml as it's descriptor even though I've redefined it.
        Hide
        Dennis Lundberg added a comment -

        You need to move your <configuration> sections so that they are inside the respective <execution> elements. If you don't they will be shared.

        Show
        Dennis Lundberg added a comment - You need to move your <configuration> sections so that they are inside the respective <execution> elements. If you don't they will be shared.

          People

          • Assignee:
            Unassigned
            Reporter:
            D'ar Gog
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: