You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Jeremy Huiskamp <je...@karoshealth.com> on 2009/12/08 21:00:05 UTC

poms generated by upload task

I've noticed that the pom.xml generated by the upload task and placed in 
the target maven repository doesn't include dependency information, 
which is kind of a pain when my maven-using colleagues want to use 
libraries I've built with buildr and they have to go and list all of my 
dependencies explicitly.  Can the pom generation include a list of 
artifacts and, if so, how can I specify it?  I'd be fine with 
handcrafting a pom.xml and having the task use that instead of a 
generated one but doing it in the buildfile would be nicer.

Thanks,
  Jeremy

Re: poms generated by upload task

Posted by Jeremy Huiskamp <je...@karoshealth.com>.
On 08/12/09 3:34 PM, Alex Boisvert wrote:
> On Tue, Dec 8, 2009 at 12:00 PM, Jeremy Huiskamp<
> jeremy.huiskamp@karoshealth.com>  wrote:
>
>    
>> I've noticed that the pom.xml generated by the upload task and placed in
>> the target maven repository doesn't include dependency information, which is
>> kind of a pain when my maven-using colleagues want to use libraries I've
>> built with buildr and they have to go and list all of my dependencies
>> explicitly.  Can the pom generation include a list of artifacts and, if so,
>> how can I specify it?  I'd be fine with handcrafting a pom.xml and having
>> the task use that instead of a generated one but doing it in the buildfile
>> would be nicer.
>>
>>      
> To provide your own pom.xml:
>
> package(:jar).pom.from _("pom.xml")
>
> If you want to craft a pom from within your buildfile, do can do something
> along the lines of
>
>    file("target/pom.xml") do |file|
>      pkg = package(:jar)
>      File.open(file.to_s, 'w') do |file|
>        xml = Builder::XmlMarkup.new(:target=>file, :indent=>2)
>        xml.project do
>          xml.modelVersion '4.0.0'
>          xml.groupId pkg.group
>          xml.artifactId pkg.id
>          xml.version pkg.version
>          # add more information ...
>        end
>      end
>    end
>    package(:jar).pom.from _("target/pom.xml")
>
> Hope this helps,
> alex
>
>    
Great, thanks.  That should get me where I need to go.

Re: poms generated by upload task

Posted by Alex Boisvert <al...@gmail.com>.
On Tue, Dec 8, 2009 at 12:00 PM, Jeremy Huiskamp <
jeremy.huiskamp@karoshealth.com> wrote:

> I've noticed that the pom.xml generated by the upload task and placed in
> the target maven repository doesn't include dependency information, which is
> kind of a pain when my maven-using colleagues want to use libraries I've
> built with buildr and they have to go and list all of my dependencies
> explicitly.  Can the pom generation include a list of artifacts and, if so,
> how can I specify it?  I'd be fine with handcrafting a pom.xml and having
> the task use that instead of a generated one but doing it in the buildfile
> would be nicer.
>

To provide your own pom.xml:

package(:jar).pom.from _("pom.xml")

If you want to craft a pom from within your buildfile, do can do something
along the lines of

  file("target/pom.xml") do |file|
    pkg = package(:jar)
    File.open(file.to_s, 'w') do |file|
      xml = Builder::XmlMarkup.new(:target=>file, :indent=>2)
      xml.project do
        xml.modelVersion '4.0.0'
        xml.groupId pkg.group
        xml.artifactId pkg.id
        xml.version pkg.version
        # add more information ...
      end
    end
  end
  package(:jar).pom.from _("target/pom.xml")

Hope this helps,
alex