IntelliJ does not find the jaxb generated sources

Answered


I am using IntelliJ12 UltimateEdition on my OSX computer.

I have a multi-module project, which has one jaxb module.

Executing "mvn clean install" works correctly (it creates the jaxb/target/*).

However,
IntelliJ don't find the jaxb generated sources,
and I have to manually go to IntelliJ, select my jaxb module -> Open Module Settings ->
and select the "target/generated/sources" as "Sources" and remove "target/" from "Excluded".

then it works fine.
however, i need to do this every time I make a "mvn clean install".

It seems that the problem is with the name of the folder.
my "mvn clean install" generates "target/generated/sources"
and IntelliJ expects to find "target/generated-sources/" (note the '-' instead of '/').


do you know what could be the problem?
also, going to IntelliJ and clicking on "Maven -> Generate sources and Update Folders For All Projects",
creates a directory "target/generated/resources" where it gets all the XSD files
but it does not create the target/generated/sources, nor target/generated-sources.


This works fine with IntelliJ on Windows, but it fails on my OSX.

---
OS: Mac OS X
JDK: JDK 1.6.0
IDEA: 12.0
Build: IU-123.94

3 comments
Comment actions Permalink

Hello Daved,
Please, attach sample project.
Sorry for delay.

0
Comment actions Permalink

I am having a similar problem.

For several versions of IntelliJ every time I did a clean install the generated source directory was set correctly.

With the latest 2016 version, the source directory is lost and has to be manually reset.
In fact a source directory nested far down into the generated-source/xjc directory is selected.

This is a copy of the build section of the pom

 

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/*.eap</exclude>
<exclude>**/*.ldb</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.1</version>
<configuration>
<extension>true</extension>
<removeOldOutput>false</removeOldOutput>
<forceRegenerate>true</forceRegenerate>
</configuration>

<executions>
<execution>
<id>business-objects</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<catalog>src/main/resources/schema/catalog.cat</catalog>
<schemaIncludes>
<include>system.xsd</include>
<include>common.xsd</include>
<include>person.xsd</include>
<include>credentials.xsd</include>
<include>membership.xsd</include>
<include>qualifications.xsd</include>
<include>competition.xsd</include>
<include>payment.xsd</include>
<include>invoice.xsd</include>
<include>marketing.xsd</include>
<include>system-process.xsd</include>
<include>person-process.xsd</include>
<include>membership-process.xsd</include>
<include>credentials-process.xsd</include>
<include>qualifications-process.xsd</include>
<include>communique-process.xsd</include>
<include>payment-process.xsd</include>
<include>invoice-process.xsd</include>
<include>competition-process.xsd</include>
</schemaIncludes>
<bindingDirectory>src/main/resources/binding</bindingDirectory>
<bindingIncludes>
<include>bindings.xml</include>
</bindingIncludes>
<schemaDirectory>src/main/resources/schema</schemaDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
0
Comment actions Permalink

Please submit a bug at https://youtrack.jetbrains.com/issues/IDEA with a sample project to reproduce.

0

Please sign in to leave a comment.