English 中文(简体)
我如何把一个空洞的名录列入一次夜会?
原标题:How do I include an empty directory in a maven assembly?
  • 时间:2011-10-26 21:30:59
  •  标签:
  • maven

在必须共同出现的情况下,我需要把一个空洞的名录列入议会。 在我的案件中,是标志。

我尝试了集会描述的不同之处,例如:

<fileSet>
  <directory>${basedir}/target</directory>
  <includes>
    <include>doesntexist</include>
  </includes>
  <outputDirectory>/logs</outputDirectory>
  <fileMode>0644</fileMode>
</fileSet>

并且该名录刚刚开张。

我也试图排除,但这仍然包括许多 st子:

<fileSet>
  <directory>${basedir}/target</directory>
  <excludes>
    <exclude>*</exclude>
  </excludes>
  <outputDirectory>/logs</outputDirectory>
  <fileMode>0644</fileMode>
</fileSet>
问题回答

这始终对我有利:

<fileSets>
  <fileSet>
    <directory>.</directory>
    <outputDirectory>logs</outputDirectory>
    <excludes>
      <exclude>*/**</exclude>
    </excludes>
  </fileSet>
</fileSets>

Courtesy, .this SOwer,加上一些试验和错误,以下一点似乎是为我工作。

<fileSet>
  <directory>src/main/assembly</directory>
  <outputDirectory>/logs</outputDirectory>
  <excludes>
    <exclude>*</exclude>
  </excludes>
</fileSet>

The key seems to be to ensure that <directory> tag specifies a valid/existing folder, which does not have any subfolders.

<fileSets>
    <fileSet>
        <directory>./EMPTY_DIRECTORY_NAME</directory>
        <outputDirectory>/REQUIRED_DIRECTORY_NAME in Assembly </outputDirectory>
        <excludes>
            <exclude>*/**</exclude>
        </excludes>
    </fileSet>
</fileSets>

e.g.

<fileSets>
    <fileSet>
        <directory>./Logs</directory>
        <outputDirectory>/Feed</outputDirectory>
        <excludes>
          <exclude>*/**</exclude>
        </excludes>
    </fileSet>
</fileSets>

在本案中,即使有些内容在内部。 记录目录将不列入Fed目录的集邮本。





相关问题
JavaFX with Maven [closed]

I recently started a JavaFX project, and I d like to use Maven as my compiler/deployment tool. Is there a good tutorial or plugin to integrate JavaFX and Maven?

How to upload jar to respository?

I have jar files that cannot be found on Maven Central repository. I would like to add the jar so I can just include extra tag in my pom.xml file and other developer can use the jar. What are the ...

Debug Maven project in Eclipse with third party sources

I am currently developing a maven project in eclipse. The m2eclipse plugin works beautifully. It even works out of the box with debugging. But when I am debugging open source third party libarries. ...

Could Free Pascal benefit of something like Apache Maven?

Apache Maven is a very popular build and dependency management tool in the Java open source ecosphere. I did some tests to find out if it can handle compiled Free Pascal / Delphi units and found it ...

Run a single test method with maven

I know you can run all the tests in a certain class using: mvn test -Dtest=classname But I want to run an individual method and -Dtest=classname.methodname doesn t seem to work.

Uploading a directory using sftp with Maven

How can I upload a directory - Eclipse update site - using sftp with public key authentication in Maven? For background information: I m using tycho to build an Eclipse plugin and want to get the ...

What are solid NMaven or build servers for .NET alternatives?

Maven had a long history and is well supported in the Java world. NMaven has received a less successful start and has never become as popular in the C#/.NET world as its larger cousin was in the Java ...

热门标签