Mailing List Archive

How to create a local build that targets Java 11, when building with 17?
`./gradlew publishToMavenLocal` gives me Java 17 class files by default,
which surprises me since AFAIK 11 is still the minimum to run Lucene.

I hacked it to work by editing javac.gradle
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

Is there a cleaner way to do this?

--
Jonathan Ellis
co-founder, http://www.datastax.com
@spyced
Re: How to create a local build that targets Java 11, when building with 17? [ In reply to ]
Actually my hack doesn't work, the manifest file changes but the .class
files do not.

On Fri, May 5, 2023 at 12:38?PM Jonathan Ellis <jbellis@gmail.com> wrote:

> `./gradlew publishToMavenLocal` gives me Java 17 class files by default,
> which surprises me since AFAIK 11 is still the minimum to run Lucene.
>
> I hacked it to work by editing javac.gradle
> sourceCompatibility = JavaVersion.VERSION_11
> targetCompatibility = JavaVersion.VERSION_11
>
> Is there a cleaner way to do this?
>
> --
> Jonathan Ellis
> co-founder, http://www.datastax.com
> @spyced
>


--
Jonathan Ellis
co-founder, http://www.datastax.com
@spyced
Re: How to create a local build that targets Java 11, when building with 17? [ In reply to ]
The main branch is on Java 17, see build.gradle:

// Minimum Java version required to compile and run Lucene.
minJavaVersion = JavaVersion.VERSION_17

Also, don't use the default gradle task created by convention; use this one:

./gradlew mavenToLocal

it's an alias but it publishes only a subset of relevant projects, not all
of them.

Dawid

On Fri, May 5, 2023 at 8:03?PM Jonathan Ellis <jbellis@gmail.com> wrote:

> Actually my hack doesn't work, the manifest file changes but the .class
> files do not.
>
> On Fri, May 5, 2023 at 12:38?PM Jonathan Ellis <jbellis@gmail.com> wrote:
>
>> `./gradlew publishToMavenLocal` gives me Java 17 class files by default,
>> which surprises me since AFAIK 11 is still the minimum to run Lucene.
>>
>> I hacked it to work by editing javac.gradle
>> sourceCompatibility = JavaVersion.VERSION_11
>> targetCompatibility = JavaVersion.VERSION_11
>>
>> Is there a cleaner way to do this?
>>
>> --
>> Jonathan Ellis
>> co-founder, http://www.datastax.com
>> @spyced
>>
>
>
> --
> Jonathan Ellis
> co-founder, http://www.datastax.com
> @spyced
>
Re: How to create a local build that targets Java 11, when building with 17? [ In reply to ]
Thanks. What are the rules for what should go into main vs branch_9x?

On Fri, May 5, 2023 at 1:54?PM Dawid Weiss <dawid.weiss@gmail.com> wrote:

>
> The main branch is on Java 17, see build.gradle:
>
> // Minimum Java version required to compile and run Lucene.
> minJavaVersion = JavaVersion.VERSION_17
>
> Also, don't use the default gradle task created by convention; use this
> one:
>
> ./gradlew mavenToLocal
>
> it's an alias but it publishes only a subset of relevant projects, not all
> of them.
>
> Dawid
>
> On Fri, May 5, 2023 at 8:03?PM Jonathan Ellis <jbellis@gmail.com> wrote:
>
>> Actually my hack doesn't work, the manifest file changes but the .class
>> files do not.
>>
>> On Fri, May 5, 2023 at 12:38?PM Jonathan Ellis <jbellis@gmail.com> wrote:
>>
>>> `./gradlew publishToMavenLocal` gives me Java 17 class files by default,
>>> which surprises me since AFAIK 11 is still the minimum to run Lucene.
>>>
>>> I hacked it to work by editing javac.gradle
>>> sourceCompatibility = JavaVersion.VERSION_11
>>> targetCompatibility = JavaVersion.VERSION_11
>>>
>>> Is there a cleaner way to do this?
>>>
>>> --
>>> Jonathan Ellis
>>> co-founder, http://www.datastax.com
>>> @spyced
>>>
>>
>>
>> --
>> Jonathan Ellis
>> co-founder, http://www.datastax.com
>> @spyced
>>
>

--
Jonathan Ellis
co-founder, http://www.datastax.com
@spyced
Re: How to create a local build that targets Java 11, when building with 17? [ In reply to ]
Hi Jonathan-

The main branch is the tip of development, and what will eventually become
10.0. It can use a later version of Java, make (some)
non-backwards-compatible API changes, etc. branch_9x tracks the latest 9.x
release, and must run on the version of Java supported by 9.x releases,
must be API backwards-compatible, etc. The general approach is to make
changes against main, and then backport those changes to branch_9x in a 9.x
friendly way if possible. Sometimes a change on main is complex enough that
backporting in a 9.x friendly manner isn't really feasible, in which case
the change will be released with 10.0. I'm sure I'm leaving out some
details, but hopefully this is helpful. You may also find this reference
useful:
https://cwiki.apache.org/confluence/display/LUCENE/BackwardsCompatibility

Cheers,
-Greg

On Fri, May 5, 2023 at 12:00?PM Jonathan Ellis <jbellis@gmail.com> wrote:

> Thanks. What are the rules for what should go into main vs branch_9x?
>
> On Fri, May 5, 2023 at 1:54?PM Dawid Weiss <dawid.weiss@gmail.com> wrote:
>
>>
>> The main branch is on Java 17, see build.gradle:
>>
>> // Minimum Java version required to compile and run Lucene.
>> minJavaVersion = JavaVersion.VERSION_17
>>
>> Also, don't use the default gradle task created by convention; use this
>> one:
>>
>> ./gradlew mavenToLocal
>>
>> it's an alias but it publishes only a subset of relevant projects, not
>> all of them.
>>
>> Dawid
>>
>> On Fri, May 5, 2023 at 8:03?PM Jonathan Ellis <jbellis@gmail.com> wrote:
>>
>>> Actually my hack doesn't work, the manifest file changes but the .class
>>> files do not.
>>>
>>> On Fri, May 5, 2023 at 12:38?PM Jonathan Ellis <jbellis@gmail.com>
>>> wrote:
>>>
>>>> `./gradlew publishToMavenLocal` gives me Java 17 class files by
>>>> default, which surprises me since AFAIK 11 is still the minimum to run
>>>> Lucene.
>>>>
>>>> I hacked it to work by editing javac.gradle
>>>> sourceCompatibility = JavaVersion.VERSION_11
>>>> targetCompatibility = JavaVersion.VERSION_11
>>>>
>>>> Is there a cleaner way to do this?
>>>>
>>>> --
>>>> Jonathan Ellis
>>>> co-founder, http://www.datastax.com
>>>> @spyced
>>>>
>>>
>>>
>>> --
>>> Jonathan Ellis
>>> co-founder, http://www.datastax.com
>>> @spyced
>>>
>>
>
> --
> Jonathan Ellis
> co-founder, http://www.datastax.com
> @spyced
>
Re: How to create a local build that targets Java 11, when building with 17? [ In reply to ]
Apologies for not replying yesterday and thank you, Greg, for answering the
question.

All I could add is that it's a pretty common semantic versioning scheme
[1], although there is no rigorous method of policing it - very often it's
just relying on common sense. Lucene often does add big code changes to
what's a "minor" release in this scheme (9x) but only if they're backward
compatible. Major releases are limited to breaking the API, bumping the
minimum Java version, etc.

Dawid

[1] https://semver.org/

On Sat, May 6, 2023 at 1:53?AM Greg Miller <gsmiller@gmail.com> wrote:

> Hi Jonathan-
>
> The main branch is the tip of development, and what will eventually become
> 10.0. It can use a later version of Java, make (some)
> non-backwards-compatible API changes, etc. branch_9x tracks the latest 9.x
> release, and must run on the version of Java supported by 9.x releases,
> must be API backwards-compatible, etc. The general approach is to make
> changes against main, and then backport those changes to branch_9x in a 9.x
> friendly way if possible. Sometimes a change on main is complex enough that
> backporting in a 9.x friendly manner isn't really feasible, in which case
> the change will be released with 10.0. I'm sure I'm leaving out some
> details, but hopefully this is helpful. You may also find this reference
> useful:
> https://cwiki.apache.org/confluence/display/LUCENE/BackwardsCompatibility
>
> Cheers,
> -Greg
>
> On Fri, May 5, 2023 at 12:00?PM Jonathan Ellis <jbellis@gmail.com> wrote:
>
>> Thanks. What are the rules for what should go into main vs branch_9x?
>>
>> On Fri, May 5, 2023 at 1:54?PM Dawid Weiss <dawid.weiss@gmail.com> wrote:
>>
>>>
>>> The main branch is on Java 17, see build.gradle:
>>>
>>> // Minimum Java version required to compile and run Lucene.
>>> minJavaVersion = JavaVersion.VERSION_17
>>>
>>> Also, don't use the default gradle task created by convention; use this
>>> one:
>>>
>>> ./gradlew mavenToLocal
>>>
>>> it's an alias but it publishes only a subset of relevant projects, not
>>> all of them.
>>>
>>> Dawid
>>>
>>> On Fri, May 5, 2023 at 8:03?PM Jonathan Ellis <jbellis@gmail.com> wrote:
>>>
>>>> Actually my hack doesn't work, the manifest file changes but the .class
>>>> files do not.
>>>>
>>>> On Fri, May 5, 2023 at 12:38?PM Jonathan Ellis <jbellis@gmail.com>
>>>> wrote:
>>>>
>>>>> `./gradlew publishToMavenLocal` gives me Java 17 class files by
>>>>> default, which surprises me since AFAIK 11 is still the minimum to run
>>>>> Lucene.
>>>>>
>>>>> I hacked it to work by editing javac.gradle
>>>>> sourceCompatibility = JavaVersion.VERSION_11
>>>>> targetCompatibility = JavaVersion.VERSION_11
>>>>>
>>>>> Is there a cleaner way to do this?
>>>>>
>>>>> --
>>>>> Jonathan Ellis
>>>>> co-founder, http://www.datastax.com
>>>>> @spyced
>>>>>
>>>>
>>>>
>>>> --
>>>> Jonathan Ellis
>>>> co-founder, http://www.datastax.com
>>>> @spyced
>>>>
>>>
>>
>> --
>> Jonathan Ellis
>> co-founder, http://www.datastax.com
>> @spyced
>>
>