Comments (19)
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.
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.
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.
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.
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.
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.
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.
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 frompf4j-spring
. I say that it is an old version ofdemo
project frompf4j
, and it uses assembly.xml to pack the plugin in a zip file.
Thedemo
frompf4j
doesn't use an assembly.xml and pack the plugin in a jar file.
My recommendation is to try to run demo project (usingrun-demo.sh
orrun-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.
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:
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.
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:
Can you elaborate on if we should be using .zip or .jar plugin files?
pf4j-demo
uses the .jar format plugins andpf4j-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.
@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.
@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.
@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
.
from pf4j-spring.
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.
@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.
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.
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 runmvn clean install
- go to
pf4j-spring/demo/plugins/plugin1
and runmvn clean package
from pf4j-spring.
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.
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)
- PluginClassLoader issue with loading duplicate spring classes HOT 6
- closed
- maven snapshot not available in repository
- update dependencies to newest spring 5.+ versions HOT 1
- Concrete bean could not be received from the application context HOT 1
- SpringPlugin start/stop/start results in Exception HOT 2
- Loading plugin on-runtime : Ambiguous hander methods mapped & ConcurrentModificationException when unregistering routes
- I use it SpringPluginManager, It seems to be a single case. HOT 4
- How to update the ‘List<Greeting>’ while some plugins unloaded and deleted? HOT 4
- How to add integration tests for the plugin?
- self contained example HOT 1
- Jpa in plug-in not working HOT 1
- Hi author, Can I send a pull request to PF4J-Spring to support the Spring parent-child context ?
- Injecting beans from plugin in application doesn't work HOT 2
- run exception on pf4j-spring demo
- pf4j plugin needs to refresh and detect changes automatically with spring HOT 6
- How to get this repo versions release notes? HOT 2
- Problems with Using Pf4j-Spring HOT 1
- The real implementation cannot be accessed through the api interface. HOT 2
- When 'spring-boot-devtools' is introduced in the project, the extensions are not available. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pf4j-spring.