Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.4.1 backports 1 #36018

Merged
merged 30 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7589563
Apply HTTP Security Policy on normalized path
cescoffier Sep 12, 2023
0993e0e
Fix RESTEasy CDI dependency issue
geoand Sep 13, 2023
d42dadd
OTel Scope.close() warning improvement
brunobat Sep 12, 2023
8cd13eb
Update liquibase from 4.23.2, liquibase-mongodb to 4.23.1
famod Sep 12, 2023
6755682
Add note about unsupported @Lock in Spring Data JPA
geoand Sep 13, 2023
09b8c0b
Bring back the HTTP console commands
geoand Sep 12, 2023
ea3d6e1
Honor OIDC logout requests when ID token has expired
sberyozkin Sep 13, 2023
4ad5aa2
Fix use of multiple @ClientXX annotation in REST Client Reactive
geoand Sep 14, 2023
f417397
Applying the QE feedback for the Logging guide
MichalMaler Sep 12, 2023
2ba0007
Fix return type of hibernate-search substitution
zakkak Sep 15, 2023
2406831
Log invalid CORS origin and method
sberyozkin Sep 15, 2023
824929d
Prevent recording configuration coming from Gradle
radcortez Sep 13, 2023
f96e407
Bump org.apache.commons:commons-compress in /independent-projects/tools
dependabot[bot] Sep 14, 2023
64f070a
Bump org.apache.commons:commons-compress in /bom/application
dependabot[bot] Sep 14, 2023
a4c51bc
Recompute cached value when the Redis connection fails.
bartm-dvb Sep 13, 2023
817355e
Warn when wrong token proxy is accessed
sberyozkin Sep 16, 2023
8e29612
Properly initialize reactive Pool beans
geoand Sep 14, 2023
e87de9d
Don't ignore empty SSE events in client
geoand Sep 18, 2023
0ec071c
doc: fix snapstart link
deki Sep 18, 2023
47c8807
Improve the way HTTP authorizer logs exceptions
sberyozkin Sep 18, 2023
52afc29
Add a note about HR not being a replacement for ORM
gsmet Sep 6, 2023
9e30535
Bump org.eclipse.jgit:org.eclipse.jgit in /docs
dependabot[bot] Sep 18, 2023
21bfaa9
Bump org.eclipse.jgit:org.eclipse.jgit in /bom/application
dependabot[bot] Sep 18, 2023
8bb35c4
Rework how to enable/activate Flyway
gsmet Aug 25, 2023
e64afbb
Do not load the FlywayContainer bean if not active
gsmet Sep 4, 2023
d8be11a
Better handle the UnconfiguredDataSource case
gsmet Sep 5, 2023
7ee1bd2
Avoid split packages in Flyway extension
gsmet Sep 19, 2023
51b32bb
Add tests for enabled/active in Flyway extension
gsmet Sep 19, 2023
4b48c7f
Add @ConfigDocEnumValue and @ConfigDocDefault to writing-extensions g…
ia3andy Sep 18, 2023
3601abd
Upgrade to Hibernate ORM 6.2.9.Final and HR 2.0.5.Final
Sanne Sep 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@
<classmate.version>1.5.1</classmate.version>
<!-- When updating, align bytebuddy.version to Hibernate needs as well (just below),
as well as hibernate-orm.version-for-documentation in docs/pom.xml -->
<hibernate-orm.version>6.2.7.Final</hibernate-orm.version>
<hibernate-orm.version>6.2.9.Final</hibernate-orm.version>
<bytebuddy.version>1.14.7</bytebuddy.version> <!-- Version controlled by Hibernate ORM's needs -->
<hibernate-commons-annotations.version>6.0.6.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM -->
<hibernate-reactive.version>2.0.4.Final</hibernate-reactive.version>
<hibernate-reactive.version>2.0.5.Final</hibernate-reactive.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<!-- When updating, align hibernate-search.version-for-documentation in docs/pom.xml -->
<hibernate-search.version>6.2.1.Final</hibernate-search.version>
Expand Down Expand Up @@ -169,8 +169,8 @@
<flyway.version>9.21.2</flyway.version>
<yasson.version>3.0.3</yasson.version>
<!-- liquibase-mongodb is not released everytime with liquibase anymore, but the two versions need to be compatible -->
<liquibase.version>4.23.1</liquibase.version>
<liquibase-mongodb.version>4.23.0</liquibase-mongodb.version>
<liquibase.version>4.23.2</liquibase.version>
<liquibase-mongodb.version>4.23.1</liquibase-mongodb.version>
<snakeyaml.version>2.1</snakeyaml.version>
<osgi.version>6.0.0</osgi.version>
<mongo-client.version>4.10.2</mongo-client.version>
Expand Down Expand Up @@ -198,7 +198,7 @@
<scram-client.version>2.1</scram-client.version>
<picocli.version>4.7.4</picocli.version>
<google-cloud-functions.version>1.1.0</google-cloud-functions.version>
<commons-compress.version>1.23.0</commons-compress.version>
<commons-compress.version>1.24.0</commons-compress.version>
<commons-text.version>1.10.0</commons-text.version>
<gson.version>2.10.1</gson.version>
<log4j2-jboss-logmanager.version>1.1.1.Final</log4j2-jboss-logmanager.version>
Expand All @@ -215,7 +215,7 @@
<aesh.version>2.7</aesh.version>
<aesh-readline.version>2.4</aesh-readline.version>
<jansi.version>2.4.0</jansi.version> <!-- Keep in sync with aesh-readline and dekorate -->
<jgit.version>6.6.0.202305301015-r</jgit.version>
<jgit.version>6.6.1.202309021850-r</jgit.version>
<!-- these two artifacts needs to be compatible together -->
<strimzi-oauth.version>0.12.0</strimzi-oauth.version>
<strimzi-oauth.nimbus.version>9.31</strimzi-oauth.nimbus.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,8 @@ private Converter<?> getConverter(SmallRyeConfig config, Field field, ConverterT
* properties in all profiles (active or not), so it is safe to fall back to different default on another
* profile.
* <br>
* We also filter the properties coming from System or Env with the registered roots, because we don't want to
* record properties set by the compiling JVM (or other properties that are only related to the build).
* We also filter the properties coming from System, Env or Build with the registered roots, because we don't
* want to record properties set by the compiling JVM (or other properties that are only related to the build).
*/
private Set<String> getAllProperties(final Set<String> registeredRoots) {
Set<String> properties = new HashSet<>();
Expand All @@ -1023,7 +1023,8 @@ private Set<String> getAllProperties(final Set<String> registeredRoots) {
}

for (ConfigSource configSource : config.getConfigSources()) {
if (configSource instanceof SysPropConfigSource || configSource instanceof EnvConfigSource) {
if (configSource instanceof SysPropConfigSource || configSource instanceof EnvConfigSource
|| "PropertiesConfigSource[source=Build system]".equals(configSource.getName())) {
for (String property : configSource.getPropertyNames()) {
NameIterator ni = new NameIterator(property);
if (ni.hasNext() && PropertiesUtil.isPropertyInRoot(registeredRoots, ni)) {
Expand Down
2 changes: 1 addition & 1 deletion docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<roaster-jdt.version>2.26.0.Final</roaster-jdt.version>
<maven-model-helper.version>21</maven-model-helper.version>
<eclipse-collections.version>11.1.0</eclipse-collections.version>
<jgit.version>6.6.0.202305301015-r</jgit.version>
<jgit.version>6.6.1.202309021850-r</jgit.version>

<quarkus-home-url>https://quarkus.io</quarkus-home-url>
<quarkus-base-url>https://github.com/quarkusio/quarkus</quarkus-base-url>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/aws-lambda-http.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,6 @@
hardcode a principal name to use when your application runs by setting
the `QUARKUS_AWS_LAMBDA_FORCE_USER_NAME` environment variable

== SnapStart

Check warning on line 577 in docs/src/main/asciidoc/aws-lambda-http.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'SnapStart'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'SnapStart'.", "location": {"path": "docs/src/main/asciidoc/aws-lambda-http.adoc", "range": {"start": {"line": 577, "column": 4}}}, "severity": "INFO"}

To optimize your application for Lambda SnapStart, check xref:amazon-snapstart.adoc[the SnapStart Configuration Documentation].
To optimize your application for Lambda SnapStart, check xref:aws-lambda-snapstart.adoc[the SnapStart Configuration Documentation].
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/aws-lambda.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,6 @@

That's all there is to it!

== SnapStart

Check warning on line 716 in docs/src/main/asciidoc/aws-lambda.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'SnapStart'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'SnapStart'.", "location": {"path": "docs/src/main/asciidoc/aws-lambda.adoc", "range": {"start": {"line": 716, "column": 4}}}, "severity": "INFO"}

To optimize your application for Lambda SnapStart, check xref:amazon-snapstart.adoc[the SnapStart Configuration Documentation].
To optimize your application for Lambda SnapStart, check xref:aws-lambda-snapstart.adoc[the SnapStart Configuration Documentation].
24 changes: 17 additions & 7 deletions docs/src/main/asciidoc/hibernate-reactive-panache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
It makes complex mappings possible, but it does not make simple and common mappings trivial.
Hibernate Reactive with Panache focuses on making your entities trivial and fun to write in Quarkus.

[NOTE]
====
Hibernate Reactive is not a replacement for xref:hibernate-orm-panache.adoc[Hibernate ORM] or the future of Hibernate ORM.
It is a different stack tailored for reactive use cases where you need high-concurrency.

Furthermore, using RESTEasy Reactive, our default REST layer, does not require the use of Hibernate Reactive.
It is perfectly valid to use RESTEasy Reactive with Hibernate ORM,

Check warning on line 23 in docs/src/main/asciidoc/hibernate-reactive-panache.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer. Raw Output: {"message": "[Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer.", "location": {"path": "docs/src/main/asciidoc/hibernate-reactive-panache.adoc", "range": {"start": {"line": 23, "column": 1}}}, "severity": "INFO"}
and if you do not need high-concurrency, or are not accustomed to the reactive paradigm, it is recommended to use Hibernate ORM.
====

== First: an example

What we're doing in Panache allows you to write your Hibernate Reactive entities like this:
Expand Down Expand Up @@ -685,7 +695,7 @@
----
import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
@RegisterForReflection
public class RaceWeight {
public final String race;
public final Double weight
Expand Down Expand Up @@ -736,7 +746,7 @@
Also make sure to wrap methods that modify the database or involve multiple queries (e.g. `entity.persist()`) within a transaction.
You can annotate a CDI business method that returns `Uni` with the `@WithTransaction` annotation.
The method will be intercepted and the returned `Uni` is triggered within a transaction boundary.
Alternatively, you can use the `Panache.withTransaction()` method for the same effect.
Alternatively, you can use the `Panache.withTransaction()` method for the same effect.

IMPORTANT: You cannot use the `@Transactional` annotation with Hibernate Reactive for your transactions: you must use `@WithTransaction`, and your annotated method must return a `Uni` to be non-blocking.

Expand Down Expand Up @@ -871,9 +881,9 @@

@Test
@RunOnVertxContext
public void testEntity(TransactionalUniAsserter asserter) {
public void testEntity(TransactionalUniAsserter asserter) {
asserter.execute(() -> new MyEntity().persist()); <1>
asserter.assertEquals(() -> MyEntity.count(), 1l); <2>
asserter.assertEquals(() -> MyEntity.count(), 1l); <2>
asserter.execute(() -> MyEntity.deleteAll()); <3>
}
}
Expand Down Expand Up @@ -1062,7 +1072,7 @@
@RunOnVertxContext // <1>
@Test
public void testPanacheRepositoryMocking(UniAsserter asserter) { // <2>

// Mocked classes always return a default value
asserter.assertEquals(() -> mockablePersonRepository.count(), 0l);

Expand Down Expand Up @@ -1091,7 +1101,7 @@
});
asserter.assertThat(() -> mockablePersonRepository.findById(12l), p -> Assertions.assertSame(p, asserter.getData(key)));
asserter.assertNull(() -> mockablePersonRepository.findById(42l));

// Mock throwing
asserter.execute(() -> Mockito.when(mockablePersonRepository.findById(12l)).thenThrow(new WebApplicationException()));
asserter.assertFailedWith(() -> {
Expand All @@ -1113,9 +1123,9 @@
Mockito.verify(mockablePersonRepository).persist(Mockito.<Person> any());
Mockito.verifyNoMoreInteractions(mockablePersonRepository);
});

// IMPORTANT: We need to execute the asserter within a reactive session
asserter.surroundWith(u -> Panache.withSession(() -> u));

Check warning on line 1128 in docs/src/main/asciidoc/hibernate-reactive-panache.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'verify' rather than 'Make sure' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'verify' rather than 'Make sure' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/hibernate-reactive-panache.adoc", "range": {"start": {"line": 1128, "column": 40}}}, "severity": "WARNING"}
}
}
----
Expand Down
11 changes: 10 additions & 1 deletion docs/src/main/asciidoc/hibernate-reactive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@
:reactive-doc-url-prefix: https://hibernate.org/reactive/documentation/1.1/reference/html_single/#getting-started
:extension-status: preview


link:https://hibernate.org/reactive/[Hibernate Reactive] is a reactive API for Hibernate ORM, supporting non-blocking database drivers
and a reactive style of interaction with the database.

[NOTE]
====
Hibernate Reactive is not a replacement for xref:hibernate-orm.adoc[Hibernate ORM] or the future of Hibernate ORM.
It is a different stack tailored for reactive use cases where you need high-concurrency.

Also, using RESTEasy Reactive, our default REST layer, does not require the use of Hibernate Reactive.
It is perfectly valid to use RESTEasy Reactive with Hibernate ORM,

Check warning on line 21 in docs/src/main/asciidoc/hibernate-reactive.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer. Raw Output: {"message": "[Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer.", "location": {"path": "docs/src/main/asciidoc/hibernate-reactive.adoc", "range": {"start": {"line": 21, "column": 1}}}, "severity": "INFO"}
and if you do not need high-concurrency, or are not accustomed to the reactive paradigm, it is recommended to use Hibernate ORM.
====

[NOTE]
====
Hibernate Reactive works with the same annotations and most of the configuration described in the
Expand Down
3 changes: 2 additions & 1 deletion docs/src/main/asciidoc/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,10 @@
A category configuration recursively applies to all subcategories of that category unless there is a more specific matching sub-category configuration.

The parent of all logging categories is called the "root category".
This category, being the ultimate parent, may contain configuration which applies globally to all other categories. This includes the globally configured handlers and formatters.

Check warning on line 248 in docs/src/main/asciidoc/logging.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'might (for possiblity)' or 'can (for ability)' rather than 'may' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'might (for possiblity)' or 'can (for ability)' rather than 'may' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/logging.adoc", "range": {"start": {"line": 248, "column": 43}}}, "severity": "WARNING"}

Check warning on line 248 in docs/src/main/asciidoc/logging.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using ', which (non restrictive clause preceded by a comma)' or 'that (restrictive clause without a comma)' rather than 'which'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using ', which (non restrictive clause preceded by a comma)' or 'that (restrictive clause without a comma)' rather than 'which'.", "location": {"path": "docs/src/main/asciidoc/logging.adoc", "range": {"start": {"line": 248, "column": 68}}}, "severity": "INFO"}

Check warning on line 248 in docs/src/main/asciidoc/logging.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'formatters'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'formatters'?", "location": {"path": "docs/src/main/asciidoc/logging.adoc", "range": {"start": {"line": 248, "column": 168}}}, "severity": "WARNING"}

Thus, configurations made under `quarkus.log.console.*`, `quarkus.log.file.*`, and `quarkus.log.syslog.*`, are global and apply for all categories. For more information, see <<loggingConfigurationReference>>.
Thus, configurations made under `quarkus.log.console.+*+`, `quarkus.log.file.+*+`, and `quarkus.log.syslog.+*+` are global and apply for all categories.
For more information, see <<loggingConfigurationReference>>.

If you want to configure something extra for a specific category, create a named handler like `quarkus.log.handler.[console|file|syslog].<your-handler-name>.*` and set it up for that category by using `quarkus.log.category.<my-category>.handlers`.

Expand Down
1 change: 1 addition & 0 deletions docs/src/main/asciidoc/spring-data-jpa.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,10 @@
** In Spring Data JPA this is done by registering a class that extends `org.springframework.data.jpa.repository.support.SimpleJpaRepository` however in Quarkus this class
is not used at all (since all the necessary plumbing is done at build time). Similar support might be added to Quarkus in the future.
* Using `java.util.concurrent.Future` and classes that extend it as return types of repository methods.
* Native and named queries when using `@Query`

Check warning on line 602 in docs/src/main/asciidoc/spring-data-jpa.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using 'by using' or 'that uses' rather than 'using'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using 'by using' or 'that uses' rather than 'using'.", "location": {"path": "docs/src/main/asciidoc/spring-data-jpa.adoc", "range": {"start": {"line": 602, "column": 32}}}, "severity": "INFO"}
* https://github.com/spring-projects/spring-data-jpa/blob/main/src/main/asciidoc/jpa.adoc#entity-state-detection-strategies[Entity State-detection Strategies]
via `EntityInformation`.

Check warning on line 604 in docs/src/main/asciidoc/spring-data-jpa.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'through', 'by', 'from', 'on', or 'by using' rather than 'via' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'through', 'by', 'from', 'on', or 'by using' rather than 'via' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/spring-data-jpa.adoc", "range": {"start": {"line": 604, "column": 1}}}, "severity": "WARNING"}
* The use of `org.springframework.data.jpa.repository.Lock`

The Quarkus team is exploring various alternatives to bridging the gap between the JPA and Reactive worlds.

Expand Down
5 changes: 5 additions & 0 deletions docs/src/main/asciidoc/writing-extensions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,11 @@ public interface SomeConfig {
}
----
<1> This will generate a configuration map key named `quarkus.some."cache-name"` instead of `quarkus.some."namespace"`.

It is possible to write a textual explanation for the documentation default value, this is useful when it is generated: `@ConfigDocDefault("explain how this is generated")`.

`@ConfigDocEnumValue` gives a way to explicitly customize the string displayed in the documentation when listing accepted values for an enum.

====

===== Writing section documentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ private String getCookieToken(RoutingContext routing, CsrfReactiveConfig config)
}

private boolean isCsrfTokenRequired(RoutingContext routing, CsrfReactiveConfig config) {
return config.createTokenPath.isPresent() ? config.createTokenPath.get().contains(routing.request().path()) : true;
return config.createTokenPath
.map(value -> value.contains(routing.normalizedPath())).orElse(true);
}

private void createCookie(String csrfToken, RoutingContext routing, CsrfReactiveConfig config) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package io.quarkus.flyway.deployment;

import org.flywaydb.core.extensibility.Plugin;

import io.quarkus.deployment.Feature;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;

public class FlywayAlwaysEnabledProcessor {

@BuildStep
void build(BuildProducer<FeatureBuildItem> featureProducer) {
featureProducer.produce(new FeatureBuildItem(Feature.FLYWAY));
}

/**
* Reinitialize {@code InsertRowLock} to avoid using a cached seed when invoking {@code getNextRandomString}
*/
@BuildStep
public RuntimeReinitializedClassBuildItem reinitInsertRowLock() {
return new RuntimeReinitializedClassBuildItem(
"org.flywaydb.core.internal.database.InsertRowLock");
}

@BuildStep
public NativeImageResourceBuildItem resources() {
return new NativeImageResourceBuildItem("org/flywaydb/database/version.txt");
}

@BuildStep
IndexDependencyBuildItem indexFlyway() {
return new IndexDependencyBuildItem("org.flywaydb", "flyway-core");
}

@BuildStep
public ServiceProviderBuildItem flywayPlugins() {
return ServiceProviderBuildItem.allProvidersFromClassPath(Plugin.class.getName());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.flyway;
package io.quarkus.flyway.deployment;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.quarkus.flyway.deployment;

import java.util.function.BooleanSupplier;

import io.quarkus.flyway.runtime.FlywayBuildTimeConfig;

/**
* Supplier that can be used to only run build steps
* if the Flyway extension is enabled.
*/
public class FlywayEnabled implements BooleanSupplier {

private final FlywayBuildTimeConfig config;

FlywayEnabled(FlywayBuildTimeConfig config) {
this.config = config;
}

@Override
public boolean getAsBoolean() {
return config.enabled;
}

}
Loading
Loading