Giter VIP home page Giter VIP logo

Comments (19)

decebals avatar decebals commented on August 16, 2024

From #19:

Can you add more detail please? Can you share with us the plugin's pom.xml? Maybe you create a thin jar and not a fat jar. Please take a look at your plugin's jar and see if the find the POI's classes.

Your plugins system uses .zip or .jar format to pack your plugins?

from pf4j-spring.

MohankumarD avatar MohankumarD commented on August 16, 2024

Refer plugin pom.xml file, yes i have created thin jar file for testing. For testing I have used Simple-Json as third pary lib.
pom.xml.txt

Yes my plugin system as .jar format

from pf4j-spring.

decebals avatar decebals commented on August 16, 2024

Probably your plugins packaging approach is based on demo module from this project (pf4j-spring). Please take a look to demo from pf4j (https://github.com/pf4j/pf4j/tree/master/demo/plugins) because the entire plugins packaging process is simplified for jar format.
Leave a message if you encounter problems.

from pf4j-spring.

MohankumarD avatar MohankumarD commented on August 16, 2024

Yes, I am referring pf4j-spring. Will you able to tell me what is the mistake in the existing plugin project.

When I use plugin application as ZIP file, its working fine. Help me on JAR

from pf4j-spring.

decebals avatar decebals commented on August 16, 2024

Will you able to tell me what is the mistake in the existing plugin project.

I didn't say that something is wrong with demo project from pf4j-spring. I say that it is an old version of demo project from pf4j, and it uses assembly.xml to pack the plugin in a zip file.
The demo from pf4j doesn't use an assembly.xml and pack the plugin in a jar file.
My recommendation is to try to run demo project (using run-demo.sh or run-demo.bat script) first, and after this to continue with your project. In this mode I can help you more.

from pf4j-spring.

sljinlet avatar sljinlet commented on August 16, 2024

I was going to enter an issue or try to ask a question that seems related to the above, so I'll ask it here for now:

Can you elaborate on if we should be using .zip or .jar plugin files? The pf4j-spring demo builds .zip files, but the run-demo.sh script doesn't use them...it copies the .jar files instead. When I try copying the .zip files instead, the app fails to find the plugin class implementation. I notice that the .zip files do have additional dependencies in them, so maybe in general they are needed.

I think maybe what you're saying is that the main pf4j demo shows the way to build plugins as .jar files that include the dependencies. Is that right? Could you possibly update the pf4j-spring demo to demonstrate the most correct way to do things? If not, maybe you could provide some information in a more obvious place regarding just how to best get going with your project if your demo isn't the best way.

from pf4j-spring.

sljinlet avatar sljinlet commented on August 16, 2024

I believe I've done what I asked to have the author do above. I've submitted a pull request for this work.

from pf4j-spring.

MohankumarD avatar MohankumarD commented on August 16, 2024

Will you able to tell me what is the mistake in the existing plugin project.

I didn't say that something is wrong with demo project from pf4j-spring. I say that it is an old version of demo project from pf4j, and it uses assembly.xml to pack the plugin in a zip file.
The demo from pf4j doesn't use an assembly.xml and pack the plugin in a jar file.
My recommendation is to try to run demo project (using run-demo.sh or run-demo.bat script) first, and after this to continue with your project. In this mode I can help you more.

I have executed the run-demo.bat file and successfully executed. Please guide me on how do I check the demo project.

from pf4j-spring.

decebals avatar decebals commented on August 16, 2024

I fixed the run-demo scripts. Please run-demo again.
@MohankumarD
If everything is OK you will see in in console the messages printed by extensions:
image

Can you elaborate on if we should be using .zip or .jar plugin files?

pf4j-demo uses the .jar format plugins and pf4j-spring-demo uses the .zip format plugins. Both plugins format (.jar and .zip) are OK. For .zip it's a little bit extra work but you will see all jar dependencies in lib directory. For .jar it's much simple from plugin packaging point of view (no assembly.xml file) but all classes files from all dependencies are merged in a big (fat) jar. Everything depends only by your preferences,

from pf4j-spring.

MohankumarD avatar MohankumarD commented on August 16, 2024

I fixed the run-demo scripts. Please run-demo again.
@MohankumarD
If everything is OK you will see in in console the messages printed by extensions:
image

Can you elaborate on if we should be using .zip or .jar plugin files?

pf4j-demo uses the .jar format plugins and pf4j-spring-demo uses the .zip format plugins. Both plugins format (.jar and .zip) are OK. For .zip it's a little bit extra work but you will see all jar dependencies in lib directory. For .jar it's much simple from plugin packaging point of view (no assembly.xml file) but all classes files from all dependencies are merged in a big (fat) jar. Everything depends only by your preferences,

Not able to build plugin1 and 2 projects “mvn clear package”

from pf4j-spring.

decebals avatar decebals commented on August 16, 2024

@MohankumarD
Just run run-demo.bat (for Windows) and run-demo.sh (for Linux) from root of pf4j-spring project.
If you don't succeed please paste last lines here to take a look.

from pf4j-spring.

MohankumarD avatar MohankumarD commented on August 16, 2024

@decebals
If I execute run-demo.bat, it's working fine and I am able to get the result as specified. But I want to make some changes in Plugin1 app alone and create a build. Let me know the changes need to be done in POM file for a successful build.

from pf4j-spring.

decebals avatar decebals commented on August 16, 2024

@MohankumarD
And where is the problem?
If you take a look of plugin1's pom.xml you will see that this plugin contains a dependency to commons-lang:

<dependency>
    <groupId>commons-lang</groupId>
    <artifactId>commons-lang</artifactId>
    <version>2.6</version>
</dependency>

You can add what dependencies you want. At the end, to create the new plugin distribution (plugin.zip) you must:

  • cd pf4j-spring
  • mvn clean package

The plugin file (pf4j-spring-demo-plugin1-0.6.0-SNAPSHOT.zip) is available at demo/plugins/plugin1/target.

image.

from pf4j-spring.

MohankumarD avatar MohankumarD commented on August 16, 2024

I am trying to build app and plugin separately but I can't. for demo separately its ok to build in one short.
Since the implementation of plugin architecture, plugin development should be outsourced.

[ERROR] Failed to execute goal on project pf4j-spring-demo-api: Could not resolve dependencies for project org.pf4j.demo:pf4j-spring-demo-api:jar:0.6.0-SNAPSHOT: Failure to find org.pf4j:pf4j-spring:jar:0.6.0-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced -> [Help 1]

from pf4j-spring.

decebals avatar decebals commented on August 16, 2024

@MohankumarD
Did you follow the steps described by me in #28 (comment)? Is it OK for you and you can run the demo?

from pf4j-spring.

MohankumarD avatar MohankumarD commented on August 16, 2024

Yes, I can. But I am not build plugin project alone. I want to build APP and PLUGIN seprately and deploy plugin as JAR file.

from pf4j-spring.

decebals avatar decebals commented on August 16, 2024

Now, I think that I understood what you say.
You need some resources (pf4j-spring, api) to build a plugin separately so:

  • go to root of pf4j-spring project and run mvn clean install
  • go to pf4j-spring/demo/plugins/plugin1 and run mvn clean package

from pf4j-spring.

MohankumarD avatar MohankumarD commented on August 16, 2024

Now, I have added a new dependency in Plugin2. Yes, a ZIP file is working, but still, like a JAR file, I am getting same issue (I am not able to pack plugin as a JAR for deployment).

from pf4j-spring.

decebals avatar decebals commented on August 16, 2024

I am not able to pack plugin as a JAR for deployment

For a demo with plugins in format JAR please see PF4J demo.

from pf4j-spring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.