无法使用sass-maven-plugin编译style.scss

时间:2013-05-10 10:31:47

标签: eclipse maven sass maven-2

我想使用sass-maven-plugin将SASS Template style.scss编译成css style.css。我已将插件添加到我的pom.xml build.plugins中,因为它被描述为here。我的pom.xml看起来像这样:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.company.web</groupId>
  <artifactId>scss</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>scss</name>
  <url>http://maven.apache.org</url>

  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <build>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <source>1.4</source>
          <target>1.4</target>
        </configuration>
      </plugin>

<!--       To use the plugin goals in your POM or parent POM -->
      <plugin>
        <groupId>org.jasig.maven</groupId>
        <artifactId>sass-maven-plugin</artifactId>
        <version>1.1.0</version>
      </plugin>

    </plugins>

   <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat6-maven-plugin</artifactId>
          <version>2.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <version>2.1</version>
        </plugin>

      </plugins>

    </pluginManagement>

  </build>


</project>

我使用eclipse运行项目(右键单击项目 - &gt;运行为 - &gt;运行配置 - &gt;并提供为Goals : sass:update-stylesheets

eclipse打印出以下错误:

[ERROR] Failed to execute goal org.jasig.maven:sass-maven-plugin:1.1.0:update-stylesheets (default-cli) on project scss: The parameters 'resources' for goal org.jasig.maven:sass-maven-plugin:1.1.0:update-stylesheets are missing or invalid

我做错了什么?

1 个答案:

答案 0 :(得分:5)

您需要向插件添加配置,以告知它要编译的文件的位置以及放置编译文件的位置。

请参阅http://developer.jasig.org/projects/sass-maven-plugin/1.1.1/update-stylesheets-mojo.html

中的资源