Skip to content

Why would we get 'Cannot invoke "java.io.File.toURI()" because "file" is null' from Maven plugin? #582

Closed
@davidmichaelkarr

Description

@davidmichaelkarr

We've been using "jaxb-maven-plugin" for a long time to generate JAXB classes from wsdls and xsds. There are occasional unusual issues we have to deal with, but we've always gotten it to work. We maintain a large number of SpringBoot services, many of which use this to generate JAXB classes from many different schemas.

Today I started looking at one build that is failing with an odd error:

14:26:52 [ERROR] Failed to execute goal org.jvnet.jaxb:jaxb-maven-plugin:4.0.8:generate (ivsad) on project UnifiedAccountMs: Execution ivsad of goal org.jvnet.jaxb:jaxb-maven-plugin:4.0.8:generate failed: Cannot invoke "java.io.File.toURI()" because "file" is null -> [Help 1]

This pom.xml has several "execution" blocks, but I've tried commenting all but one, and other variations, but all of those experiments fail with the same error (with a different execution name).

I've verified that the "sourceDirectory" refers to an existing directory that has a wsdl in it, with several xsd files. Each execution block looks something like this:

  <execution>
	<id>unifiedServices</id>
	<goals>
	  <goal>generate</goal>
	</goals>
	<configuration>
	  <specVersion>2.2</specVersion>
	  <schemaDirectory>${project.basedir}/src/main/resources/schemas/csi_UnifiedServices_240.0_schema</schemaDirectory>
	  <schemaIncludes>
		<include>*.wsdl</include>
	  </schemaIncludes>
	  <generateDirectory>${project.build.directory}/generated-sources/xjc/unifiedServices/</generateDirectory>
	  <forceRegenerate>false</forceRegenerate>
	</configuration>
  </execution>

What are possible causes of this?

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions