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/13 19:33:56 UTC

Problem with running buildr on ubuntu

Hi

I have the following lines in buildfile

define "BE" do

    project.version = VERSION_NUMBER
	project.group = GROUP
	manifest['Copyright'] = COPYRIGHT

	desc 'Building common project for engine and API'
	define 'Common' do
		compile.with SPRING_CORE,COMMONS_CODEC, COMMONS_IO
		package :jar
	end
	
	desc 'Building API (Grroo) project'
	define 'My' do
		info "starting My 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'),RESTFB,SEARCH,SEARCH_HIBERNATE,SLF4J,SLF4J_LOG4J,STAX_API,TWITTER4J_CORE,WSDL4J
#there are more files
		package(:war, :id=>"MyBuild").with :libs=>project('Common')
		# stop tomcat on port 8081
		sh "$CATALINA_HOME/bin/shutdown.sh"
		# move the war to tomcat
		cp 'GrrooBuild.war', '$CATALINA_HOME/webapps'
		# start tomcat
		sh "$CATALINA_HOME/bin/startup.sh"
	end
end

When I run it in windows, I see how nicely the jar and war are being created:

(this is part of the output)

mkdir -p C:/jenkins/Common/target/classes
Compiling BE:Common into C:/jenkins/Common/target/classes
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
touch C:/jenkins/Common/target/classes
mkdir -p C:/jenkins/My/target/resources
mkdir -p C:/jenkins/My/target/resources
cp C:/jenkins/My/src/main/resources/applicationContext-persistence.xml
C:/jenkins/My/target/resources/applicationContext-persistence.xml
mkdir -p C:/jenkins/My/target/resources
cp C:/jenkins/My/src/main/resources/applicationContext.xml
C:/jenkins/My/target/resources/applicationContext.xml
mkdir -p C:/jenkins/My/target/resources
cp C:/jenkins/My/src/main/resources/jdbc.properties
C:/jenkins/My/target/resources/jdbc.properties
mkdir -p C:/jenkins/My/target/resources
cp C:/jenkins/My/src/main/resources/logback.xml
C:/jenkins/My/target/resources/logback.xml
touch C:/jenkins/My/target/resources


However, in Linux, I run it with the same user and group that created
the Common and My folders from subversion and as if buildr ignores the
compile tasks:

The out put is:

** Invoke alicento-BE (first_time)
** Execute alicento-BE
Defining task BE:shell:bsh
Defining task BE:shell:jirb
Defining task BE:shell:clj
** Invoke BE:Common (first_time)
** Execute BE:Common
Defining task BE:Common:shell:bsh
Defining task BE:Common:shell:jirb
Defining task BE:Common:shell:clj
** Invoke BE:My (first_time)
** Execute BE:My
Defining task BE:My:shell:bsh
Defining task BE:My:shell:jirb
Defining task BE:My:shell:clj
starting My project
** Invoke BE:Common
** Invoke BE:Common
Aug 13, 2012 10:14:44 AM org.apache.catalina.startup.Catalina stopServer
cp MyBuild.war webapps
Buildr aborted!
Errno::ENOENT : No such file or directory - MyBuild.war

The file MyBuild.war is not being created!

While in windows the file is created.

What is the problem in linux? I don't even see a log that describes
what prevents buildr from building the projects and packaging it!

Thanks
-- 
Odelya

Re: Problem with running buildr on ubuntu

Posted by Odelya <od...@alicanto.com>.
I think that I found the problem.

In the buildr command I had to add the *build *parameter like this:

buildr clean build package test:Suite junit:report test=all--trace

It's interesting since in windows adding the build parameter was not
required as well as according to the documentation.
I am using jruby 1.5.1 (ruby 1.8.7 patchlevel 249)
and Buildr 1.4.3




--
View this message in context: http://buildr-users.1056619.n5.nabble.com/Problem-with-running-buildr-on-ubuntu-tp5706549p5706556.html
Sent from the Buildr Users mailing list archive at Nabble.com.

Re: Problem with running buildr on ubuntu

Posted by Odelya <od...@alicanto.com>.
Sorry, under workspace there are 3 projects:
My
Common
Engine



--
View this message in context: http://buildr-users.1056619.n5.nabble.com/Problem-with-running-buildr-on-ubuntu-tp5706549p5706555.html
Sent from the Buildr Users mailing list archive at Nabble.com.

Re: Problem with running buildr on ubuntu

Posted by Odelya <od...@alicanto.com>.
Yes. 
My structure looks like this:
/var/lib/jenkins
      buildfile
/var/lib/jenkins/jobs/Backend/workspace
     My
     Common

Please see the full file:


VERSION_NUMBER = "1.0.0"

GROUP = " "
COPYRIGHT = "My MARKETING LTD"G

ACTIVATION 			= 'javax.activation:activation:jar:1.1'
AMAZON				= 'com.amazonaws:aws-java-sdk:jar:1.3.14'
ANTLR 				= 'antlr:antlr:jar:2.7.6'
AOPALLIANCE			= 'aopalliance:aopalliance:jar:1.0'
ASM 				= 'asm:asm:jar:3.1'
AXIS				= 'org.apache.axis:axis:jar:1.4'
AXIS_SAAJ			= 'org.apache.axis:axis-saaj:jar:1.4'
ASPECTJ 			= 'org.aspectj:aspectjweaver:jar:1.6.8'
BEANUTILS 			= 'commons-beanutils:commons-beanutils:jar:1.8.3'
BRAINTREE			= 'com.braintreegateway:braintree-java:jar:2.15.0'
C3P0 				= 'c3p0:c3p0:jar:0.9.1.2'
CGLIB				= 'cglib:cglib-nodep:jar:2.2.2'
COMMONS_CODEC		= 'commons-codec:commons-codec:jar:1.6'
COMMONS_HIBRENATE	=
'org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final'
COLLECTIONS 		= 'commons-collections:commons-collections:jar:3.2.1'
HTML_CLEANER 		= 'net.sourceforge.htmlcleaner:htmlcleaner:jar:2.2'
DISCOVERY			= 'commons-discovery:commons-discovery:jar:0.5'
HTTPCLIENT 			= 'commons-httpclient:commons-httpclient:jar:3.1'
COMMONS_IO 			= 'commons-io:commons-io:jar:2.1'
LANG 				= 'org.apache.commons:commons-lang3:jar:3.1'
LOGGING 			= 'commons-logging:commons-logging:jar:1.1.1'
VALIDATOR 			= 'commons-validator:commons-validator:jar:1.4.0'
DAO 				= 'com.googlecode.genericdao:dao:jar:1.0.0'
DAOHIBERNATE 		= 'com.googlecode.genericdao:dao-hibernate:jar:1.0.0'
DOM4J 				= 'dom4j:dom4j:jar:1.6.1'
EHCAHCE 			= 'net.sf.ehcache:ehcache:pom:2.5.3'
GEARMAN 			= 'gearman-java:gearman:jar:0.04'
GUAVA 				= 'com.google.guava:guava:jar:12.0.1'
HIBERNATE_JPA 		=
'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final'
HIBERNATE  			= 'org.hibernate:hibernate-core:jar:3.6.10.Final'
IM4JAVA				= 'org.im4java:im4java:jar:1.2.0'
JACKSON_MAPPER 		= 'org.codehaus.jackson:jackson-mapper-asl:jar:1.9.8'
JACKSON_CORE 		= 'org.codehaus.jackson:jackson-core-asl:jar:1.9.8'
JACKSON_JAXRS		= 'org.codehaus.jackson:jackson-jaxrs:jar:1.9.8'
JACKSON_XC 			= 'org.codehaus.jackson:jackson-xc:jar:1.9.8'
JACKSON_MAPPER_LGPL = 'org.codehaus.jackson:jackson-mapper-lgpl:jar:1.9.8'
JACKSON_SMILE 		= 'org.codehaus.jackson:jackson-smile:jar:1.9.8'
JACKSON_ASL 		= 'org.codehaus.jackson:jackson-asl:jar:0.9.5'
JACKSON_LGPL 		= 'org.codehaus.jackson:jackson-lgpl:jar:0.9.5'
JACKSON_MRBEAN 		= 'org.codehaus.jackson:jackson-mrbean:jar:1.9.8'
JAVASSIST 			= 'javassist:javassist:jar:3.3'
JAXB_API 			= 'javax.xml.bind:jaxb-api:jar:2.2.6'
JAXB_IMPL 			= 'com.sun.xml.bind:jaxb-impl:jar:2.2.4'
JAXRPC_API 			= 'javax.xml:jaxrpc-api:jar:1.1'
JAX_RPC				= 'org.apache.axis:axis-jaxrpc:jar:1.4'
JDOM 				= 'org.jdom:jdom:jar:2.0.2'
JERSEY_CLIENT 		= 'com.sun.jersey:jersey-client:jar:1.13'
JERSEY_CORE 		= 'com.sun.jersey:jersey-core:jar:1.13'
JERSEY_JSON 		= 'com.sun.jersey:jersey-json:jar:1.13'
JERSEY_SERVER		= 'com.sun.jersey:jersey-server:jar:1.13'
JERSEY_SERVLET		= 'com.sun.jersey:jersey-servlet:jar:1.13'
JERSEY_SPRING		= 'com.sun.jersey:jersey-servlet:jar:1.13'
JETTISON			= 'org.codehaus.jettison:jettison:jar:1.2'
JSOUP				= 'org.jsoup:jsoup:jar:1.6.3'
JODA_TIME 			= 'joda-time:joda-time:jar:2.1'
JTA 				= 'javax.transaction:jta:jar:1.1'
LIB_PHONE_NUMBER	= 'com.googlecode.libphonenumber:libphonenumber:jar:5.0'
LOGBACK_ACCESS 		= 'ch.qos.logback:logback-access:jar:1.0.6'
LOGBACK_CLASSIC 	= 'ch.qos.logback:logback-classic:jar:1.0.6'
LOGBACK_CORE 		= 'ch.qos.logback:logback-core:jar:1.0.6'
MAIL			 	= 'javax.mail:mail:jar:1.4.5'
MYSQL 				= 'mysql:mysql-connector-java:jar:5.1.21'
OFF_GEOCODER 		= 'com.googlecode.libphonenumber:geocoder:jar:2.1'
OPEN_CSV			= 'net.sf.opencsv:opencsv:jar:2.3'
RESTFB				= 'com.restfb:restfb:jar:1.6.9'
SPRING_AOP 			= 'org.springframework:spring-aop:jar:3.1.2.RELEASE'
SPRING_ASM 			= 'org.springframework:spring-asm:jar:3.1.2.RELEASE'
SPRING_BEANS 		= 'org.springframework:spring-beans:jar:3.1.2.RELEASE'
SPRING_CONTEXT 		= 'org.springframework:spring-context:jar:3.1.2.RELEASE'
SPRING_EXPRESSION 	=
'org.springframework:spring-expression:jar:3.1.2.RELEASE'
SPRING_JDBC 		= 'org.springframework:spring-jdbc:jar:3.1.2.RELEASE'
SPRING_ORM 			= 'org.springframework:spring-orm:jar:3.1.2.RELEASE'
SPRING_TEST 		= 'org.springframework:spring-test:jar:3.1.2.RELEASE'
SPRING_TRANSACTION 	= 'org.springframework:spring-tx:jar:3.1.2.RELEASE'
SPRING_WEB 			= 'org.springframework:spring-web:jar:3.1.2.RELEASE'
SPRING_CORE			= 'org.springframework:spring-core:jar:3.1.2.RELEASE'
SEARCH 				= 'com.googlecode.genericdao:search:jar:1.0.0'
SEARCH_HIBERNATE 	= 'com.googlecode.genericdao:search-hibernate:jar:1.0.0'
SLF4J 				= 'org.slf4j:slf4j-api:jar:1.6.6'
SLF4J_LOG4J			= 'org.slf4j:slf4j-log4j12:jar:1.6.6'
STAX_API			= 'stax:stax-api:jar:1.0.1'
TOMCAT_SERVLET		= 'org.apache.tomcat:tomcat-servlet-api:jar:7.0.29'
TOMCAT_COYOTE		= 'org.apache.tomcat:tomcat-coyote:jar:7.0.29'
TWITTER4J_CORE		= 'org.twitter4j:twitter4j-core:jar:2.2.6'
WSDL4J				= 'wsdl4j:wsdl4j:jar:1.6.2'

download artifact(GEARMAN) =>
'https://launchpad.net/gearman-java/trunk/0.04/+download/gearman-java-0.04.jar'

repositories.remote << "http://repo1.maven.org/maven2"
repositories.remote << "http://braintree.github.com/braintree_java/releases"

desc "Compiling backend of   team"

define "alicento-BE" do
    
    project.version = VERSION_NUMBER
	project.group = GROUP
	manifest['Copyright'] = COPYRIGHT
  
	desc 'Building common project for engine and API'
	define 'Common' do
		compile.with SPRING_CORE,COMMONS_CODEC, COMMONS_IO,
LANG,DAOHIBERNATE,GUAVA,HIBERNATE_JPA,HIBERNATE,HTML_CLEANER,JERSEY_CLIENT,JDOM,JERSEY_CORE,JERSEY_JSON,JERSEY_SERVER,JERSEY_SERVLET,JERSEY_SPRING,JETTISON,JODA_TIME,LIB_PHONE_NUMBER,LOGBACK_ACCESS,LOGBACK_CLASSIC,LOGBACK_CORE,OFF_GEOCODER,SPRING_AOP,SPRING_ASM,SPRING_BEANS,SPRING_CONTEXT,SPRING_EXPRESSION,SPRING_JDBC,SPRING_ORM,SPRING_TEST,SPRING_TRANSACTION,SPRING_WEB,SEARCH,SEARCH_HIBERNATE,SLF4J
		package :jar
	end
	
	desc 'Building API (My) project'
	define 'My' do
		info "starting My 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,
AMAZON,ACTIVATION,ANTLR,AOPALLIANCE,ASM,ASPECTJ,AXIS,BRAINTREE,C3P0,BEANUTILS,COLLECTIONS,COMMONS_CODEC,DISCOVERY,HTTPCLIENT,COMMONS_IO,LANG,LOGGING,VALIDATOR,DAO,DAOHIBERNATE,DOM4J,EHCAHCE,GUAVA,GEARMAN,HIBERNATE_JPA,HIBERNATE,HTML_CLEANER,IM4JAVA,JACKSON_MAPPER,JACKSON_CORE,JACKSON_JAXRS,JACKSON_XC,JACKSON_CORE,JACKSON_MAPPER_LGPL,JACKSON_SMILE,JACKSON_ASL,JACKSON_LGPL,JACKSON_MRBEAN,JAVASSIST,JAXB_API,JAXB_IMPL,JAX_RPC,JDOM,JERSEY_CLIENT,JDOM,JERSEY_CORE,JERSEY_JSON,JERSEY_SERVER,JERSEY_SERVLET,JERSEY_SPRING,JETTISON,JODA_TIME,JSOUP,JTA,LIB_PHONE_NUMBER,LOGBACK_ACCESS,LOGBACK_CLASSIC,LOGBACK_CORE,MAIL,MYSQL,OFF_GEOCODER,OPEN_CSV,SPRING_AOP,SPRING_ASM,SPRING_BEANS,SPRING_CONTEXT,SPRING_CORE,
SPRING_EXPRESSION,SPRING_JDBC,SPRING_ORM,SPRING_TEST,SPRING_TRANSACTION,SPRING_WEB,RESTFB,AXIS_SAAJ,RESTFB,SEARCH,SEARCH_HIBERNATE,SLF4J,SLF4J_LOG4J,STAX_API,TWITTER4J_CORE,WSDL4J
		war = package(:war, :id => "MyBuild") 
		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 My"
	end
 
	desc 'Building the engine project based on common'
	define 'Engine' do
		compile.with  projects('Common'),SPRING_CORE,
ACTIVATION,ANTLR,AOPALLIANCE,ASM,ASPECTJ,C3P0,BEANUTILS,COLLECTIONS,DISCOVERY,HTTPCLIENT,COMMONS_IO,LANG,LOGGING,VALIDATOR,DAO,DAOHIBERNATE,DOM4J,EHCAHCE,GUAVA,HIBERNATE_JPA,HIBERNATE,JAVASSIST,JAXB_API,JAXB_IMPL,JAXRPC_API,JDOM,JERSEY_CLIENT,JERSEY_CORE,JERSEY_JSON,JODA_TIME,JTA,LOGBACK_ACCESS,LOGBACK_CLASSIC,LOGBACK_CORE,MAIL,MYSQL,SPRING_AOP,SPRING_ASM,SPRING_BEANS,SPRING_CONTEXT,SPRING_EXPRESSION,SPRING_JDBC,SPRING_ORM,SPRING_TEST,SPRING_TRANSACTION,SPRING_WEB,SEARCH,SEARCH_HIBERNATE,SLF4J,JACKSON_MAPPER,JACKSON_CORE,JACKSON_JAXRS,JACKSON_XC,JACKSON_CORE,JACKSON_MAPPER_LGPL,JACKSON_SMILE,JACKSON_ASL,JACKSON_LGPL,JACKSON_MRBEAN,AXIS_SAAJ
		test.with CGLIB,COMMONS_HIBRENATE,LIB_PHONE_NUMBER,HTML_CLEANER
		package :jar
		#run.using :main => "com.My.engine.main.EngineMain"
	end
	
	test.using :fail_on_failure=>true
	#extending the test task if everything worked fine: 
	build do |test_task|
		info "extending test task #{test_task.inspect}"
		#stop tomcat on port 8081 to copy the new version
		sh('$CATALINA_HOME/bin/shutdown.sh')
		rm_rf '$CATALINA_HOME/webapps/My'
		rm_rf '$CATALINA_HOME/webapps/My.war'
		cp 'MyBuild.war', '$CATALINA_HOME/webapps/My.war'
		#rm_rf '$CATALINA_HOME/webapps/MyBuild'
		#rm '$CATALINA_HOME/webapps/MyBuild.war'
		# start tomcat 
		sh('$CATALINA_HOME/bin/startup.sh')
		#wait for the application to go up
		sh "while ! wget -q -O /dev/null http://api1.dev. .com/ ; do echo waiting
; sleep 3 ; done"
		sh('$CATALINA_COPY/bin/shutdown.sh')
		rm_rf '$CATALINA_COPY/webapps/My'
		rm_rf '$CATALINA_COPY/webapps/My.war'
		cp 'MyBuild.war', '$CATALINA_COPY/webapps/My.war'
		# start tomcat 
		sh('$CATALINA_COPY/bin/startup.sh')
	end	 
end

Thanks

In windows it works fine. I am not sure why it doesn't work in ubuntu



--
View this message in context: http://buildr-users.1056619.n5.nabble.com/Problem-with-running-buildr-on-ubuntu-tp5706549p5706554.html
Sent from the Buildr Users mailing list archive at Nabble.com.

Re: Problem with running buildr on ubuntu

Posted by Alex Boisvert <al...@gmail.com>.
Are you invoking buildr from the top-level directory?

On Mon, Aug 13, 2012 at 12:55 PM, Alex Boisvert <al...@gmail.com>wrote:

> I've created a similar (skeleton) project and everything is being called
> as expected with the command-line that you provided.    I'm not sure what
> your issue is ... and I think I would need the full buildfile and trace to
> figure it out.
>
> alex
>
>
> On Mon, Aug 13, 2012 at 12:44 PM, Odelya <od...@alicanto.com> wrote:
>
>> Thanks
>>
>> I also added info messages like this
>>
>>                 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 My"
>>
>> However, the first one (inside the enhance code) is not being called, and
>> the second one is being called.
>> I don't see that a war was created.
>>
>> How could I know why it skips the building and packaging task?
>>
>> Or what could it work?
>> My command is:
>> buildr clean package test:Suite junit:report test=all --trace
>>
>>
>>
>> --
>> View this message in context:
>> http://buildr-users.1056619.n5.nabble.com/Problem-with-running-buildr-on-ubuntu-tp5706549p5706551.html
>> Sent from the Buildr Users mailing list archive at Nabble.com.
>>
>
>

Re: Problem with running buildr on ubuntu

Posted by Alex Boisvert <al...@gmail.com>.
I've created a similar (skeleton) project and everything is being called as
expected with the command-line that you provided.    I'm not sure what your
issue is ... and I think I would need the full buildfile and trace to
figure it out.

alex


On Mon, Aug 13, 2012 at 12:44 PM, Odelya <od...@alicanto.com> wrote:

> Thanks
>
> I also added info messages like this
>
>                 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 My"
>
> However, the first one (inside the enhance code) is not being called, and
> the second one is being called.
> I don't see that a war was created.
>
> How could I know why it skips the building and packaging task?
>
> Or what could it work?
> My command is:
> buildr clean package test:Suite junit:report test=all --trace
>
>
>
> --
> View this message in context:
> http://buildr-users.1056619.n5.nabble.com/Problem-with-running-buildr-on-ubuntu-tp5706549p5706551.html
> Sent from the Buildr Users mailing list archive at Nabble.com.
>

Re: Problem with running buildr on ubuntu

Posted by Odelya <od...@alicanto.com>.
Thanks

I also added info messages like this

                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 My"

However, the first one (inside the enhance code) is not being called, and
the second one is being called.
I don't see that a war was created.

How could I know why it skips the building and packaging task?

Or what could it work?
My command is:
buildr clean package test:Suite junit:report test=all --trace



--
View this message in context: http://buildr-users.1056619.n5.nabble.com/Problem-with-running-buildr-on-ubuntu-tp5706549p5706551.html
Sent from the Buildr Users mailing list archive at Nabble.com.

Re: Problem with running buildr on ubuntu

Posted by Alex Boisvert <al...@gmail.com>.
Hi Odelya,

The code inside the 'define' block gets executed during project definition
so it should only contain code that pertains to the project's definition
(i.e., no side-effects).

I suggest you refactor the code as follows,

  war = package(:war, :id => "MyBuild")

  war.with :libs => project('Common')

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

The `enhance` code block will now only run _after_ the war has been created.

alex

On Mon, Aug 13, 2012 at 10:33 AM, Odelya Holiday <od...@alicanto.com>wrote:

> Hi
>
> I have the following lines in buildfile
>
> define "BE" do
>
>     project.version = VERSION_NUMBER
>         project.group = GROUP
>         manifest['Copyright'] = COPYRIGHT
>
>         desc 'Building common project for engine and API'
>         define 'Common' do
>                 compile.with SPRING_CORE,COMMONS_CODEC, COMMONS_IO
>                 package :jar
>         end
>
>         desc 'Building API (Grroo) project'
>         define 'My' do
>                 info "starting My 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'),RESTFB,SEARCH,SEARCH_HIBERNATE,SLF4J,SLF4J_LOG4J,STAX_API,TWITTER4J_CORE,WSDL4J
> #there are more files
>                 package(:war, :id=>"MyBuild").with :libs=>project('Common')
>                 # stop tomcat on port 8081
>                 sh "$CATALINA_HOME/bin/shutdown.sh"
>                 # move the war to tomcat
>                 cp 'GrrooBuild.war', '$CATALINA_HOME/webapps'
>                 # start tomcat
>                 sh "$CATALINA_HOME/bin/startup.sh"
>         end
> end
>
> When I run it in windows, I see how nicely the jar and war are being
> created:
>
> (this is part of the output)
>
> mkdir -p C:/jenkins/Common/target/classes
> Compiling BE:Common into C:/jenkins/Common/target/classes
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
> touch C:/jenkins/Common/target/classes
> mkdir -p C:/jenkins/My/target/resources
> mkdir -p C:/jenkins/My/target/resources
> cp C:/jenkins/My/src/main/resources/applicationContext-persistence.xml
> C:/jenkins/My/target/resources/applicationContext-persistence.xml
> mkdir -p C:/jenkins/My/target/resources
> cp C:/jenkins/My/src/main/resources/applicationContext.xml
> C:/jenkins/My/target/resources/applicationContext.xml
> mkdir -p C:/jenkins/My/target/resources
> cp C:/jenkins/My/src/main/resources/jdbc.properties
> C:/jenkins/My/target/resources/jdbc.properties
> mkdir -p C:/jenkins/My/target/resources
> cp C:/jenkins/My/src/main/resources/logback.xml
> C:/jenkins/My/target/resources/logback.xml
> touch C:/jenkins/My/target/resources
>
>
> However, in Linux, I run it with the same user and group that created
> the Common and My folders from subversion and as if buildr ignores the
> compile tasks:
>
> The out put is:
>
> ** Invoke alicento-BE (first_time)
> ** Execute alicento-BE
> Defining task BE:shell:bsh
> Defining task BE:shell:jirb
> Defining task BE:shell:clj
> ** Invoke BE:Common (first_time)
> ** Execute BE:Common
> Defining task BE:Common:shell:bsh
> Defining task BE:Common:shell:jirb
> Defining task BE:Common:shell:clj
> ** Invoke BE:My (first_time)
> ** Execute BE:My
> Defining task BE:My:shell:bsh
> Defining task BE:My:shell:jirb
> Defining task BE:My:shell:clj
> starting My project
> ** Invoke BE:Common
> ** Invoke BE:Common
> Aug 13, 2012 10:14:44 AM org.apache.catalina.startup.Catalina stopServer
> cp MyBuild.war webapps
> Buildr aborted!
> Errno::ENOENT : No such file or directory - MyBuild.war
>
> The file MyBuild.war is not being created!
>
> While in windows the file is created.
>
> What is the problem in linux? I don't even see a log that describes
> what prevents buildr from building the projects and packaging it!
>
> Thanks
> --
> Odelya
>