maven-war-plugin包括子目录

时间:2015-06-17 12:34:30

标签: java maven maven-war-plugin

我遇到了一个问题,我需要在maven生成的WAR中使用maven-war-plugin包含一些文件夹,但它只包含目录中的文件而不包括子目录。这就是我在pom中配置war-plugin的方法。

override func viewDidLoad() {
    super.viewDidLoad()

    var RightSwipe = UISwipeGestureRecognizer(target: self, action: "SwopeMethodRespond:")
    RightSwipe.direction = UISwipeGestureRecognizerDirection.Right
    self.imgview.addGestureRecognizer(RightSwipe)

    var LeftSwipe = UISwipeGestureRecognizer(target: self, action: "SwopeMethodRespond:")
    LeftSwipe.direction = UISwipeGestureRecognizerDirection.Left
    self.imgview.addGestureRecognizer(LeftSwipe)

    var UpSwip = UISwipeGestureRecognizer(target: self, action: "SwopeMethodRespond:")
    UpSwip.direction = UISwipeGestureRecognizerDirection.Up
    self.imgview.addGestureRecognizer(UpSwip)

    var DownSwipe = UISwipeGestureRecognizer(target: self, action: "SwopeMethodRespond:")
    DownSwipe.direction = UISwipeGestureRecognizerDirection.Down
    self.imgview.addGestureRecognizer(DownSwipe)
}



func SwopeMethodRespond(gesture: UIGestureRecognizer) {

    if let swipeGesture = gesture as? UISwipeGestureRecognizer {

        switch swipeGesture.direction {
        case UISwipeGestureRecognizerDirection.Right:
            println("Right Fire")
        case UISwipeGestureRecognizerDirection.Left:
            println("Left Fire")
        case UISwipeGestureRecognizerDirection.Up:
            println("Up Fire")
        case UISwipeGestureRecognizerDirection.Down:
            println("Down Fire")
        default:
            break
        }
    }
}

这会在war root中生成文件夹数据,如下所示:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
             <webXml>WEB-INF\web.xml</webXml>  
                <webResources>
                    <resource>
                        <directory>icons</directory>
                        <targetPath>icons</targetPath>
                    </resource>
                    <resource>
                        <directory>data</directory>
                        <targetPath>data</targetPath>
                    </resource>
                </webResources>
            </configuration>

        </plugin>

但源文件夹包含我想要复制的子目录。

data
-> file1.txt

有办法做到这一点吗?

1 个答案:

答案 0 :(得分:0)

如果您maven-war-plugin明确说明,可以强制using the appropriate configuration parameter添加空文件夹:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <includeEmptyDirectories>true</includeEmptyDirectories>
          ..
        </configuration>
      </plugin>
    </plugins>
  </build>
  ...
</project>
相关问题