On Thu, Nov 4, 2010 at 2:33 PM, Wendy Smoak <[email protected]> wrote:
> On Thu, Nov 4, 2010 at 1:16 PM, Martin Gentry <[email protected]> wrote: > > The basic issue is that when I execute "mvn deploy" the artifact is being > > successfully deployed to the snapshot repository, but Maven is also > > attempting to deploy it to the release repository, which is failing ... > as > > it should. My understanding of my current configuration is that it > should > > NOT be deploying it to the release repository as well. > > It's not... I see a war going to snapshots and a _jar_ going to releases. > > What's in the pom? I see: > [INFO] [deploy:deploy-file {execution: default}] > > And 'deploy-file' is not part of the default lifecycle, it's usually > used at the command line. > > My guess is that someone has configured an execution of the deploy > plugin trying to push an extra jar into the repo. (If you're trying > to deploy the class files from a webapp, the war plugin has an option > to do that for you, though it's better to put the classes in a > separate module.) > And here goes where my n00b status with Maven comes into play. :) So with this pointer I've located the problem in the main project POM that seems to be the culprit. Someone had added: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <executions> <execution> <phase>deploy</phase> <goals> <goal>deploy-file</goal> </goals> <configuration> <packaging>jar</packaging> <generatePom>true</generatePom> <url>${project.distributionManagement.repository.url}</url> <artifactId>${project.artifactId}</artifactId> <groupId>${project.groupId}</groupId> <version>${project.version}</version> <file>${project.build.directory}/${project.build.finalName}.jar</file> </configuration> </execution> </executions> </plugin> Which for one, directly references ${project.distributionManagement.repository.url}. Commenting that section out resolves my particular issue, now I just have to determine why this was there in the first place and resolve that issue. :) No doubt your pointer to the war plugin options for deploying the class files as a first step will be helpful since deploying the classes as a jar separately does seem what was wanted. Though obviously breaking that out into a separate module that the web app depends on is obviously the better solution. Thanks! PS - If you're a StackOverflow user, feel free to go answer at the question I posted there for the points. :) http://stackoverflow.com/questions/4099412/why-is-maven-incorrectly-deploying-my-snapshot-to-both-the-release-and-snapsho
