3

我想使用 sass-maven-plugin 将一些编译SASS Template style.scsscss style.css. 我已将插件添加到我的 pom.xml build.plugins 中,因为它在此处进行了描述。我的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运行项目(右键单击项目->运行为->运行配置->并给出为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

我做错了什么?

4

1 回答 1

5

您需要向插件添加配置以告诉它要编译的文件在哪里以及将编译后的文件放在哪里。

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

于 2013-05-15T07:12:10.953 回答