[Git][java-team/libpf4j-java][master] 6 commits: New upstream version 3.8.0+dfsg
Pierre Gruet (@pgt)
gitlab at salsa.debian.org
Tue Nov 15 22:46:26 GMT 2022
Pierre Gruet pushed to branch master at Debian Java Maintainers / libpf4j-java
Commits:
a9d8dd59 by Pierre Gruet at 2022-11-15T22:00:55+01:00
New upstream version 3.8.0+dfsg
- - - - -
576c3333 by Pierre Gruet at 2022-11-15T22:00:57+01:00
Update upstream source from tag 'upstream/3.8.0+dfsg'
Update to upstream version '3.8.0+dfsg'
with Debian dir f99488ba0e29c0181ad118f980c3006db6543336
- - - - -
298bd031 by Pierre Gruet at 2022-11-15T22:03:27+01:00
Simplifying d/maven.rules
- - - - -
3f46bd1f by Pierre Gruet at 2022-11-15T22:03:46+01:00
Updating changelog
- - - - -
7278a0db by Pierre Gruet at 2022-11-15T22:27:16+01:00
Adding a Lintian override for the bad-jar-name warning
- - - - -
3d6aa458 by Pierre Gruet at 2022-11-15T22:27:32+01:00
Upload to unstable
- - - - -
18 changed files:
- CHANGELOG.md
- debian/changelog
- + debian/libpf4j-java.lintian-overrides
- debian/maven.rules
- demo/api/pom.xml
- demo/app/pom.xml
- demo/app/src/main/java/org/pf4j/demo/Boot.java
- demo/plugins/plugin1/pom.xml
- demo/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java
- demo/plugins/plugin2/pom.xml
- demo/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java
- demo/plugins/pom.xml
- demo/pom.xml
- maven-archetypes/quickstart/pom.xml
- pf4j/pom.xml
- pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java
- pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java
- pom.xml
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -4,6 +4,21 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### [Unreleased][unreleased]
+#### Fixed
+- [#492]: Loading extensions crashes kotlin application
+- [#508]: Not create extensions.idx if no extensions exist
+
+#### Changed
+- Make ServiceProviderExtensionFinder optional in demo (commented code)
+
+#### Added
+- Add support for reading plugin descriptor from zip
+- Use logger instead of System.out.println for demo
+
+#### Removed
+
+### [3.7.0] - 2022-06-28
+
#### Fixed
- [#435]: Fix the path separator used in the SingletonExtensionFactoryTest.java
- [#451]: Fix Dependency version check fails even if required is '*'
@@ -434,7 +449,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
#### Removed
-[unreleased]: https://github.com/decebals/pf4j/compare/release-3.6.0...HEAD
+[unreleased]: https://github.com/decebals/pf4j/compare/release-3.7.0...HEAD
+[3.7.0]: https://github.com/decebals/pf4j/compare/release-3.6.0...release-3.7.0
[3.6.0]: https://github.com/decebals/pf4j/compare/release-3.5.0...release-3.6.0
[3.5.0]: https://github.com/decebals/pf4j/compare/release-3.4.1...release-3.5.0
[3.4.1]: https://github.com/decebals/pf4j/compare/release-3.4.0...release-3.4.1
@@ -461,6 +477,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
[0.11.0]: https://github.com/decebals/pf4j/compare/release-0.10.0...release-0.11.0
[0.10.0]: https://github.com/decebals/pf4j/compare/release-0.9.0...release-0.10.0
+[#508]: https://github.com/pf4j/pf4j/issues/508
+[#492]: https://github.com/pf4j/pf4j/issues/492
[#490]: https://github.com/pf4j/pf4j/pull/490
[#455]: https://github.com/pf4j/pf4j/pull/455
[#451]: https://github.com/pf4j/pf4j/pull/451
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+libpf4j-java (3.8.0+dfsg-1) unstable; urgency=medium
+
+ * New upstream version 3.8.0+dfsg
+ * Simplifying d/maven.rules
+ * Adding a Lintian override for the bad-jar-name warning
+
+ -- Pierre Gruet <pgt at debian.org> Tue, 15 Nov 2022 22:27:25 +0100
+
libpf4j-java (3.7.0+dfsg-1) unstable; urgency=medium
* New upstream version 3.7.0+dfsg
=====================================
debian/libpf4j-java.lintian-overrides
=====================================
@@ -0,0 +1,3 @@
+# The indicated file is the real jar and not a symlink, but this really does
+# not harm.
+libpf4j-java: bad-jar-name [usr/share/java/pf4j.jar]
=====================================
debian/maven.rules
=====================================
@@ -1,9 +1,3 @@
-org.slf4j slf4j-api * s/.*/debian/ * *
-com.github.zafarkhaja java-semver * s/.*/debian/ * *
-org.apache.logging.log4j log4j-api * s/.*/debian/ * *
-org.apache.logging.log4j log4j-core * s/.*/debian/ * *
org.apache.logging.log4j s/log4j-slf4j-impl/log4j-to-slf4j/ * s/.*/debian/ * *
org.hamcrest s/hamcrest/hamcrest-all/ * s/.*/debian/ * *
-org.junit.jupiter junit-jupiter-engine * s/.*/debian/ * *
-org.mockito mockito-core * s/.*/debian/ * *
=====================================
demo/api/pom.xml
=====================================
@@ -4,12 +4,12 @@
<parent>
<groupId>org.pf4j.demo</groupId>
<artifactId>pf4j-demo-parent</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pf4j-demo-api</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<packaging>jar</packaging>
<name>Demo Api</name>
=====================================
demo/app/pom.xml
=====================================
@@ -4,12 +4,12 @@
<parent>
<groupId>org.pf4j.demo</groupId>
<artifactId>pf4j-demo-parent</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pf4j-demo-app</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<packaging>jar</packaging>
<name>Demo App</name>
=====================================
demo/app/src/main/java/org/pf4j/demo/Boot.java
=====================================
@@ -16,12 +16,12 @@
package org.pf4j.demo;
import org.apache.commons.lang.StringUtils;
-import org.pf4j.DefaultExtensionFinder;
import org.pf4j.DefaultPluginManager;
-import org.pf4j.ExtensionFinder;
import org.pf4j.PluginManager;
import org.pf4j.PluginWrapper;
import org.pf4j.demo.api.Greeting;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Set;
@@ -33,21 +33,14 @@ import java.util.Set;
*/
public class Boot {
+ private static final Logger log = LoggerFactory.getLogger(Boot.class);
+
public static void main(String[] args) {
// print logo
printLogo();
// create the plugin manager
- final PluginManager pluginManager = new DefaultPluginManager() {
-
- protected ExtensionFinder createExtensionFinder() {
- DefaultExtensionFinder extensionFinder = (DefaultExtensionFinder) super.createExtensionFinder();
- extensionFinder.addServiceProviderExtensionFinder(); // to activate "HowdyGreeting" extension
-
- return extensionFinder;
- }
-
- };
+ PluginManager pluginManager = createPluginManager();
// load the plugins
pluginManager.loadPlugins();
@@ -60,59 +53,59 @@ public class Boot {
// retrieves the extensions for Greeting extension point
List<Greeting> greetings = pluginManager.getExtensions(Greeting.class);
- System.out.println(String.format("Found %d extensions for extension point '%s'", greetings.size(), Greeting.class.getName()));
+ log.info("Found {} extensions for extension point '{}'", greetings.size(), Greeting.class.getName());
for (Greeting greeting : greetings) {
- System.out.println(">>> " + greeting.getGreeting());
+ log.info(">>> {}", greeting.getGreeting());
}
// print extensions from classpath (non plugin)
- System.out.println("Extensions added by classpath:");
+ log.info("Extensions added by classpath:");
Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null);
for (String extension : extensionClassNames) {
- System.out.println(" " + extension);
+ log.info(" {}", extension);
}
- System.out.println("Extension classes by classpath:");
+ log.info("Extension classes by classpath:");
List<Class<? extends Greeting>> greetingsClasses = pluginManager.getExtensionClasses(Greeting.class);
for (Class<? extends Greeting> greeting : greetingsClasses) {
- System.out.println(" Class: " + greeting.getCanonicalName());
+ log.info(" Class: {}", greeting.getCanonicalName());
}
// print extensions ids for each started plugin
List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins();
for (PluginWrapper plugin : startedPlugins) {
String pluginId = plugin.getDescriptor().getPluginId();
- System.out.println(String.format("Extensions added by plugin '%s':", pluginId));
+ log.info("Extensions added by plugin '{}}':", pluginId);
extensionClassNames = pluginManager.getExtensionClassNames(pluginId);
for (String extension : extensionClassNames) {
- System.out.println(" " + extension);
+ log.info(" {}", extension);
}
}
// print the extensions instances for Greeting extension point for each started plugin
for (PluginWrapper plugin : startedPlugins) {
String pluginId = plugin.getDescriptor().getPluginId();
- System.out.println(String.format("Extensions instances added by plugin '%s' for extension point '%s':", pluginId, Greeting.class.getName()));
+ log.info("Extensions instances added by plugin '{}' for extension point '{}':", pluginId, Greeting.class.getName());
List<Greeting> extensions = pluginManager.getExtensions(Greeting.class, pluginId);
for (Object extension : extensions) {
- System.out.println(" " + extension);
+ log.info(" {}", extension);
}
}
// print extensions instances from classpath (non plugin)
- System.out.println("Extensions instances added by classpath:");
- List extensions = pluginManager.getExtensions((String) null);
+ log.info("Extensions instances added by classpath:");
+ List<?> extensions = pluginManager.getExtensions((String) null);
for (Object extension : extensions) {
- System.out.println(" " + extension);
+ log.info(" {}", extension);
}
// print extensions instances for each started plugin
for (PluginWrapper plugin : startedPlugins) {
String pluginId = plugin.getDescriptor().getPluginId();
- System.out.println(String.format("Extensions instances added by plugin '%s':", pluginId));
+ log.info("Extensions instances added by plugin '{}':", pluginId);
extensions = pluginManager.getExtensions(pluginId);
for (Object extension : extensions) {
- System.out.println(" " + extension);
+ log.info(" {}", extension);
}
}
@@ -131,9 +124,28 @@ public class Boot {
}
private static void printLogo() {
- System.out.println(StringUtils.repeat("#", 40));
- System.out.println(StringUtils.center("PF4J-DEMO", 40));
- System.out.println(StringUtils.repeat("#", 40));
+ log.info(StringUtils.repeat("#", 40));
+ log.info(StringUtils.center("PF4J-DEMO", 40));
+ log.info(StringUtils.repeat("#", 40));
+ }
+
+ private static PluginManager createPluginManager() {
+ return new DefaultPluginManager();
+
+ // use below plugin manager instance if you want to enable ServiceProviderExtensionFinder
+ /*
+ return new DefaultPluginManager() {
+
+ @Override
+ protected ExtensionFinder createExtensionFinder() {
+ DefaultExtensionFinder extensionFinder = (DefaultExtensionFinder) super.createExtensionFinder();
+ extensionFinder.addServiceProviderExtensionFinder(); // to activate "HowdyGreeting" extension
+
+ return extensionFinder;
+ }
+
+ };
+ */
}
}
=====================================
demo/plugins/plugin1/pom.xml
=====================================
@@ -4,12 +4,12 @@
<parent>
<groupId>org.pf4j.demo</groupId>
<artifactId>pf4j-demo-plugins</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pf4j-demo-plugin1</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<packaging>jar</packaging>
<name>Demo Plugin #1</name>
=====================================
demo/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java
=====================================
@@ -34,16 +34,16 @@ public class WelcomePlugin extends Plugin {
@Override
public void start() {
- System.out.println("WelcomePlugin.start()");
+ log.info("WelcomePlugin.start()");
// for testing the development mode
if (RuntimeMode.DEVELOPMENT.equals(wrapper.getRuntimeMode())) {
- System.out.println(StringUtils.upperCase("WelcomePlugin"));
+ log.info(StringUtils.upperCase("WelcomePlugin"));
}
}
@Override
public void stop() {
- System.out.println("WelcomePlugin.stop()");
+ log.info("WelcomePlugin.stop()");
}
@Extension
=====================================
demo/plugins/plugin2/pom.xml
=====================================
@@ -4,12 +4,12 @@
<parent>
<groupId>org.pf4j.demo</groupId>
<artifactId>pf4j-demo-plugins</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pf4j-demo-plugin2</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<packaging>jar</packaging>
<name>Demo Plugin #2</name>
=====================================
demo/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java
=====================================
@@ -33,12 +33,12 @@ public class HelloPlugin extends Plugin {
@Override
public void start() {
- System.out.println("HelloPlugin.start()");
+ log.info("HelloPlugin.start()");
}
@Override
public void stop() {
- System.out.println("HelloPlugin.stop()");
+ log.info("HelloPlugin.stop()");
}
@Extension(ordinal=1)
=====================================
demo/plugins/pom.xml
=====================================
@@ -4,12 +4,12 @@
<parent>
<groupId>org.pf4j.demo</groupId>
<artifactId>pf4j-demo-parent</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pf4j-demo-plugins</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<packaging>pom</packaging>
<name>Demo Plugins Parent</name>
=====================================
demo/pom.xml
=====================================
@@ -4,13 +4,13 @@
<parent>
<groupId>org.pf4j</groupId>
<artifactId>pf4j-parent</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.pf4j.demo</groupId>
<artifactId>pf4j-demo-parent</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<packaging>pom</packaging>
<name>Demo Parent</name>
=====================================
maven-archetypes/quickstart/pom.xml
=====================================
@@ -4,7 +4,7 @@
<parent>
<groupId>org.pf4j</groupId>
<artifactId>pf4j-parent</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
=====================================
pf4j/pom.xml
=====================================
@@ -4,12 +4,12 @@
<parent>
<groupId>org.pf4j</groupId>
<artifactId>pf4j-parent</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pf4j</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<packaging>jar</packaging>
<name>PF4J</name>
<description>Plugin Framework for Java</description>
=====================================
pf4j/src/main/java/org/pf4j/AbstractExtensionFinder.java
=====================================
@@ -151,7 +151,7 @@ public abstract class AbstractExtensionFinder implements ExtensionFinder, Plugin
checkDifferentClassLoaders(type, extensionClass);
}
}
- } catch (ClassNotFoundException e) {
+ } catch (ClassNotFoundException | NoClassDefFoundError e) {
log.error(e.getMessage(), e);
}
}
=====================================
pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java
=====================================
@@ -131,7 +131,9 @@ public class ExtensionAnnotationProcessor extends AbstractProcessor {
}
// write extensions
- storage.write(extensions);
+ if (extensions.size() > 0) {
+ storage.write(extensions);
+ }
return false;
}
=====================================
pom.xml
=====================================
@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.pf4j</groupId>
<artifactId>pf4j-parent</artifactId>
- <version>3.7.0</version>
+ <version>3.8.0</version>
<packaging>pom</packaging>
<name>PF4J Parent</name>
<description>Plugin Framework for Java</description>
@@ -28,7 +28,7 @@
<connection>scm:git:https://github.com/pf4j/pf4j.git</connection>
<developerConnection>scm:git:git at github.com:pf4j/pf4j.git</developerConnection>
<url>git at github.com/pf4j/pf4j.git</url>
- <tag>release-3.7.0</tag>
+ <tag>release-3.8.0</tag>
</scm>
<distributionManagement>
View it on GitLab: https://salsa.debian.org/java-team/libpf4j-java/-/compare/aeeeef8a2f2a65b7a7c53388d1da96bee92972d3...3d6aa4589b9cda4dee65bec302ec3acc94136553
--
View it on GitLab: https://salsa.debian.org/java-team/libpf4j-java/-/compare/aeeeef8a2f2a65b7a7c53388d1da96bee92972d3...3d6aa4589b9cda4dee65bec302ec3acc94136553
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20221115/46521770/attachment.htm>
More information about the pkg-java-commits
mailing list