Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically install plugins necessary for template-sets #1494

Open
4 tasks
MikeSchumacherCapgemini opened this issue Mar 3, 2022 · 3 comments
Open
4 tasks
Labels
comp:core research Team_CobiGen_Templates These issues will be handeled by the team CobiGen_Templates
Milestone

Comments

@MikeSchumacherCapgemini
Copy link
Collaborator

MikeSchumacherCapgemini commented Mar 3, 2022

As a cobigen user, I want cobigen to automatically install the plugins necessary for generation so that i do not have issues related to necessary plugins when it comes to generation.

Acceptance Criteria

  • plug-ins necessary for a template-set should be specified as maven dependency within the template-set
  • plug-ins conflicting (in case of already installed plug-in in eclipse vs. the same in a different version specified in a template-set) should be resolved by preferring the template-set configured plug-in with a WARN notice on the log
  • plug-ins specified in one template-set should be just loaded for templates within the template-set.
  • in case multiple template-sets are involved in a generation, cobigen needs to make sure, that plug-ins specified by template-set A are not taken into account for generation of templates of template-set B
@maybeec maybeec added Team_CobiGen_Templates These issues will be handeled by the team CobiGen_Templates comp:core labels Apr 5, 2022
@maybeec maybeec changed the title Automaticlly install plugins necessary for template set Automatically install plugins necessary for template-sets Apr 7, 2022
@maybeec maybeec added this to the v2021.12.007 milestone Apr 21, 2022
@maybeec maybeec added research and removed proc:r4e labels Sep 14, 2022
@Ali7223 Ali7223 self-assigned this Oct 1, 2022
@Ali7223 Ali7223 removed their assignment Oct 17, 2022
@jan-vcapgemini jan-vcapgemini self-assigned this Nov 10, 2022
@Lur1an Lur1an removed their assignment Nov 11, 2022
Zylesto added a commit to Zylesto/cobigen that referenced this issue Nov 14, 2022
Zylesto added a commit to Zylesto/cobigen that referenced this issue Nov 14, 2022
@Zylesto Zylesto self-assigned this Nov 15, 2022
Ali7223 added a commit to Ali7223/cobigen that referenced this issue Nov 15, 2022
Zylesto added a commit that referenced this issue Nov 16, 2022
changed path of pom used in registerPlugin()
@Ali7223
Copy link
Contributor

Ali7223 commented Dec 7, 2022

As of now CobigenUtils class loads all the dependencies declared in cli-config pom and Lookupservices is called after the retrieval of dependencies as URLClassLoader specified in a cli config pom.xml and we would like that at this point the template-set project pom is considered and relative dependencies required for generation are loaded.
Lookupservices iterates through all the URLS in class loader and as of now it loads all the plugins in generatorPluginActivatorClasses since we have declared all the plugins as dependendcies in cli-config pom.xml.
Further getTriggerInterpreter method in PluginRegistry class selects which plugins to activate after reading the file extension name.
Triggers are activated by file extensions but what files should be generated is selected by means of selected increments. The plugins for relative file extensions specified
in increments are to be added in pom.xml of the given template-set project. Now the question arises at what point the specific templates project should be considered(for loading its dependencies)?
The Idea to achieve the acceptance points of this ticket is that we first check what increments have been selected and register plugins specified in their respected projects pom.xml and load their URLs in ClassLoader since there are methods already available for doing such task in CobigenUtil class registerPlugin method is one of them.
In case of a conflict we could use resolvedependencies method present in MavenUtil Class to choose which plugins to prefer for a specific template-set.
There might be a problem with this approach since most of the loading process will be done after selecting the increments which might make the process slow.
I would also appreciate your feedback

@maybeec
Copy link
Member

maybeec commented Jan 3, 2023

seems that there is some work being done on this on branch 1494-wip-template-set-plugin-loader-felix. Could someone check the state? Can we create a PR ?

@NelsonNew
Copy link
Contributor

Possible solution is to incrementally generate and use for each generate only one template with template-set-specific dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:core research Team_CobiGen_Templates These issues will be handeled by the team CobiGen_Templates
Projects
None yet
Development

No branches or pull requests

8 participants