Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Problem statement: Every service has a separate repository. what is the best way to use a common framework across several service repositories?
We are trying to create an API test automation framework using "Karate".
Here we want to create a framework(Which can be distributed(example:jar)) such that it can be used across all of the microservice project repositories.
As the creator of Karate, I strongly recommend you don't do this. In the long term this makes all your projects depend on one common framework - and you should try to reduce the creation of "home grown" frameworks. Especially for a testing framework, you should try not to force teams to depend on an additional library which you need to maintain and version-control. Re-use can cause more harm than good especially in the context of testing, see this article at the Google Testing Blog.
That said, since Karate can read files from the classpath: you can "ship" a JAR file with common Java classes and even feature or JS files that all your projects can inherit from or "re use". In fact the karate-base.js has been designed to solve for common bootstrap logic or variables / parameters being supplied from a JAR file.
Short Answer: use normal Java techniques (Maven / Gradle) to create a re-usable JAR file. There are multiple ways to use resources (Java, *.feature, JS) from a JAR file. It is up to you how to structure your Maven (or Gradle) projects to make this happen.
EDIT: for those looking for how to create a "runnable" JAR, please see https://stackoverflow.com/a/56553194/143475
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Problem statement: Every service has a separate repository. what is the best way to use a common framework across several service repositories?
We are trying to create an API test automation framework using "Karate".
Here we want to create a framework(Which can be distributed(example:jar)) such that it can be used across all of the microservice project repositories.
As the creator of Karate, I strongly recommend you don't do this. In the long term this makes all your projects depend on one common framework - and you should try to reduce the creation of "home grown" frameworks. Especially for a testing framework, you should try not to force teams to depend on an additional library which you need to maintain and version-control. Re-use can cause more harm than good especially in the context of testing, see this article at the Google Testing Blog.
That said, since Karate can read files from the classpath: you can "ship" a JAR file with common Java classes and even feature or JS files that all your projects can inherit from or "re use". In fact the karate-base.js has been designed to solve for common bootstrap logic or variables / parameters being supplied from a JAR file.
Short Answer: use normal Java techniques (Maven / Gradle) to create a re-usable JAR file. There are multiple ways to use resources (Java, *.feature, JS) from a JAR file. It is up to you how to structure your Maven (or Gradle) projects to make this happen.
EDIT: for those looking for how to create a "runnable" JAR, please see https://stackoverflow.com/a/56553194/143475
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'd like to designing new web application with few requirements and considering which language/framework I should choose.
Requirements:
Web based solution (web UI and backed)
Fast deployment and setup <- by this I mean just run by single command,
no configuration needed for total beginner. Similar to
Jenkins
java -jar jenkins.war
or Gerrit.
Some kind of que to run tasks asynchronously.
No code protection
Due to the fact that I want to be simple to run and deploy (without initial configuration needed) I am considering using Java EE/Spring framework.
Initially I was considering Django or RoR since deploy is pretty easy and development is way faster than Java but those
frameworks need some kind of scheduling framework like Celery + some kind of broker so additional configuration is needed.
I am not limited to any language,(besides PHP since I just do not like it :P)
If any of you have any thoughts about my design and want to share let's do it.
Thanks a lot for any kind of question/ answers.
It is a very open question and there is really no right answer for it. Rails is really great framework for web development, there are gems basically for everything but deployment is not as straightforward as java -jar and also it does not shine that much when you have SPA on the frontend.
If you're planning to build Single Page Application with one of the modern frameworks you may want to consider Spring Boot. Main benefits:
very ops friendly (java -jar), metrics, health checks
whole application config just in one file
great MVC framework for exposing REST endpoints
implementing tasks running in background is trivial.
few programming languages to choose from: Java, Groovy, Kotlin.
Grails 3 looks also promising but since I haven't used it yet I can only suggest having a look.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Eclipse is designed base on OSGi model. And the OSGi model declaim it supports hot install and uninstall bundles. So I am confused why the Eclipse always need to restart to take a new install plug-in work. Is the OSGi model not that good or Eclipse not implemented the whole model?
The OSGi model works very well, but dynamics doesn't come for free. Bundle code needs to be written in such a way as to cope with services coming and going.
Eclipse has two problems. First there are an awful lot of legacy plugins that are not dynamic-aware and are written by frankly mediocre developers. Second, Eclipse has always shunned the services part of OSGi, instead favouring the "extension registry" with its a more static and clunky lifecycle (actually it's possible to handle dynamic updates with the extension registry, but much harder than when using OSGi services).
Actually in many cases Eclipse can dynamically cope with the addition of plugins, which is why the install dialog gives you the option to do this. But because of the variable quality of third party plugins, it plays safe and recommends a restart.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need to create a very simple DMS (Document Management System) / File Repository / file manager or whatever we might call it under Java EE.
It should permit the user to create folders and upload files into it and the folder/files information should be stored inside the database for checking which user created what (in this sense a simple file-manager which only lets one browse directories on the server's disk is not enough).
To be more explicit here's what it should be more or less:
So far I searched for canned solutions which I could use however I only found TinyDMS (http://sourceforge.net/projects/tinydms/) which is very good (picture above is a screenshot of it in action), it uses jackrabbit for file search however needs a lot of Spring framework dependencies and is a hell to be compiled (didn't succeed yet).
Then there's OpenKM and LogicalDoc but those are really complex programs which don't fit well to be included into a third party application.
Isn't there anything I can start with?
use jackrabbit DMS java base.
http://jackrabbit.apache.org/
If you don´t want to use Alfresco, Nuxeo, or other DMS, maybe you should develop your own "Light (DMS)". For that you can start with the repository; for this you could try Apache Jackrabbit or Modeshape as the lower level to manage data, files, versionong, deletion, etc. Personally, I´m using Modeshape for my graduate project beacuse of it´s documentation and ease of implementation. Then I use JAAS to manage users and its permissions for each file or folder.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have a dozen Java projects that depend on each other, and I frequently make changes that cross-cut all of them. However, many of the projects are libraries that could be used independently of each other as well.
Right now I use mercurial subrepos, which works well except that very few third-party tools support it - it's hard to set up code review tools, continuous integration, etc.
What's the best way to address this situation? Split everything into separate projects and build separate JARs? Migrate to git and use git subrepositories? Check everything in to a single repo and accept that I have to check out everything to use anything? Something else?
I would say the best way to do it would be to cut your dependencies so that they can reference as external jars. This way when you make potentially breaking changes you don't necessarily have to fix the affected areas straight away. Since they depend on a previously built jar it allows you to properly isolate your coding. If you use something like Maven to manage your dependencies you will also benefit from the ability to more easily keep track of the different versions of your jars.
If the subprojects are sufficiently autonomous, I would advise setting them up as separate maven projects with separate VCS repos.
This will give you the modularity you need paired with a working dependency management.