0

I need to create an empty folder when installing a feature. Any suggestion? So far I tried something like(without success):

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>
            <id>empty-config-folder</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <target>
                    <mkdir dir="${project.build.directory}/assembly/etc/empty-folder" />
                </target>
            </configuration>
        </execution>
    </executions>
</plugin>
Indent
  • 4,675
  • 1
  • 19
  • 35
Hook
  • 127
  • 1
  • 1
  • 5
  • What you are doing above will run during the build, not during the installation of the feature, so cannot work. The suggestion below to just do it in code is the easiest. Otherwise, you would have to play with the feature deifnition itself. This is possible, see how some of the existing ODL features add configuration files to features. Just to create an empty (!) folder it's not worth the trouble though. – vorburger Nov 01 '17 at 14:19

1 Answers1

3

You can simply create the folder in Java code inside one of the bundles you install. See File.mkdirs()

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64