views:

1097

answers:

5

Hello

What is the proper way to do mvn release:perform so that source code does not end up in my artifactory?

All help appreciated. I know I have seen this documented somewhere

Thanks

+1  A: 

You could (should) do a dry run to verify that everything is OK before doing the real release. This is done by setting the dryRun parameter to true.

mvn release:prepare -DdryRun=true

After doing this you should do a release clean:

mvn release:clean

Regards

maskefjes
A: 

Try setting the attach property of the maven-source-plugin to false, e.g:

     <pluginManagement>
         <plugins>
             <plugin>
                  <artifactId>maven-source-plugin</artifactId>
                  <configuration>
                      <attach>false</attach>
                  </configuration>
             </plugin>
         </plugins>
     </pluginManagement>
siddhadev
+2  A: 

Disable the built in release profile and then define your own. Look at the maven parent pom for an example: http://svn.apache.org/viewvc/maven/pom/trunk/maven/pom.xml?annotate=759540

Look at line 630 for the release plugin config and then line 910 for the release profile we use.

Brian Fox
I think your link may be out of date. There aren't even 910 lines in it.
javamonkey79
I see based on the revisions and when you posted this there was a shift. Maybe your link should be: http://svn.apache.org/viewvc/maven/pom/trunk/maven/pom.xml?annotate=759540
javamonkey79
A: 

Set the property useReleaseProfile to false in your Maven Release Plugin config:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <useReleaseProfile>false</useReleaseProfile>
          ..
        </configuration>
      </plugin>
    </plugins>
  </build>
Thomas Marti
A: 

Agree with configuring plug-in setting useReleaseProfile.

From release:perform page

useReleaseProfile - Whether to use the release profile that adds sources and javadocs to the released artifact, if appropriate. Default value is: true.

Kinski