2014-01-23 60 views
1

我有一個項目,它在本地生成良好。當我運行mvm乾淨的部署它建立良好,sass-maven插件給我以下輸出:與SASS搭建的Maven在Jenkins中不起作用

[INFO] --- sass-maven-plugin:1.1.1:update-stylesheets (default) @ myapp-web --- 
[INFO] Compiling SASS Templates 
[INFO] Queing SASS Template for compile: /Users/750250/Projects/myapp/webapp/src/main/webapp => /Users/750250/Projects/myapp/webapp/src/main/webapp 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/features/abTestStyles/css/S7669.abTest.boldKeywords.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/features/abTestStyles/css/S7669.abTest.boldKeywords.css 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/features/abTestStyles/css/S7728.abTest.common.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/features/abTestStyles/css/S7728.abTest.common.css 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/features/abTestStyles/css/S7728.abTest.noDescription.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/features/abTestStyles/css/S7728.abTest.noDescription.css 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/pages/coolSearchResults/css/coolSearchResults.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/pages/coolSearchResults/css/coolSearchResults.css 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/pages/hotSearchResults/css/hotSearchResults.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/pages/hotSearchResults/css/hotSearchResults.css 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/homeStatic.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/homeStatic.css 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/merchant.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/merchant.css 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/offer.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/offer.css 
[INFO]  >> /Users/750250/Projects/bizratmyappe-eu-webapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/product.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/product.css 
[INFO]  >> /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/searchResults.scss => /Users/750250/Projects/myapp/webapp/src/main/webapp/catalogue/theme/bi_fr/css/pages/searchResu 

指示它的工作原理。然而,當同樣的事情,從詹金斯跑,我得到下面的輸出從插件

[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - --- sass-maven-plugin:1.1.1:update-stylesheets (default) @ myapp-web --- 
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - 
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- sass-maven-plugin:1.1.1:update-stylesheets (default) @ myapp-web --- 
[pool-1-thread-1] INFO org.jasig.maven.plugin.sass.UpdateStylesheetsMojo - Compiling SASS Templates 
[pool-1-thread-1] INFO org.jasig.maven.plugin.sass.UpdateStylesheetsMojo - Queing SASS Template for compile: /home/sitebuild/jenkins/workspace/{myapp}-myapp-webapp-{S7515}/webapp/src/main/webapp => /home/sitebuild/jenkins/workspace/{myapp}-myapp-webapp-{S7515}/webapp/src/main/webapp 

看來,它只是忽略或不拾取該目錄的內容。

在jenkins中運行sass-maven-plugin時會導致這種行爲?

回答

2

我已複製您的問題,它似乎是SASS插件中的錯誤 - 好消息是有一個解決方法。

Jenkins服務器傳遞給插件的絕對路徑包含大括號。這是Maven SASS插件的Ruby程序中常見的錯誤來源。這樣做本地複製你的問題 - 插件啓動,然後根本不編譯任何東西。

當我構建了一個使用相對路徑而不是絕對路徑的POM(src/main/sass vs ${project.dir}/src/main/sass))時,可以構建一個路徑中包含大括號的目錄。

如果插件報告它正在嘗試編譯的路徑看起來有問題,那就太好了。