Petals Studio

Maven POM customisation (wizard configuration through a preference page)

Details

  • Type: Improvement Request Improvement Request
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1.0
  • Fix Version/s: 1.1.1
  • Component/s: Petals Tools
  • Security Level: Public
  • Description:

    Nowadays, it is possible to add a parent POM by default to all projects, but sometimes, this is not enough, we want to be able to customize the whole POM template, with a wizard to customize all specific fields.

  • Environment:
    Petals Studio 1.1.0

Activity

Hide
Vincent Zurczak added a comment - Wed, 28 Jul 2010 - 11:32:46 +0200

What do you want to customize exactly? What fields?
Would the customization apply to all your projects?
Or are you just asking for an Eclipse tool to configure Maven?

In the last case, is m2eclipse not enough?

Show
Vincent Zurczak added a comment - Wed, 28 Jul 2010 - 11:32:46 +0200 What do you want to customize exactly? What fields? Would the customization apply to all your projects? Or are you just asking for an Eclipse tool to configure Maven? In the last case, is m2eclipse not enough?
Hide
Charles Casadei added a comment - Wed, 28 Jul 2010 - 12:40:12 +0200

It would be fine if we can have a configurable template for all SU / SA projects

Show
Charles Casadei added a comment - Wed, 28 Jul 2010 - 12:40:12 +0200 It would be fine if we can have a configurable template for all SU / SA projects
Hide
Vincent Zurczak added a comment - Wed, 28 Jul 2010 - 13:02:21 +0200

Asking for which information?

Show
Vincent Zurczak added a comment - Wed, 28 Jul 2010 - 13:02:21 +0200 Asking for which information?
Hide
Charles Casadei added a comment - Wed, 28 Jul 2010 - 13:24:30 +0200

The idea is to define the general structure of a POM file and let some fields configurable. To declare a field configurable in a template you may want to use a syntax like this <version>${myArtifactVersion}</version>.

In the default wizard for SU, you can add a checkbox asking for configurable pom. If the checkbox is ticked, then a wizard allowing the user to configure all the fields declared in the template with effective values.

Show
Charles Casadei added a comment - Wed, 28 Jul 2010 - 13:24:30 +0200 The idea is to define the general structure of a POM file and let some fields configurable. To declare a field configurable in a template you may want to use a syntax like this <version>${myArtifactVersion}</version>. In the default wizard for SU, you can add a checkbox asking for configurable pom. If the checkbox is ticked, then a wizard allowing the user to configure all the fields declared in the template with effective values.
Hide
Vincent Zurczak added a comment - Wed, 28 Jul 2010 - 14:00:47 +0200

I see the integration point.
But which information exactly?

As an example, when people create a new SU project, why would the version be different than 1.0-SNAPSHOT?
If it is a different version, why do not update the original project?

The name and artifact ID are related to the project name. Why would someone change them?
In fact, the only fields that seem relevant to be customized are the groupId and the POM parent (that may be different from the overall shared ones).

However, do this happen often?
And when it happens, isn't it as simple as editing the POM by hand ?

My intention is not to discourage your request.
I only want to understand its interest and make sure this is a useful feature.
Besides, I'd like to remember that since the version 1.1.0, the generated POM are directly usable with the Petals Maven plug-in.
At least for SU projects. SA projects still need to see their dependencies updated (true for the version 1.1.0 but not for the next version 1.1.1).

Show
Vincent Zurczak added a comment - Wed, 28 Jul 2010 - 14:00:47 +0200 I see the integration point. But which information exactly? As an example, when people create a new SU project, why would the version be different than 1.0-SNAPSHOT? If it is a different version, why do not update the original project? The name and artifact ID are related to the project name. Why would someone change them? In fact, the only fields that seem relevant to be customized are the groupId and the POM parent (that may be different from the overall shared ones). However, do this happen often? And when it happens, isn't it as simple as editing the POM by hand ? My intention is not to discourage your request. I only want to understand its interest and make sure this is a useful feature. Besides, I'd like to remember that since the version 1.1.0, the generated POM are directly usable with the Petals Maven plug-in. At least for SU projects. SA projects still need to see their dependencies updated (true for the version 1.1.0 but not for the next version 1.1.1).
Hide
Vincent Zurczak added a comment - Fri, 30 Jul 2010 - 16:01:22 +0200

Can you indicate which fields you would customize in a SU project's POM?

Show
Vincent Zurczak added a comment - Fri, 30 Jul 2010 - 16:01:22 +0200 Can you indicate which fields you would customize in a SU project's POM?
Hide
Vincent Zurczak added a comment - Fri, 30 Jul 2010 - 17:02:12 +0200

I can provide an option (disabled by default) to customize the POM of each SU project.
I think I can also add this behavior for SA projects.

However, it won't be available for KPI configurations and exported sketch projects.
For these last cases, the pom.xml will have to be updated by hand, since these cases involve mass generation.

Show
Vincent Zurczak added a comment - Fri, 30 Jul 2010 - 17:02:12 +0200 I can provide an option (disabled by default) to customize the POM of each SU project. I think I can also add this behavior for SA projects. However, it won't be available for KPI configurations and exported sketch projects. For these last cases, the pom.xml will have to be updated by hand, since these cases involve mass generation.
Hide
strivella added a comment - Mon, 2 Aug 2010 - 14:47:31 +0200

I agree with the proposal made by email and copied below as long as I can generate the pom.xml structure of my choice and that I can graphically specify custom variables values inside it.
If I understand well I won't have this ability for KPI and BPEL SU?
I don't understand clearly where this limitation comes from but I guess we can deal without as for now. We'd appreciate the best you can do.

========================================================================================================================
[COMPLETE EXCHANGE TRACE]

La demande de fonctionnalité est acceptée.

J'ai proposé une première solution, inspirée du mail que tu m'as redirigé.
Cependant, il y aurait peut-être une approche alternative.

Un wizard, c'est fait pour être aussi court et complet que possible.
Mais éditer des colonnes dans un wizard, c'est délicat, et ça devient vite difficile à gérer s'il y a beaucoup de champs.
J'ai aussi mentionné dans le bug le fait que ça ne pourrait pas être porté pour KPI et les exports de croquis, car on exporte en masse et il n'est pas possible de spécifier le POM de chaque projet généré.

Une autre approche serait donc d'avoir un éditeur de POM spécialisé.
On repart sur un éditeur de type "formulaire web", et pour chaque champs, on propose la valeur actuelle et une liste construite à partir du template personnalisé.
Les choses se font ainsi en deux temps.

On créé la SU / SA. Le POM contient des valeurs par défaut, qui fonctionnent déjà.
Ensuite, si on veut modifier le POM, on ouvre le POM avec notre éditeur.
Ce ne sera pas un éditeur texte, donc ça limite les risques d'erreur.
Et apparemment, le principal intérêt du wizard, c'est justement ce côté "interface graphique" qui est plus rassurante que le texte brut.

Cette solution a en plus l'avantage d'être modulaire, au lieu de toucher au wizards. Cela serait applicable à tous les artéfacts Maven.
En termes de temps, c'est aussi plus rapide à faire, car les wizards SU sont relativement compliqués (à force de vouloir customiser...).

Tu peux voir ce qu'en pense Sébastien Trivella et le reste de son équipe ?

Vincent.
========================================================================================================================

Show
strivella added a comment - Mon, 2 Aug 2010 - 14:47:31 +0200 I agree with the proposal made by email and copied below as long as I can generate the pom.xml structure of my choice and that I can graphically specify custom variables values inside it. If I understand well I won't have this ability for KPI and BPEL SU? I don't understand clearly where this limitation comes from but I guess we can deal without as for now. We'd appreciate the best you can do. ======================================================================================================================== [COMPLETE EXCHANGE TRACE] La demande de fonctionnalité est acceptée. J'ai proposé une première solution, inspirée du mail que tu m'as redirigé. Cependant, il y aurait peut-être une approche alternative. Un wizard, c'est fait pour être aussi court et complet que possible. Mais éditer des colonnes dans un wizard, c'est délicat, et ça devient vite difficile à gérer s'il y a beaucoup de champs. J'ai aussi mentionné dans le bug le fait que ça ne pourrait pas être porté pour KPI et les exports de croquis, car on exporte en masse et il n'est pas possible de spécifier le POM de chaque projet généré. Une autre approche serait donc d'avoir un éditeur de POM spécialisé. On repart sur un éditeur de type "formulaire web", et pour chaque champs, on propose la valeur actuelle et une liste construite à partir du template personnalisé. Les choses se font ainsi en deux temps. On créé la SU / SA. Le POM contient des valeurs par défaut, qui fonctionnent déjà. Ensuite, si on veut modifier le POM, on ouvre le POM avec notre éditeur. Ce ne sera pas un éditeur texte, donc ça limite les risques d'erreur. Et apparemment, le principal intérêt du wizard, c'est justement ce côté "interface graphique" qui est plus rassurante que le texte brut. Cette solution a en plus l'avantage d'être modulaire, au lieu de toucher au wizards. Cela serait applicable à tous les artéfacts Maven. En termes de temps, c'est aussi plus rapide à faire, car les wizards SU sont relativement compliqués (à force de vouloir customiser...). Tu peux voir ce qu'en pense Sébastien Trivella et le reste de son équipe ? Vincent. ========================================================================================================================
Hide
Charles Casadei added a comment - Mon, 2 Aug 2010 - 14:58:58 +0200

We have a generic plugin template which works for most components, but not those two, Vincent could go deeper in details, if you want to

Show
Charles Casadei added a comment - Mon, 2 Aug 2010 - 14:58:58 +0200 We have a generic plugin template which works for most components, but not those two, Vincent could go deeper in details, if you want to
Hide
Vincent Zurczak added a comment - Mon, 2 Aug 2010 - 15:09:02 +0200

Hi,

With the proposal, the genrated POM would be exactly the same than right now.
But after the creation, you could decide to change it. By double-clicking the pom.xml, an editor would open and propose a user-interface to edit it (as a set of label and list of values that are pre-defined by the template).
This approach would work with any Petals project, KPI and sketch export included.
The proposed user interface would be exactly the same thing you expect in the wizard.

The editor approach covers more cases and lets the user choose (which is better than a hard-coded option).
Besides, the general trend in the Petals wizards is to reduce the number of pages per wizard, and complete the artifacts with an editor.
This is why a "JBI editor" was added in the verison 1.0 of the studio. It is the beginning of the path to this trend.

Why a wizard approach would not work with sketch exports and KPI... (mass generation).

Let's suppose you have created a BPEL process that orchestrates 50 services.
You made it run in various BPEL engines (e.g. Apache ODE). And now, you would like to run it in Petals to evaluate its BPEL engine.

To do that, you would create a BPEL sketch project in the studio, starting from an existing BPEL (import).
Right then, you would export it in Petals SU and SA projects. The BPEL and the different WSDL definitions would be introspected and a list 52 projects to be created would be proposed in the export wizard.
50 SU projects for SOAP, 1 for BPEL and one (SA) assembly project.

Obviously, you could not expect the wizard to ask you the POM elements for the 52 projects.
But with the editor approach, that would be possible.

Show
Vincent Zurczak added a comment - Mon, 2 Aug 2010 - 15:09:02 +0200 Hi, With the proposal, the genrated POM would be exactly the same than right now. But after the creation, you could decide to change it. By double-clicking the pom.xml, an editor would open and propose a user-interface to edit it (as a set of label and list of values that are pre-defined by the template). This approach would work with any Petals project, KPI and sketch export included. The proposed user interface would be exactly the same thing you expect in the wizard. The editor approach covers more cases and lets the user choose (which is better than a hard-coded option). Besides, the general trend in the Petals wizards is to reduce the number of pages per wizard, and complete the artifacts with an editor. This is why a "JBI editor" was added in the verison 1.0 of the studio. It is the beginning of the path to this trend. Why a wizard approach would not work with sketch exports and KPI... (mass generation). Let's suppose you have created a BPEL process that orchestrates 50 services. You made it run in various BPEL engines (e.g. Apache ODE). And now, you would like to run it in Petals to evaluate its BPEL engine. To do that, you would create a BPEL sketch project in the studio, starting from an existing BPEL (import). Right then, you would export it in Petals SU and SA projects. The BPEL and the different WSDL definitions would be introspected and a list 52 projects to be created would be proposed in the export wizard. 50 SU projects for SOAP, 1 for BPEL and one (SA) assembly project. Obviously, you could not expect the wizard to ask you the POM elements for the 52 projects. But with the editor approach, that would be possible.
Hide
Vincent Zurczak added a comment - Thu, 19 Aug 2010 - 14:51:18 +0200

With my proposal, here is how it would work:
1. Create your projet, as usual.
2. If you dislike the POM, double-click it. It is open in an editor, somehow similar to the JBI editor (a Web form-like interface).
3. Use the drop-down lists to update the field values, the lists being populated from a template that was specified in the preferences.

Would it be suitable for your usage?
The main advantage is that it can be applied for any Maven project.

Show
Vincent Zurczak added a comment - Thu, 19 Aug 2010 - 14:51:18 +0200 With my proposal, here is how it would work: 1. Create your projet, as usual. 2. If you dislike the POM, double-click it. It is open in an editor, somehow similar to the JBI editor (a Web form-like interface). 3. Use the drop-down lists to update the field values, the lists being populated from a template that was specified in the preferences. Would it be suitable for your usage? The main advantage is that it can be applied for any Maven project.
Hide
Vincent Zurczak added a comment - Mon, 23 Aug 2010 - 17:58:49 +0200

OK. In fact, we can use pre-defined templates for POM files.
The templates would be defined through a preference page.

Each template could use variables to be set by the wizard.
Each template would start with the component-name, and would describe the POM for a SU project that targets this component.
Obviously, there would be a default template for all the SU projects whose target component does not have a specific POM template.
There would be also a default (but customizable) POM template for SA projects.

Based on these preferences, the wizard would directly use the appropriate template to generate the pom.xml file of the project.

Show
Vincent Zurczak added a comment - Mon, 23 Aug 2010 - 17:58:49 +0200 OK. In fact, we can use pre-defined templates for POM files. The templates would be defined through a preference page. Each template could use variables to be set by the wizard. Each template would start with the component-name, and would describe the POM for a SU project that targets this component. Obviously, there would be a default template for all the SU projects whose target component does not have a specific POM template. There would be also a default (but customizable) POM template for SA projects. Based on these preferences, the wizard would directly use the appropriate template to generate the pom.xml file of the project.
Hide
strivella added a comment - Mon, 23 Aug 2010 - 18:29:54 +0200

Exactly what I expected
Thank you very much!

Show
strivella added a comment - Mon, 23 Aug 2010 - 18:29:54 +0200 Exactly what I expected Thank you very much!
Hide
Vincent Zurczak added a comment - Fri, 10 Sep 2010 - 15:40:29 +0200

Commit # 1832
The POM generation was completed to support customized templates
The Maven preference page was completely redesigned
The Petals XSD were updated
Icons were updated
SU project names now allow dots in the service name

Show
Vincent Zurczak added a comment - Fri, 10 Sep 2010 - 15:40:29 +0200 Commit # 1832 The POM generation was completed to support customized templates The Maven preference page was completely redesigned The Petals XSD were updated Icons were updated SU project names now allow dots in the service name

People

Dates

  • Created:
    Wed, 28 Jul 2010 - 09:48:09 +0200
    Updated:
    Fri, 10 Sep 2010 - 15:40:36 +0200
    Resolved:
    Fri, 10 Sep 2010 - 15:40:29 +0200