Hello Folks,
I am using mvn 2.2.1, and ran into this (known) issue with sources jar 
deploying twice when releasing (mvn release:perform).

I see there have been some posts on this, but one solution (Peter Lynch’s link 
below) which mentions setting up the pom.xml so the additional source-jar 
execution from the super pom is overridden. …but I am still having the same 
issues running mvn release:perform. (getting 2x deploy of sources jar), which 
in my case fails the build due to a setting enforcing our repo policy of “just 
1 release of any artifact’.

Below is a copy of my pom.xml (bold, Italicized parts are taken from this link 
http://blog.peterlynch.ca/2010/05/maven-how-to-prevent-generate-sources.html)…..
Is this a viable solution and I’m just doing something wrong or is there a 
better way?

….
    <name>Common Language</name>
    <description>This library extends the Java Language with useful code and 
libraries.</description>
    <groupId>com.xxxxx.common.lang</groupId>
    <artifactId>xxxxx-common-lang</artifactId>
    <version>2.0.1-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <joda.version>1.6.1</joda.version>
        <spring.version>3.0.5.RELEASE</spring.version>
        <junit.version>4.8.1</junit.version>
    </properties>
                <scm>
        
<connection>scm:svn:http://code.casenetinc.com/repos/xxxxxNonBuild/tags/xxxxx-common-lang-2.0.0.MRP</connection>
        
<url>http://code.casenetinc.com/repos/xxxxxxNonBuild/tags/xxxxxx-common-lang-2.0.0.MRP</url<http://code.casenetinc.com/repos/xxxxxxNonBuild/tags/xxxxxx-common-lang-2.0.0.MRP%3c/url>>
    </scm>
    <build>
                <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1.1</version>
                                                                <executions>
                                                                                
<execution>
                                                                                
                <id>attach-sources</id>
                                                                                
                <phase>DISABLE_FORKED_LIFECYCLE_MSOURCES-13</phase>
                                                                                
</execution>
                                                                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
        </plugins>
                </pluginManagement>
                </build>
                <profiles>
                                <!-- MSOURCES-13 related workaround overriding 
super-pom -->
                                <profile>
                                                <id>release-profile</id>
                                                <activation>
                                                                <property>
                                                                                
<name>performRelease</name>
                                                                                
<value>true</value>
                                                                </property>
                                                </activation>
                                                <build>
                                                                <plugins>
                                                                                
<plugin>
                                                                                
                <inherited>true</inherited>
                                                                                
                <artifactId>maven-source-plugin</artifactId>
                                                                                
                <executions>
                                                                                
                                <execution>
                                                                                
                                                <id>attach-sources-no-fork</id>
                                                                                
                                                <inherited>true</inherited>
                                                                                
                                                <goals>
                                                                                
                                                                
<goal>jar-no-fork</goal>
                                                                                
                                                </goals>
                                                                                
                                </execution>
                                                                                
                </executions>
                                                                                
</plugin>
                                                                </plugins>
                                                </build>
                                </profile>
                </profiles>
    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>r07</version>
        </dependency>

…

-Ken



Ken O'Connell
Release Engineer
[cid:[email protected]]
Follow us on [cid:[email protected]] 
<http://twitter.com/#!/CasenetLLC>  [cid:[email protected]] 
<http://www.linkedin.com/company/casenet-llc>
36 Crosby Drive | Bedford, MA  01730
Direct 781.357.2653 І Fax 781-357-2653
[email protected]<mailto:[email protected]> | 
www.casenetllc.com<http://www.casenetllc.com/>



________________________________
CONFIDENTIALITY NOTICE: This e-mail and the information transmitted within 
including any attachments is only for the recipient(s) to which it is intended 
and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of; or taking of any action in 
reliance upon this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please send the e-mail 
back by replying to the sender and permanently delete the entire message and 
its attachments from all computers and network systems involved in its receipt.

Reply via email to