Ian et al,

I reverted the code changes pending discussion. I left the pom
changes; I assert that they are improvement.


On Fri, Jun 27, 2014 at 10:55 AM, Benson Margulies
<bimargul...@gmail.com> wrote:
> On Fri, Jun 27, 2014 at 10:47 AM, Ian Dickinson <i.j.dickin...@gmail.com> 
> wrote:
>> On Fri, Jun 27, 2014 at 3:31 PM, Benson Margulies <bimargul...@gmail.com> 
>> wrote:
>>> On Fri, Jun 27, 2014 at 10:05 AM, Ian Dickinson <i.j.dickin...@gmail.com> 
>>> wrote:
>>>> Actually, now that I've reviewed it, there's a conflict between this
>>>> patch and the current behaviour. At the moment, the way to set the
>>>> output directory to something other than target/generated-sources is
>>>> to set the output configuration parameter. If this is a directory,
>>>> generated files go into that directory. If that option is set in the
>>>> defaults section of the schemagen config, it affects all of the
>>>> generated files. Tl;dr: there is already a mechanism for changing the
>>>> default output directory for all generated files.
>>>>
>>>> Voting to reject this patch until it's clearer why users need two
>>>> mechanisms for achieving the same end.
>>>
>>> So, I'll remove the redundancy, but have I convinced you about the
>>> problem of it not getting compiled?
>> Yes, absolutely. I'm not using the plugin day-by-day (I rarely do Java
>> dev these days, in fact), so direct experience by someone using the
>> tool definitely takes precedence.
>>
>> I'm actually not sure what the right solution here is. With the
>> current mechanism, the output directory can be specified on an
>> vocabulary-by-vocabulary basis. Any of those locations might already
>> be in the source tree already (e.g. we support the scenario where
>> someone generates the .java file directly under src/main/java, so that
>> the translated file can be kept under source control). So I'm not sure
>> - and you are in a better position to advise on this - that just
>> calling addCompileSourceRoot() on each output directory would be
>> correct.
>
>
>
>
>>
>> Perhaps the answer is that the location of the output files should
>> remain with the current configuration process, but there should be an
>> additional means, via the pom.xml, to add one or more directories to
>> the sources root. That could have a default value, so *if* the default
>> default output is left as target/generated-sources/jena, and *if* the
>> user doesn't change anything in the pom, then the output Java files
>> will still compile.
>
> To do exactly what you suggest, all we need to do is revert my change;
> the build-helper-maven-plugin is already a way to add a directory to
> the source roots via pom config.
>
> However, I have a more complex idea to offer you:
>
> Maybe redundancy is not redundancy.
>
> We tell users: If you want to just produce sources to include in the
> build, you use my new top-level property as the single source root,
> and we will add it to the build, and all will be well. If you want to
> do something more complex, you can use the older scheme, and it's up
> to you to arrange for it to compile, perhaps using the
> build-helper-maven-plugin.
>
> To make this really painless, we'd need one more boolean property:
> useOutputDirectory. Default is false, preserving old behavior. Set to
> true, gets new behavior, respecting new property.
>
> WDYT?
>
>>
>> With respect to changing the default, if writing to
>> target/generated-sources simply doesn't work with Maven 3, then the
>> change of default will be less intrusive, because presumably people
>> are not doing that at the moment. I still think it would be worth
>> raising on users@, to see if anyone would be impacted.
>>
>> There's enough complexity here that it's probably worth extending the
>> current set of integration tests to cover this new scenario.
>>
>
> agreed:
>
>> Ian

Reply via email to