Greetings,
I am generating several artifacts from my build; a WAR, a TAR.GZ, and a JAR -- as required by downstream usage scenarios (embedded, standalone, or webapp) The project has WAR packaging. But I need to supply a JAR and TAR.GZ as well. The TAR.GZ is easy -- using the assembly plugin. And it is easy to create the JAR (using the <archiveClasses> in the maven-war-plugin. But deploying the JAR is problematic. You have to use both the maven- install-plugin (the install-file goal). And the maven-deploy-plugin (the deploy-file goal). I have all this working (my POM snippet is below). But my deploy-file solution is less than satisfactory. deploy-file requires the <url> parameter, and I do not see how to generically supply this value. More specifically, we have a deploy url for SNAPSHOTs and for Releases. And deploy-file only lets us supply one of these. I.e.

<url>$ {project.distributionManagement.snapshotRepository.url}</url>

I do not understand why the deploy-file goal cannot just use the <distributionManagement> the way that the deploy goal does??
Can someone show me how to wire this up correctly??
As it is we would have to edit the POM when we create a Release, and then edit it back -- which is just not right.

Thanks,
-- Chris

The complete POM snippet:

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
<!-- do not create unique binaries for each snapshot -->
                    <uniqueVersion>false</uniqueVersion>
                </configuration>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy-file</goal>
                        </goals>
                        <configuration>
                            <packaging>jar</packaging>
<!-- the Jar is generated by the War, and so is down in the target webapp -->
                            <file>
${project.build.directory}/$ {project.artifactId}-${project.version}/WEB-INF/lib/$ {project.artifactId}-${project.version}.jar
                            </file>
                            <repositoryId>codehaus.org</repositoryId>

<!-- TODO :: this should not have to be specific --> <url>$ {project.distributionManagement.snapshotRepository.url}</url>

                            <pomFile>
                               ${basedir}/pom.xml
                            </pomFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>





S'all good  ---   chriswberry at gmail dot com



Reply via email to