I wrote a little plugin for my company that does just that..  When they call
upstate:deploy it figures out what kind or artifact it is.  The only
ickyness is on deploying a plugin file..

   <goal name="upstate:artifact" description="Builds artifact for a
project">
        <ant:echo>Running ${maven.multiproject.type}:${maven.multiproject.type} for
${pom.name}</ant:echo>
        <j:choose>
          <j:when test="${context.getVariable('maven.multiproject.type') ==
'plugin'}">
        <attainGoal name="jar:jar"/>
          </j:when>
      <j:otherwise>
        <attainGoal
name="${maven.multiproject.type}:${maven.multiproject.type}"/>
      </j:otherwise>
    </j:choose>

    <!--attainGoal
name="${maven.multiproject.type}:${maven.multiproject.type}"/-->

    <j:if test="${context.getVariable('maven.multiproject.type')  ==
'jar'}">
      <ant:property name="artifactName"
value="${maven.final.name}.${maven.multiproject.type}"/>
    </j:if>
    <j:if test="${context.getVariable('maven.multiproject.type') == 'war'}">
      <ant:property name="artifactName"
value="${pom.artifactId}.${maven.multiproject.type}"/>
    </j:if>
    <j:if test="${context.getVariable('maven.multiproject.type') ==
'plugin'}">
      <ant:property name="artifactName" value="${maven.final.name}.jar"/>
    </j:if>

   </goal>

  <goal name="upstate:deploy" description="Creates a artifact and deploys it
to the Upstate repo" prereqs="upstate:artifact">

     <artifact:deploy
         artifact="${maven.build.dir}/${artifactName}"
         type="${maven.multiproject.type}"
         project="${pom}"/>

   </goal>



> -----Original Message-----
> From: Maczka Michal [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 20, 2004 9:44 AM
> To: 'Maven Developers List'
> Subject: RE: PROPOSAL: plugin categories
>
>
>
>
> > -----Original Message-----
> > From: Brett Porter [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, January 20, 2004 12:15 AM
> > To: Maven Developers List ([EMAIL PROTECTED])
> > Subject: PROPOSAL: plugin categories
> >
> >
> > Hi,
> >
> > I've had a thought about whether we might have the following plugin
> > categories:
> > - artifact (war, ear, jar, plugin, etc)
> > - report
> > - general
> > - any others?
> >
> > Reports already have special handling, via automatic registration.
> >
> > However, I think that the artifact plugin could be extended
> > to handle using
> > other artifacts plugins:
> > artifact:install
> > artifact:install-snapshot
> > artifact:deploy
> > artifact:deploy-snapshot
> > artifact:artifact
> >
>
> I think we need just 3 of them:
>
> artifact:install
> artifact:deploy
> artifact:artifact
>
>
> install-snapshot and deploy-snapshot should be kick out asap
> and install and
> deploy goals jus should look at pom.version.
> (if it is something like 1.0-rc-1-SNAPSHOT sanpshot shuld be deployed)
>
>
>
> > To be consistent with dependencies, pom <type> should be
> > introduced, and can
> > replace maven.multiproject.type. This would allow most of
> the artifact
> > processing in multiproject to be moved to the artifact plugin.
> >
> > The plugin plugin would need to be changed so its goals were
> > consistent with
> > the others, and this would be a good platform for making
> insta//deploy
> > consistent for all plugins instead of the current disparity
> > between artifact
> > and deploy.
>
> We can also think about standarization of the location into
> which plugins
> are generating artifacts.
>
> What about having project's own local repository?
>
> Say that we have POM like:
> <project>
>     <groupId>foo</groupId>
>     <artifactId>baa</artifactId>
>     <version>1.0</version>
> <project>
>
>
>
> jar:jar -> target/repository/foo/jars/baa-1.0.jar
> war:war -> target/repository/foo/wars/baa-1.0.war
>
> etc.
>
>
> then it could be that we won't need goals like jar:install,
> war:intall,
> jar:deploy, war:deploy
> but just install and deploy plugins.
>
> so install plugin will work like follows:
>
> a) check pom.type (let's assume that it is "war")
> b) call war:war goal
> c) get repository location for war ( something like
> /foo/wars/baa-1.0.war)
> d) copy from target/repository/${repositoryLocation} to
> ${maven.repo.local}/${repositoryLocation}
>
>
> So this will be super simple for users. They won't need to
> learn names of
> many goals like multiproject:install, war:install, jar:install.
> They will just use one "maven install". I am currently
> working with a group
> of people which are starting to use maven.
> I know how confusing it is for them which goal call in which
> subproject in
> order to install main artifact produced by given project.
> And when to call "install" and when "install-snapshot". We
> should kill this
> complexivity as it is really don't needed.
>
> > The only question I can think of is what about plugins like
> > dist that can
> > produce multiple artifacts?
>
> yeap. that's the question!
>
> Michal
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to