Robert,

Thank you for the response. I added sourceDirectory to my POM and the
build completes without error, the schemas were still not being
generated. I found this message in the build log:

[INFO] --- jaxb2-maven-plugin:1.3.1:schemagen (schemagen) @ org.example ---
[INFO] no sources found skip generate schema

After debugging into plugin and then finally into the DirectoryScanner
class in plexus-utils I found that the scanner wasn't walking the
source tree at all. It was just looking at the directory defined by
the sourceDirectory parameter. If it couldn't find it would return an
empty set.

So, I then changed the sourceDirectory so that it pointed to the
directory representing the package containing the source files I
wanted to use and that worked. However, I'm not sure I did this the
correct way. Was I supposed to specify the full path to the sources I
wanted to use or is there some trick to make it walk the project's
entire source tree?

Thank you,

Ben


On Mon, Feb 20, 2012 at 11:41 AM, Robert Scholte <rfscho...@codehaus.org> wrote:
> Did you adjust the sourceDirectory in the pom?
>
> http://maven.apache.org/ref/3.0.4/maven-model/maven.html#class_build
>
> -Robert
>
>> Date: Mon, 20 Feb 2012 11:28:27 -0700
>> From: ben.aberna...@gmail.com
>> To: user@mojo.codehaus.org
>> Subject: [mojo-user] jaxb2:schemagen alternate source directory
>
>>
>> Hello,
>>
>> I am having some trouble getting schemagen to work with my unique use
>> case. I have a project that doesn't follow the standard maven
>> structure. Instead of the source files being under src/main/java, they
>> are under a directory named src. For example,
>> src/org/example/MyClass.java. Why? Long story short, we are using
>> Equinox with the Tycho plugin and things are just this way. When using
>> the jaxb2 plugin, I get the following error:
>>
>> [ERROR] Failed to execute goal
>> org.codehaus.mojo:jaxb2-maven-plugin:1.3.1:schemagen (schemagen) on
>> project org.example: Execution schemagen of goal
>> org.codehaus.mojo:jaxb2-maven-plugin:1.3.1:schemagen failed: basedir
>> C:\example\src\main\java does not exist -> [Help 1]
>>
>> Which, makes sense. Is there a way to tell the plugin to use a
>> different source directory?
>>
>> Thank you,
>>
>> Ben
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to