[hibernate-dev] ORM - location of generated sources

Gunnar Morling gunnar at hibernate.org
Wed Jul 22 03:34:14 EDT 2015


Ok, thanks for pointing to that issue.

Would be very interesting to know why/how it still works on the class level
for Gradle. Actually, Java does not mandate the nested directory structure
where a package is represented by a folder (the spec vaguely mentions
alternatives such as a DB-based source repository, or one also could use
"com.example.mypackage" as folder name), but of course the compiler must
support such alternative representations. Not sure how they make that
happen in Gradle ;)

2015-07-21 19:35 GMT+02:00 Steve Ebersole <steve at hibernate.org>:

> As far as I know there is no way to control this at the moment:
> https://discuss.gradle.org/t/antlr-plugin-should-preserve-package-structure/10153
>
> For me it ends up in the right place even in terms of the compiled
> classes, not just the jar.
>
> On Mon, Jul 20, 2015 at 1:50 AM Gunnar Morling <gunnar at hibernate.org>
> wrote:
>
>> Hi,
>>
>> The build for hibernate-core generates sources using Antlr which end up in
>> target/generated-src/antlr/main, e.g. GeneratedOrderByFragmentParser.java.
>>
>> The weird thing is that the generated files are located right within this
>> directory, i.e.  there is *no* directory hierarchy resembling the package
>> structure. The files have package declarations such as
>> "org.hibernate.sql.ordering.antlr", though.
>>
>> Apparently, this works in the Gradle build (no errors due to that), but in
>> my IDE I am getting tons of compile errors due to the mismatch of package
>> declaration and file location. Interestingly, the files also end up in the
>> right place in the hibernate-core.jar, so I assume that there is some
>> Magic
>> in place at the Gradle level which deals with that stuff.
>>
>> Does anyone know how to make it work in the IDE as well?
>>
>> Thanks,
>>
>> --Gunnar
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>
>


More information about the hibernate-dev mailing list