I'm having a problem with the maven antrun plugin. I can compile my multi-project tier pom.xml with any out-of-the-box maven, with a custom settings (added private nexus repository).
When I try to build this project on a Jenkins build, with the same custom settings, it always fails with:
main:
[taskdef] Could not load definitions from resource task.properties. It could not be found.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (default) on project redacted: An Ant BuildException has occured: Problem: failed to create task or type resourceCheck
[ERROR] Cause: The name is undefined.
[ERROR] Action: Check the spelling.
[ERROR] Action: Check that any custom tasks/types have been declared.
[ERROR] Action: Check that any <presetdef>/<macrodef> declarations have taken place.
All the StackOverflow threads are due to missconfiguration on the antrun plugin, or on the build.xml file, but this configuration is on hundreds of developers' laptops, and all working as intended.
I have tried multiple maven instalations on Jenkins, multiple versions, and they all fail because the file task.properties is not found.
I ask if this is hidden somewhere on default maven metadata folders, because I have searched everywhere on the local-repository and all projects, and this file is nowhere to be found, and it still compiles on hundreds of machines (besides this project being on multiple productions systems).
Does anyone know where a task.properties default file can be found on anything related to Maven?
Edit: This is what the plugin looks like on the pom:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<taskdef classpathref="maven.compile.classpath"
resource="task.properties" />
<resourceCheck>
<fileset dir="src/main/resources/metainfo">
<include name="i3-label.properties" />
</fileset>
<checks>
<include name="unicode check" />
<include name="line end check" />
<include name="empty key check" />
<include name="placeholder check" />
<include name="duplicate key check" />
<include name="empty value check" />
<include name="cross bundle check" /
</checks>
</resourceCheck>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
I figured out what the problem was. As stated, it shouldn't be a missconfiguration on any pom.xml. In this case it was because of the localRepository definition on the settings used on Jenkins. It was defined as
And although this works on any Windows workstation (even if there isn't a mavenLocation environment variable defined, it would just create a folder litterally named ${env.mavenLocation} and then a repository folder inside it), it does not work on Jenkins. Jenkins successfully uses the localRepository location to store all the artifacts, poms, etc. but maybe this blocks maven from using its default properties.
I'm not sure why this changes the "basic metadata" that maven is using to compile files, but it was definitely the problem. Hope this helps some folks in similar situations.