chad
chad

Reputation: 7537

Property for referencing the assembly directory?

When using the assembly plugin, it seems like there should be a property exposed, such as ${assembly.directory}, by which you could reference the assembly output directory. By assembly output directory, I mean the directory in which the assembly plugin puts the assembly it creates for you; in my case, I'm creating a "dir" type assembly so the output directory is the assembly itself. In my usage of the assembly plugin, the "directory output assembly" turns out to be something like:

${project.build.directory}/${artifactId}-${project.version}/${artifactId}-${project.version}

But that is obviously kind of a nasty thing to write out in all of the places I need to reference the assembly output location. I would prefer something like

${project.assembly.outputDirectory}

Here's my assembly plugin config:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-5</version>
                <executions>
                    <execution>
                        <id>assemble-myStuff</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assemble/myAssembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Upvotes: 0

Views: 1002

Answers (1)

Roy Truelove
Roy Truelove

Reputation: 22476

But that is obviously kind of a nasty thing to write out in all of the places I need to reference the assembly output location.

True, but I don't think the plugin will provide it for you. I had a similar issue and solved it this way (not ideal, but hey):

<properties>
   <myAssemblyOutput>${project.build.directory}/${artifactId}-${project.version}/${artifactId}-${project.version}</myAssemblyOutput>
</properties>

And use ${myAssemblyOutput} throughout.

Upvotes: 1

Related Questions