Actually, I think this is a great idea.   I'd love this for our sample 
projects for the stuff I work on that we ship with the full kits.   
There is no point to deploy them into the repositories as there is no 
value in that at all.   However, I'd like them built as part of the 
build to make sure the build actually works.   Also, as part 
of "release:prepare" so that pom versions get updated.

Dan


On Sunday 24 February 2008, Jason van Zyl wrote:
> On 22-Feb-08, at 2:57 PM, [EMAIL PROTECTED] wrote:
> > Author: olamy
> > Date: Fri Feb 22 14:57:35 2008
> > New Revision: 630347
> >
> > URL: http://svn.apache.org/viewvc?rev=630347&view=rev
> > Log:
> > [MDEPLOY-63] Allow disabling deployment for artifacts that should
> > not be deployed
>
> What's the reasoning behind this? When someone invokes the deploy
> lifecycle one would assume you, in fact, want to deploy. Just become
> some users asks for this doesn't mean it's a good idea.
>
> By enabling this you potentially open a big can of worms. Now
> deployment is exposed to potential bugs in profiles calculation,
> property interpolation with dots, and the whole question of whether
> deployment should be optional. And even though this is an addition to
> a plugin it is a major behavioral change. Given it's right at the end
> of the lifecycle if you invoke it, it should deploy. I personally
> don't think this is a great option, is of limited value, and is going
> to create a potentially larger set of problems.
>
> > Modified:
> >    maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/
> > maven/plugin/deploy/DeployMojo.java
> >    maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/
> > maven/plugin/deploy/DeployMojoTest.java
> >
> > 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=630
> >347&r1=630346&r2=630347&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 Fri Feb 22 14:57:35 2008 @@
> > -112,10 +112,25 @@
> >      * Contextualized.
> >      */
> >     private PlexusContainer container;
> > +
> > +    /**
> > +     * Set this to 'true' to bypass artifact deploy
> > +     *
> > +     * @parameter expression="${maven.deploy.skip}" default-
> > value="false"
> > +     * @since 2.4
> > +     */
> > +    private boolean skip;
> >
> >     public void execute()
> >         throws MojoExecutionException, MojoFailureException
> >     {
> > +
> > +        if ( skip )
> > +        {
> > +            getLog().info( " skipping artifact deployement " );
> > +            return;
> > +        }
> > +
> >         ArtifactRepository repo = getDeploymentRepository();
> >
> >         String protocol = repo.getProtocol();
> >
> > Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/
> > apache/maven/plugin/deploy/DeployMojoTest.java
> > URL:
> > http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin
> >/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java?rev
> >=630347&r1=630346&r2=630347&view=diff =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ====================================================================
> >== ---
> > maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/
> > maven/plugin/deploy/DeployMojoTest.java (original)
> > +++
> > maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/
> > maven/plugin/deploy/DeployMojoTest.java Fri Feb 22 14:57:35 2008 @@
> > -193,6 +193,58 @@
> >         assertEquals( 0, getSizeOfExpectedFiles( fileList,
> > expectedFiles ) );
> >     }
> >
> > +    public void testSkippingDeploy()
> > +        throws Exception
> > +    {
> > +        File testPom = new File( getBasedir(),
> > "target/test-classes/ unit/basic-deploy-test/plugin-config.xml" );
> > +
> > +        DeployMojo mojo = (DeployMojo) lookupMojo( "deploy",
> > testPom );
> > +
> > +        assertNotNull( mojo );
> > +
> > +        File file = new File( getBasedir(), "target/test-classes/
> > unit/basic-deploy-test/target/"
> > +            + "deploy-test-file-1.0-SNAPSHOT.jar" );
> > +
> > +        assertTrue( file.exists() );
> > +
> > +        ArtifactRepository loc = (ArtifactRepository)
> > getVariableValueFromObject( mojo, "localRepository" );
> > +
> > +        artifact = (DeployArtifactStub)
> > getVariableValueFromObject( mojo, "artifact" );
> > +
> > +        String packaging = (String)
> > getVariableValueFromObject( mojo, "packaging" );
> > +
> > +        assertEquals( "jar", packaging );
> > +
> > +        artifact.setFile( file );
> > +
> > +        ArtifactRepositoryStub repo = (ArtifactRepositoryStub)
> > getVariableValueFromObject( mojo, "deploymentRepository" );
> > +
> > +        assertNotNull( repo );
> > +
> > +        repo.setAppendToUrl( "basic-deploy-test" );
> > +
> > +        assertEquals( "deploy-test", repo.getId() );
> > +        assertEquals( "deploy-test", repo.getKey() );
> > +        assertEquals( "file", repo.getProtocol() );
> > +        assertEquals( "file://" + getBasedir() + "/target/remote-
> > repo/basic-deploy-test", repo.getUrl() );
> > +
> > +        setVariableValueToObject( mojo, "skip", Boolean.TRUE );
> > +
> > +        mojo.execute();
> > +
> > +        File localRepo = new File( LOCAL_REPO, "" );
> > +
> > +        File[] files = localRepo.listFiles();
> > +
> > +        assertNull( files );
> > +
> > +        remoteRepo = new File( remoteRepo, "basic-deploy-test" );
> > +
> > +        files = remoteRepo.listFiles();
> > +
> > +        assertNull( files );
> > +    }
> > +
> >     public void testBasicDeployWithPackagingAsPom()
> >         throws Exception
> >     {
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> jason at sonatype dot com
> ----------------------------------------------------------
>
> the course of true love never did run smooth ...
>
> -- Shakespeare
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to