Fuck-ups

This page contains a collection of fuck-ups I made while programming hopefully learned a lesson from them.

The collection is not complete as I fucked up many times in my life. I just started to collect them a bit later. As the number will grow, I probably organize them into specific directories.

Why they are not among other things I learned? There are two reasons:

  • If I fuck up again, I would like to see "Ha, you fucked this exactly up before!".

  • The collection does not follow the "Today I learned" idea but rather "I fucked up because I didn’t read docs".

Maven

Maven Clean Plugin always removes the default output directory

14-12-2023, source: StackOverflow (self) , documentation: clean-mojo

I customized Maven Clean Plugin because I wanted to make a clean-up some generated files from the earlier phases I wanted to package but not to remain in the target after it. I chose pre-integration-test.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-clean-plugin</artifactId>
    <version>${maven-clean-plugin.version}</version>
    <executions>
        <execution>
            <phase>post-integration-test</phase>
            <goals>
                <goal>clean</goal>
            </goals>
            <configuration>
                <filesets>
                    <fileset>
                        <directory>${project.basedir}/refs</directory>
                    </fileset>
                </filesets>
            </configuration>
        </execution>
    </executions>
</plugin>

The integration tests meant to run in the later integration-test phase were not executed at all as they were simply missing. Why? The plugin whipped the whole target out. To retain the target (i.e. the default output directory), one needs to set excludeDefaultDirectories ti true.

<configuration>
    <excludeDefaultDirectories>true</excludeDefaultDirectories>
    <filesets>
        <fileset>
            <directory>${project.basedir}/refs</directory>
        </fileset>
    </filesets>
</configuration>