[EMAIL PROTECTED] wrote:
"Adam Hardy" <[EMAIL PROTECTED]> wrote on 11/08/2006 02:32:34
[EMAIL PROTECTED] wrote:
mvn -DperformRelease=true deploy
and you get both source and javadoc jars in the repository along with
the main artifact. It also works with the install target.
Very interesting. I just checked on the maven website and it's not
mentioned as one of the optional parameters (only createChecksum and
updateReleaseInfo are documented).
But it works.
I had looked that up at one point when I didn't understand much, but now I
went after it again. It's defined in the superpom (which can be found in
MAVEN_HOME/lib/maven-project-2.0.4.jar as
org/apache/maven/project/pom-4.0.0.xml for the curious). Here's the
"magic":
<profile>
<id>release-profile</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin>
</plugins>
</build>
</profile>
I tried adding an <activeProfiles> section in my ~/.m2/settings.xml for
release-profile with no luck.
mvn -DperformRelease=true help:active-profiles
returns no active profiles. It still doesn't all make sense to me.
OK with that parameter being a profile-trigger, it's obvious why the
parameter is not documented for install:install.
Without checking up on the profile activation docs, I'd guess that the
activation based on a property will then always depend on that property
for activation. Or in other words, the property-based activation takes
precedence over the listing in the active profiles.
What would be easier for command line usage would be a custom goal that
kicked off the same thing:
mvn adamgoal:performRelease
but I don't think maven has the capacity for configuring custom goals
that easily - I'd have to write a plugin I think.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]