Skip to content

Commit

Permalink
Automatically removing empty src/test on builds
Browse files Browse the repository at this point in the history
Still not sure which process (Maven/NetBeans?) is creating these empty directories
  • Loading branch information
ao-apps committed May 14, 2022
1 parent fc84948 commit db06149
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ along with ao-oss-parent. If not, see <https://www.gnu.org/licenses/>.
scmUrl="@{project.scm.url}"
>
<!-- TODO: Integrate The Checker Framework into all builds? https://checkerframework.org/ -->
<!-- TODO: Remove empty src/test/java and src/test during builds, NetBeans making them? -->
<ul>
<li>Updated to latest release of <ao:a href="https://github.com/s4u/pgp-keys-map">PGP keys map to maven artifacts</ao:a>.</li>
<li>Updated plugin versions.</li>
Expand Down
29 changes: 29 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,35 @@ along with ao-oss-parent. If not, see <https://www.gnu.org/licenses/>.
</plugins>
</build>
</profile>
<profile>
<!-- Remove empty test directories that are created by something (NetBeans?) -->
<id>remove-empty-test</id><activation><file><exists>src/test</exists></file></activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId><artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>remove-empty-test</id><phase>initialize</phase><goals><goal>run</goal></goals>
<configuration>
<target>
<!-- See https://stackoverflow.com/a/5706781 -->
<delete includeemptydirs="true">
<fileset dir="${project.basedir}/src/test">
<and>
<size value="0" />
<type type="dir" />
</and>
</fileset>
</delete>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Sadly, cannot use Maven properties in profile activation: ${project.build.sourceDirectory} -->
<id>war-attachClasses</id><activation><file><exists>src/main/java</exists></file></activation>
Expand Down

0 comments on commit db06149

Please sign in to comment.