我有一个项目,可以在本地构建。当我运行mvm clean deploy时,它构建得很好,而且sass-maven插件为我提供了以下输出:
[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
表明它有效。但是,当从Jenkins运行相同的东西时,我从插件
获得以下输出[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会导致什么行为?
答案 0 :(得分:2)
我已经复制了你的问题,它似乎是SASS插件中的一个错误 - 好消息是有一个解决方法。
Jenkins服务器传递给插件的绝对路径包含花括号。这是Ruby程序中常见的bug漏洞,Maven SASS插件就是这样。这样做会在本地复制您的问题 - 插件启动,然后根本不编译任何东西。
当我构建一个使用相对路径而不是绝对路径(src/main/sass
vs ${project.dir}/src/main/sass
))的POM时,可以构建一个路径包含花括号的目录。
如果插件报告它尝试编译的路径似乎有问题,那将是件好事。