I recently upgraded the Maven Dependency Plugin from 3.3.0 to 3.4.0, and now my build fails during the unpack phase with the following error:
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.4.0:unpack (unpack-dependencies) on project my-project: Error unpacking file: <file-path> Text file busy
Observations:
- The error occurs when multiple threads or builds try to access the same file concurrently.
- The goal is executed during the generate-test-resources phase, and the unpacked files are used immediately in later phases.
- Downgrading back to 3.3.0 resolves the issue.
Question:
- Has anyone encountered this "Text file busy" issue with Maven Dependency Plugin 3.4.0?
- Is there a known workaround for safely unpacking dependencies in parallel builds without hitting this error?
Example Configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>generate-test-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.example</groupId>
<artifactId>my-artifact</artifactId>
<version>1.0.0</version>
<classifier>linux</classifier>
<type>zip</type>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
The goal is executed during the generate-test-resources phase, and the unpacked files are used immediately in later phases.the later phase runs in sequence not parallel... only in such cases where the usage is done in a separate module/sub-project within a parallelized build this can happen which would imply having wrong/missing dependencies given... also would it be helpful to see the full log output, Maven version and the full pom file etc. and how you called Maven ? Which JDK etc. would also very helpful....