You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ar...@apache.org on 2006/06/21 12:55:31 UTC
svn commit: r415959 - in /maven/plugins/trunk/maven-deploy-plugin/src:
main/java/org/apache/maven/plugin/deploy/ site/ site/apt/
site/apt/examples/ site/apt/examples/deployfile/
Author: aramirez
Date: Wed Jun 21 03:55:31 2006
New Revision: 415959
URL: http://svn.apache.org/viewvc?rev=415959&view=rev
Log:
PR: MDEPLOY-35
added documentation
Added:
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-classifiers.apt
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-customed-pom.apt
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-generic-pom.apt
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-timestamps-suffix.apt
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/faq.apt
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/overview.apt
- copied, changed from r415248, maven/plugins/trunk/maven-deploy-plugin/src/site/apt/introduction.apt
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/usage.apt
Removed:
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/howto.apt
maven/plugins/trunk/maven-deploy-plugin/src/site/apt/introduction.apt
Modified:
maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
maven/plugins/trunk/maven-deploy-plugin/src/site/site.xml
Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java?rev=415959&r1=415958&r2=415959&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java Wed Jun 21 03:55:31 2006
@@ -112,6 +112,8 @@
private String repositoryLayout;
/**
+ * Map that contains the layouts
+ *
* @component role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
*/
private Map repositoryLayouts;
@@ -126,11 +128,15 @@
private String url;
/**
+ * Component used to create an artifact
+ *
* @component
*/
private ArtifactFactory artifactFactory;
/**
+ * Component used to create a repository
+ *
* @component
*/
private ArtifactRepositoryFactory repositoryFactory;
Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java?rev=415959&r1=415958&r2=415959&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java Wed Jun 21 03:55:31 2006
@@ -75,6 +75,8 @@
private List attachedArtifacts;
/**
+ * Parameter used to update the metadata to make the artifact as release.
+ *
* @parameter expression="${updateReleaseInfo}" default-value="false"
*/
private boolean updateReleaseInfo;
Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt?rev=415959&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt Wed Jun 21 03:55:31 2006
@@ -0,0 +1,49 @@
+ ------
+ Maven 2 Deploy Plugin - Examples on using the parameters of the plugin
+ ------
+ Allan Ramirez
+ ------
+ June 2006
+ ------
+
+Deploying the artifact in a legacy layout of repository
+
+ "Legacy" is the layout used in maven 1 repositories while maven 2 uses "default". They are different
+ in terms of directory structure, timestamp of snapshots in default and existence of metadata files in default.
+
+ * legacy layout directory structure:
+
++---+
+ groupId
+ |
+ +--artifactId
+ |
+ +--jars
+ |
+ +--artifact
++---+
+
+ * default layout directory structure:
+
++---+
+ groupId
+ |
+ +--artifactId
+ |
+ +--version
+ | |
+ | ---artifact
+ |
+ ---metadata
++---+
+
+ In able to deploy an artifact in a legacy layout
+ of repository, set the <<repositoryLayout>> parameter to <<<legacy>>> value.
+
++---+
+mvn deploy:deploy-file -Durl=file://C:\m2-repo \
+ -DrepositoryId=some.id \
+ -Dfile=your-artifact-1.0.jar \
+ -DpomFile=your-pom.xml \
+ -DrepositoryLayout=legacy
++---+
\ No newline at end of file
Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-classifiers.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-classifiers.apt?rev=415959&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-classifiers.apt (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-classifiers.apt Wed Jun 21 03:55:31 2006
@@ -0,0 +1,37 @@
+ ----
+ Maven 2 Deploy Plugin - Configurations
+ ------
+ Allan Ramirez
+ ------
+ June 2006
+ ------
+
+Deploying an artifact with classifiers
+
+ Classifiers are the additional text given to describe an artifact.
+
++---+
+ artifact-name-1.0-bin.jar
+ artifact-name-1.0-dev.jar
+ artifact-name-1.0-prod.jar
++---+
+
+ From the above artifact names, classifiers can be located between the version and extension name of the artifact.
+
+ *<<<bin>>> is used to describe that the artifact is a binary.
+
+ *<<<dev>>> is used to describe that the artifact is for development.
+
+ *<<<prod>>> is used to describe that the artifact is for production.
+
+ []
+
+ To add classifier into your artifact for your deployment, set the text to the <<classifier>> parameter.
+
++---+
+mvn deploy:deploy-file -Durl=file://C:\m2-repo \
+ -DrepositoryId=some.id \
+ -Dfile=path-to-your-artifact-jar \
+ -DpomFile=path-to-your-pom.xml \
+ -Dclassifier=bin
++---+
Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-customed-pom.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-customed-pom.apt?rev=415959&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-customed-pom.apt (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-customed-pom.apt Wed Jun 21 03:55:31 2006
@@ -0,0 +1,22 @@
+ ----
+ Maven 2 Deploy Plugin - Configurations
+ ------
+ Allan Ramirez
+ ------
+ June 2006
+ ------
+
+Deploying an artifact together with a customed pom
+
+ If there is already an existing pom and want it to be deployed together with the 3rd party artifact,
+ set the <<pomFile>> parameter to the path of the pom.xml.
+
++---+
+mvn deploy:deploy-file -Durl=file://C:\m2-repo \
+ -DrepositoryId=some.id \
+ -Dfile=path-to-your-artifact-jar \
+ -DpomFile=path-to-your-pom.xml
++---+
+
+ Note that the groupId, artifactId, version and packaging informations are automatically retrieved from the
+ given pom.
Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-generic-pom.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-generic-pom.apt?rev=415959&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-generic-pom.apt (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-generic-pom.apt Wed Jun 21 03:55:31 2006
@@ -0,0 +1,24 @@
+ ----
+ Maven 2 Deploy Plugin - Configurations
+ ------
+ Allan Ramirez
+ ------
+ June 2006
+ ------
+
+Disabling the generation of generic pom on deployment
+
+ By default, If no pom is specified during deployment of your 3rd party artifact, a generic pom will be generated
+ which contains the minimum required elements needed for the pom. In order to disable it, set the
+ <<generatePom>> parameter to <<<false>>>.
+
++---+
+mvn deploy:deploy-file -Durl=file://C:\m2-repo \
+ -DrepositoryId=some.id \
+ -Dfile=path-to-your-artifact-jar \
+ -DgroupId=your.groupId \
+ -DartifactId=your-artifactId \
+ -Dversion=version \
+ -Dpackaging=jar \
+ -DgeneratePom=false
++---+
\ No newline at end of file
Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-timestamps-suffix.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-timestamps-suffix.apt?rev=415959&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-timestamps-suffix.apt (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-timestamps-suffix.apt Wed Jun 21 03:55:31 2006
@@ -0,0 +1,20 @@
+ ----
+ Maven 2 Deploy Plugin - Configurations
+ ------
+ Allan Ramirez
+ ------
+ June 2006
+ ------
+
+Disabling the timestamp suffixed to the deployed artifact
+
+ By default, when a snapshot version of an artifact is deployed to a repository, a timestamp is suffixed to it.
+ To disable the addition of timestamp to the artifact, set the <<uniqueVersion>> parameter to <<<false>>>.
+
++---+
+mvn deploy:deploy-file -Durl=file://C:\m2-repo \
+ -DrepositoryId=some.id \
+ -Dfile=your-artifact-1.0.jar \
+ -DpomFile=your-pom.xml \
+ -DuniqueVersion=false
++---+
\ No newline at end of file
Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/faq.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/faq.apt?rev=415959&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/site/apt/faq.apt (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/faq.apt Wed Jun 21 03:55:31 2006
@@ -0,0 +1,9 @@
+ ------
+ Maven 2 Deploy Plugin - Frequently Asked Questions
+ ------
+ Allan Ramirez
+ ------
+ June 2006
+ ------
+
+
Copied: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/overview.apt (from r415248, maven/plugins/trunk/maven-deploy-plugin/src/site/apt/introduction.apt)
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/overview.apt?p2=maven/plugins/trunk/maven-deploy-plugin/src/site/apt/overview.apt&p1=maven/plugins/trunk/maven-deploy-plugin/src/site/apt/introduction.apt&r1=415248&r2=415959&rev=415959&view=diff
==============================================================================
(empty)
Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/usage.apt?rev=415959&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/site/apt/usage.apt (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/usage.apt Wed Jun 21 03:55:31 2006
@@ -0,0 +1,127 @@
+ ------
+ Maven 2 Deploy Plugin - HOW-TO
+ ------
+ Jerome Lacoste
+ John Casey
+ ------
+ January 29 2006
+ ------
+
+How-to
+
+* Introduction
+
+ The Deploy Plugin has two basic functions. In most project builds, the
+ <<<deploy>>> phase of the build lifecycle is implemented using the
+ <<<deploy:deploy>>> mojo. Also, artifacts which are not built using Maven can
+ be added to any remote repository using the <<<deploy:deploy-file>>> mojo.
+
+* The <<<deploy:deploy>>> Mojo
+
+ In most cases, this mojo is invoked when you call the <<<deploy>>> phase of
+ the default build lifecycle.
+
+ To enable this mojo to function, you must include a valid
+ <<<\<distributionManagement/\>>>> section POM, which at the minimum provides a
+ <<<\<repository/\>>>> defining the remote repository location for your
+ artifact. To separate snapshot artifacts from release artifacts, you can also
+ specify a <<<\<snapshotRepository/\>>>> location. Finally, to deploy a project
+ website, you must specify a <<<\<site/\>>>> section here as well. It's also
+ important to note that this section can be inherited, allowing you to specify
+ the deployment location one time for a set of related projects.
+
+ If your repository is secured, you may also want to configure your
+ <<<settings.xml>>> file to define corresponding <<<\<server/\>>>> entries
+ which provides authentication information. Server entries are matched to the
+ different parts of the distributionManagement using their <<<\<id/\>>>>
+ elements. For example, your project may have a distributionManagement section
+ similar to the following:
+
++---+
+[...]
+ <distributionManagement>
+ <repository>
+ <id>internal.repo</id>
+ <name>MyCo Internal Repository</name>
+ <url>scp://host.com/path/to/remote/repository</url>
+ </repository>
+ <snapshotRepository>
+ <id>internal.repo</id>
+ <name>MyCo Internal Snapshot Repository</name>
+ <url>scp://host.com/path/to/snapshot/repository</url>
+ </snapshotRespository>
+ </distributionManagement>
+[...]
++---+
+
+ In this case, you can specify a server definition in your <<<settings.xml>>>
+ to provide authentication information for both of these repositories at once.
+ Your server section might look like this:
+
++---+
+[...]
+ <server>
+ <id>internal.repo</id>
+ <username>maven</username>
+ <password>foobar</password>
+ </server>
+[...]
++---+
+
+ Unfortunately, Maven doesn't currently support hashed or encrypted passwords
+ in the <<<settings.xml>>>.
+
+ Once you've configured your repository deployment information correctly
+ deploying your project's artifact will only require invocation of the
+ <<<deploy>>> phase of the build:
+
++---+
+mvn deploy
++---+
+
+
+* The <<<deploy:deploy-file>>> Mojo
+
+ The <<<deploy:deploy-file>>> mojo is used primarily for deploying artifacts to
+ which were not built by Maven. The project's development team may or may not
+ provide a POM for the artifact, and in some cases you may want to deploy the
+ artifact to an internal remote repository. The deploy-file mojo provides
+ functionality covering all of these use cases, and offers a wide range of
+ configurability for generating a POM on-the-fly. Additionally, you can specify
+ what layout your repository uses. The full usage statement of the deploy-file
+ mojo can be described as:
+
++---+
+mvn deploy:deploy-file -Durl=file://C:\m2-repo \
+ -DrepositoryId=some.id \
+ -Dfile=your-artifact-1.0.jar \
+ [-DpomFile=your-pom.xml] \
+ [-DgroupId=org.some.group] \
+ [-DartifactId=your-artifact] \
+ [-Dversion=1.0] \
+ [-Dpackaging=jar] \
+ [-Dclassifier=test] \
+ [-DgeneratePom=true] \
+ [-DgeneratePom.description="My Project Description"] \
+ [-DrepositoryLayout=legacy] \
+ [-DuniqueVersion=false]
++---+
+
+ If the following required information is not specified in some way, the goal
+ will fail:
+
+ * the artifact file to deploy
+
+ * the group, artifact, version and packaging of the file to deploy. These can
+ be taken from the specified pomFile, and overriden or specified using the
+ command line. When the pomFile contains a <parent> section, the parent's
+ groupId can be considered if the groupId is not specified further for the
+ current project or on the command line.
+
+ * the repository information: the url to deploy to and the repositoryId
+ mapping to a server section in the settings.xml file. If you don't specify a
+ repositoryId, Maven will try to extract authentication information using the
+ id <<<'remote-repository'>>>.
+
+ []
+
Modified: maven/plugins/trunk/maven-deploy-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/site.xml?rev=415959&r1=415958&r2=415959&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/site/site.xml (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/site/site.xml Wed Jun 21 03:55:31 2006
@@ -33,11 +33,16 @@
<item name="Maven 2" href="http://maven.apache.org/maven2/"/>
</links>
- <menu name="Overview">
- <item name="Plugin Goals" href="index.html"/>
- <item name="Introduction" href="introduction.html"/>
- <item name="How to Use" href="howto.html"/>
- <item name="Javadoc" href="apidocs/index.html"/>
+ <menu name="Plugin Overview">
+ <item name="Overview" href="overview.html"/>
+ <item name="Usage" href="usage.html"/>
+ </menu>
+ <menu name="Examples for plugin Configuration">
+ <item name="Disable generic pom" href="examples/deployfile/disabling-generic-pom.html"/>
+ <item name="Deploy with customed pom" href="examples/deployfile/deploying-with-customed-pom.html"/>
+ <item name="Deploy with classifier" href="examples/deployfile/deploying-with-classifiers.html"/>
+ <item name="Disable timestamps suffix" href="examples/deployfile/disabling-timestamps-suffix.html"/>
+ <item name="Deploy in legacy" href="examples/deployfile/deploying-in-legacy-layout.html"/>
</menu>
${reports}
</body>