You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Odelya Holiday <od...@alicanto.com> on 2012/08/15 15:07:40 UTC

war is not being created although packaging war message appears

HI!

I have the following code in buildr

desc 'Building API (Grroo) project'
	define 'Grroo' do
		info "starting Grroo project"
		# specify the artifact for plimus, twilio and floristone since I
created it locally
		plimus = artifact('plimus.com:plimus:jar:1.0').from('/var/lib/selfdep/wsintegration.jar')
		floristone = artifact('floristone.com:floristone:jar:1.0').from('/var/lib/selfdep/floristone.jar')
		twilio =  artifact('twilio.com:twilio:jar:1.0').from('/var/lib/selfdep/twilio.jar')
		# install the artifact locally
		install plimus
		install floristone
		install twilio
		compile.with projects('Common'),plimus, twilio, floristone,
TOMCAT_COYOTE, TOMCAT_SERVLET
		war = package(:war, :id => "GrrooBuild")
		war.with :libs => project('Common')
		war.enhance do |war|
		    info "war was created ok"
			sh "$CATALINA_HOME/bin/shutdown.sh"
			cp war.to_s, _(ENV['CATALINA_HOME'], 'webapps')
			sh "$CATALINA_HOME/bin/startup.sh"
		end
		info "end of build Grroo"
	end

I get the printed message war was created ok", however no war is being
created under target folder!

In the logging I can see :

Packaging GrrooBuild-1.0.0.war

Where is the file being packaged to?

-- 
Odelya

Re: war is not being created although packaging war message appears

Posted by Odelya <od...@alicanto.com>.
Thanks
Now it works
I would suggest documentation about enhance feature in buildr



--
View this message in context: http://buildr-users.1056619.n5.nabble.com/war-is-not-being-created-although-packaging-war-message-appears-tp5706557p5706561.html
Sent from the Buildr Users mailing list archive at Nabble.com.

Re: war is not being created although packaging war message appears

Posted by Alex Boisvert <al...@gmail.com>.
Ok so the code should actually be,

  war = package(:war, :id => "MyBuild")
  war.with :libs => project('Common')
  package.enhance do
      sh "$CATALINA_HOME/bin/shutdown.sh" rescue nil
      cp war.to_s, _(ENV['CATALINA_HOME'], 'webapps')
      sh "$CATALINA_HOME/bin/startup.sh"
  end

The issue being that code inside war.enhance (as suggested previously) is
run before the .war file is actually created (hence why the cp command
would fail).   Doing the 'enhance' on the package task instead works around
this issue.

alex


On Wed, Aug 15, 2012 at 8:04 AM, Odelya <od...@alicanto.com> wrote:

> I realized also, that if I remove the lines
>
> sh "$CATALINA_HOME/bin/shutdown.sh"
> cp war.to_s, _(ENV['CATALINA_HOME'], 'webapps')
> sh "$CATALINA_HOME/bin/startup.sh"
>
> The war is actually being created.
>
> But how would cp command work if the war is not being created?
>
>
>
> --
> View this message in context:
> http://buildr-users.1056619.n5.nabble.com/war-is-not-being-created-although-packaging-war-message-appears-tp5706557p5706559.html
> Sent from the Buildr Users mailing list archive at Nabble.com.
>

Re: war is not being created although packaging war message appears

Posted by Odelya <od...@alicanto.com>.
I realized also, that if I remove the lines 

sh "$CATALINA_HOME/bin/shutdown.sh" 
cp war.to_s, _(ENV['CATALINA_HOME'], 'webapps') 
sh "$CATALINA_HOME/bin/startup.sh" 

The war is actually being created.

But how would cp command work if the war is not being created?



--
View this message in context: http://buildr-users.1056619.n5.nabble.com/war-is-not-being-created-although-packaging-war-message-appears-tp5706557p5706559.html
Sent from the Buildr Users mailing list archive at Nabble.com.