我正在尝试使用带有gradle的scss来生成css文件。但是,在运行gradle build
时出现错误我收到的错误是
Execution failed for task ':sassCompile'.
> java.lang.NullPointerException (no error message)
我有以下scss代码
brand_oit_appdev.scss
//brand_oit_appdev
@import 'bootstrap_overrides';
header {
.navbar-header {
margin-left: 7px;
a.umn-homepage {
background-image: url(../../images/revised-wordmark-transparent.png);
background-repeat: no-repeat;
margin-top: 4px;
margin-left: -10px;
height: 70px;
width: 305px;
display: block;
span {
visibility: hidden;
}
}
}
.global-links {
margin-top:5px;
font-weight: 200;
font-size: .9em;
ul {
margin-bottom: 0;
}
a {
color: $umn-white;
}
}
.search-form {
text-align: right;
margin-top: 4px;
margin-bottom: 0;
margin-right: -15px;
input {
width: 15em !important;
border-radius: 0 !important;
border: none;
transition: width .3s !important;
&:focus {
width: 21em !important;
}
}
button {
border: none;
background-color: inherit;
color: $umn-white;
font-weight: bold;
span {
font-size: 1.8em;
}
&:hover, &:focus {
color: $umn-white;
}
}
}
.navbar-brand {
img {
width: 32px;
display: block;
float: left;
margin-right: 14px;
}
}
.application-title {
font-weight: 900;
}
}
@media (-webkit-min-device-pixel-ratio: 2) {
/* Retina-specific stuff here */
.navbar-header {
a.umn-homepage {
background-image: url(../../images/revised-wordmark-transparent@2x.png) !important;
background-size: 410px 159px !important;
}
}
}
h1.page-header {
font-weight: lighter;
}
.table-nonfluid {
width: auto !important;
}
@media (max-width: $screen-sm-min) {
.application-title {
font-size: $font-size-h3 !important;
}
}
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 6em;
}
table {
.numeric {
text-align: right;
}
}
footer {
font-size: .9em;
position: absolute;
bottom: 0;
width: 100%;
height: 4.5em;
text-align: center;
}
blockquote footer{
position:relative;
height:inherit;
text-align:inherit;
}
.label-style{
/* mimics Bootstrap's label styling */
max-width:100%;
margin-bottom:5px;
font-weight:bold;
}
*:focus{
border-color: rgba(82,168,236,.8) !important;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6) !important;
outline: 0 none !important;
outline: thin dotted \9; /* IE6-9 */
}
leaguespartan.scss
@font-face {
font-family: 'League Spartan';
src: url('leaguespartan-bold.eot');
src: url('leaguespartan-bold.eot?#iefix') format('embedded-opentype'),
url('leaguespartan-bold.woff2') format('woff2'),
url('leaguespartan-bold.woff') format('woff'),
url('leaguespartan-bold.ttf') format('truetype'),
url('leaguespartan-bold.svg#league_spartanbold') format('svg');
font-weight: bold;
font-style: normal;
}
bootstrap_overrides.scss
// bootstrap_overrides
@import 'leaguespartan';
@import '../bower_components/bootstrap-sass/assets/stylesheets/bootstrap';
$umn-maroon: #7a0019;
$umn-maroon-dark: #570412; // from portal nav
$umn-gold: #ffcc33;
$umn-white: #ffffff;
$font-family-sans-serif: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
$title-font: $font-family-sans-serif;
$font-size-base: 16px;
$icon-font-path: "../bower_components/bootstrap-sass/assets/fonts/bootstrap/";
$include-global-links: true;
$navbar-padding-horizontal: 0px;
//$navbar-height: 62px;
$navbar-margin-bottom: 0;
$navbar-border-radius: none;
$navbar-default-bg: $umn-gold;
$navbar-default-border: none;
$navbar-default-link-color: $umn-maroon;
$navbar-default-link-hover-color: $umn-maroon;
$navbar-default-link-active-color: $umn-maroon;
$navbar-inverse-bg: $umn-maroon;
$navbar-inverse-border: none;
$navbar-inverse-link-color: $umn-maroon;
$navbar-inverse-link-hover-color: $umn-maroon;
$navbar-inverse-link-active-color: $umn-maroon;
$navbar-inverse-link-active-bg: darken($umn-maroon, 5%);
$navbar-inverse-toggle-hover-bg: darken($umn-maroon, 5%);
$navbar-inverse-toggle-icon-bar-bg: $umn-maroon;
$navbar-inverse-toggle-border-color: none;
$breadcrumb-bg: $umn-white;
$breadcrumb-padding-horizontal: 0;
$breadcrumb-padding-vertical: 1.5em;
caption,
.text-muted,
blockquote footer, blockquote small, blockquote .small,
h1 small, h1 .small, h2 small, h2 .small, h3 small, h3 .small, h4 small, h4 .small, h5 small, h5 .small, h6 small, h6 .small, .h1 small, .h1 .small, .h2 small, .h2 .small, .h3 small, .h3 .small, .h4 small, .h4 .small, .h5 small, .h5 .small, .h6 small, .h6 .small{
color:#666 /*Should the Bootstrap's lighter gray be reset? */
}
.btn-success, .btn-info, .btn-warning, .btn-danger, .label-success, .label-info, .label-warning, .label-danger{
text-shadow: 0 0 2px #000000;
}
这是我的build.gradle,至少是相关部分
plugins {
id 'maven-publish'
id 'java'
id "it.tellnet.sass" version "1.2"
}
apply plugin: "it.tellnet.sass"
configurations {
runtime
configurations.runtime.extendsFrom configurations.sassRuntime
}
sass {
sassDir = 'server/src/main/webapp/stylesheets/scss'
cssDir = 'server/src/main/webapp/stylesheets/css'
minify = false
silenceErrors = false
}
错误确实消失了我将导入从bootstrap_overrides移到同一行,但输出文件基本上是oit-brand文件,没有任何替换,大约150行。我用ruby编译了这些文件,css大约是5000行。
这是请求的堆栈跟踪
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sassCompile'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:45)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:233)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:74)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:55)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:197)
at org.gradle.internal.Factories$1.create(Factories.java:25)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:194)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:36)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:118)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:112)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:98)
at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:293)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NullPointerException
at com.vaadin.sass.internal.util.ColorUtil.adjust(ColorUtil.java:572)
at com.vaadin.sass.internal.util.ColorUtil.darken(ColorUtil.java:584)
at com.vaadin.sass.internal.parser.function.DarkenFunctionGenerator.computeForArgumentList(DarkenFunctionGenerator.java:42)
at com.vaadin.sass.internal.parser.function.AbstractFunctionGenerator.compute(AbstractFunctionGenerator.java:72)
at com.vaadin.sass.internal.parser.LexicalUnitImpl.evaluateFunctionsAndExpressions(LexicalUnitImpl.java:826)
at com.vaadin.sass.internal.tree.VariableNode.traverse(VariableNode.java:84)
at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:227)
at com.vaadin.sass.internal.tree.controldirective.TemporaryNode.traverseChildren(TemporaryNode.java:53)
at com.vaadin.sass.internal.visitor.ImportNodeHandler.traverse(ImportNodeHandler.java:97)
at com.vaadin.sass.internal.tree.ImportNode.traverse(ImportNode.java:99)
at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:227)
at com.vaadin.sass.internal.tree.controldirective.TemporaryNode.traverseChildren(TemporaryNode.java:53)
at com.vaadin.sass.internal.visitor.ImportNodeHandler.traverse(ImportNodeHandler.java:97)
at com.vaadin.sass.internal.tree.ImportNode.traverse(ImportNode.java:99)
at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:227)
at com.vaadin.sass.internal.tree.controldirective.TemporaryNode.traverseChildren(TemporaryNode.java:53)
at com.vaadin.sass.internal.visitor.ImportNodeHandler.traverse(ImportNodeHandler.java:97)
at com.vaadin.sass.internal.tree.ImportNode.traverse(ImportNode.java:99)
at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:227)
at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:214)
at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:298)
at com.vaadin.sass.internal.ScssStylesheet.compile(ScssStylesheet.java:267)
at com.vaadin.sass.internal.ScssStylesheet.compile(ScssStylesheet.java:242)
at com.vaadin.sass.internal.ScssStylesheet$compile$3.call(Unknown Source)
at it.tellnet.gradle.SassCompilerImpl.exec(SassCompilerImpl.groovy:31)
at it.tellnet.gradle.SassCompilerImpl$exec.call(Unknown Source)
at it.tellnet.gradle.SassCompileTask$_compileAllCss_closure1.doCall(SassCompileTask.groovy:30)
at it.tellnet.gradle.SassCompileTask.compileAllCss(SassCompileTask.groovy:19)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:624)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:607)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
... 69 more
BUILD FAILED
我无法解决此问题。