Skip to content

Commit

Permalink
Fix #132: Add Info endpoint data (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Oct 27, 2024
1 parent 2245723 commit f8b5504
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 1 deletion.
Binary file added .idea/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jaxp-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-info-deployment-spi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-undertow-deployment</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild;
import io.quarkus.info.deployment.spi.InfoBuildTimeContributorBuildItem;
import io.quarkus.omnifaces.runtime.FacesInfoContributor;
import io.quarkus.omnifaces.runtime.OmniFacesFeature;
import io.quarkus.omnifaces.runtime.OmniFacesRecorder;
import io.quarkus.omnifaces.runtime.ParamBeanCreator;
Expand Down Expand Up @@ -281,6 +283,11 @@ public void inspectInjectionPoints(BeanDiscoveryFinishedBuildItem beanDiscoveryF
}
}

@BuildStep
InfoBuildTimeContributorBuildItem produceInformation() {
return new InfoBuildTimeContributorBuildItem(new FacesInfoContributor());
}

public List<String> collectClassesInPackage(CombinedIndexBuildItem combinedIndex, String packageName) {
final List<String> classes = new ArrayList<>();
final List<DotName> packages = new ArrayList<>(combinedIndex.getIndex().getSubpackages(packageName));
Expand Down Expand Up @@ -315,4 +322,4 @@ public List<String> collectImplementors(CombinedIndexBuildItem combinedIndex, St
classes.add(className);
return classes;
}
}
}
4 changes: 4 additions & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<artifactId>quarkus-omnifaces</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-info</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
8 changes: 8 additions & 0 deletions runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jaxp</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-info-runtime-spi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
<artifactId>myfaces-quarkus</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.quarkus.omnifaces.runtime;

import java.util.LinkedHashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.omnifaces.util.Faces;

import io.quarkus.info.runtime.spi.InfoContributor;
import io.undertow.Undertow;

public class FacesInfoContributor implements InfoContributor {

@Override
public String name() {
return "faces";
}

@Override
public Map<String, Object> data() {
String facesImpl = StringUtils.removeIgnoreCase(StringUtils.removeIgnoreCase(Faces.getImplInfo(), "Core"), "Impl");
String server = "Undertow " + Undertow.class.getPackage().getImplementationVersion();
String omniFaces = "OmniFaces: " + StringUtils.defaultIfEmpty(
org.omnifaces.util.Faces.class.getPackage().getImplementationVersion(), "???");
LinkedHashMap<String, Object> info = new LinkedHashMap<>(3);
info.put("faces", facesImpl);
info.put("server", server);
info.put("libs", omniFaces);
return info;
}
}

0 comments on commit f8b5504

Please sign in to comment.