Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] [pomless] maven-deploy-plugin configuration

> But targets and features are only stuff that makes sense in a p2
> environment, you typically would not consume a target or a feature
> via plain Maven

You can consume deployed target files in m2e-pde/Tycho directly, tycho snapshot contains a new mojo that allows to create/deploy a p2 site to maven as well and then consume all artifacts from maven directly without dedicated deployment (that's a bit experimental though atm).

> improving the maven-deploy-plugin would be also an option

I would think this should be the goal, because even if it is possible to specify properties in build.properties it's a bit cumbersome to do so as it is a thing you have to think of for each and every new created item (what contradicts a bit the nice thing about pomless that is about reducing configuration effort).

> But do you know why the property replacement is not working?

Most likely because a perquisite is not meet, eg you have a typo or do not use the most recent tycho version in the extensions.xml (!)

> any hint how I could provide more information?

You can output the generated pom.xml with the option

-Dpolyglot.dump.pom=generated_pom.xml

to better see whats going on.



Am 10.06.21 um 13:04 schrieb Fauth Dirk (XC-ECO/ESM1) via tycho-dev:
But targets and features are only stuff that makes sense in a p2 environment, you typically would not consume a target or a feature via plain Maven, as the plain Maven usage doesn't make sense. At least from my point of view. Maybe I oversee something.

Well, improving the maven-deploy-plugin would be also an option. But do you know why the property replacement is not working? I mean, from the description it should do exactly what I was looking for. Why does it not work here? Any idea? Or any hint how I could provide more information?

Mit freundlichen Grüßen / Best regards

  Dirk Fauth

Cross-Domain Computing Solutions, Cross Automotive Platforms - System, Software and Tools Engineering Engineering Software Methods and Tools1 (XC-ECO/ESM1)
Robert Bosch GmbH | Postfach 30 02 40 | 70442 Stuttgart | GERMANY | www.bosch.com
Tel. +49 711 811-57819 | Telefax +49 711 811 | Dirk.Fauth@xxxxxxxxxxxx

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar Denner,
Prof. Dr. Stefan Asenkerschbaumer, Filiz Albrecht, Dr. Michael Bolle, Dr. Christian Fischer,
Dr. Stefan Hartung, Dr. Markus Heyn, Harald Kröger, Rolf Najork, Uwe Raschke

-----Ursprüngliche Nachricht-----
Von: tycho-dev <tycho-dev-bounces@xxxxxxxxxxx> Im Auftrag von Christoph Läubrich
Gesendet: Donnerstag, 10. Juni 2021 12:46
An: tycho-dev@xxxxxxxxxxx
Betreff: Re: [tycho-dev] [pomless] maven-deploy-plugin configuration

Targets can be useful and features as well. So I think its a bit hard to decide.

maybe I overseen something but the maven-deploy-plugin seems not be very configurable, so maybe it would be better to try get the deploy plugin more flexible?

e.g. instead of an generic <skip> i would find something to specify include/exclude patterns much more convenient, so one can control at the master-pom something like

<build>
      <plugins>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <exclude>**/features/*.jar</exclude>
            </configuration>
        </plugin>
      </plugins>
</build>



Am 10.06.21 um 12:36 schrieb Fauth Dirk (XC-ECO/ESM1) via tycho-dev:
Hi,

This is exactly what I asked for. Unfortunately it does not work. It is skipping the deployment for all projects, even those where I have added the configuration in the build.properties.

I tested it inside the pluginManagement, the build section in a profile and the general build section of the parent pom. In none scenario the property seems to be replaced with false.

Any ideas on what could be wrong or missing?

@Christoph
I am also not that familiar with the Maven deploy stuff. I just read some docs about it and found that you can skip artifact deployment this way.
Actually the default is false, so maybe a better first step would be to at least add the skip flag for the connector poms automatically. Maybe even for the tests, as tests are nothing to be considered to be deployed on Maven Central. Same for the target, product and probably the parent pom? Event features seem to doesn't make sense to be deployed on Maven Central. Setting skip to true on those generated pom.xml files might be worth to have a look at.

Mit freundlichen Grüßen / Best regards

   Dirk Fauth

Cross-Domain Computing Solutions, Cross Automotive Platforms - System,
Software and Tools Engineering Engineering Software Methods and Tools1
(XC-ECO/ESM1) Robert Bosch GmbH | Postfach 30 02 40 | 70442 Stuttgart
| GERMANY | www.bosch.com Tel. +49 711 811-57819 | Telefax +49 711 811
| Dirk.Fauth@xxxxxxxxxxxx

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr.
Volkmar Denner, Prof. Dr. Stefan Asenkerschbaumer, Filiz Albrecht, Dr.
Michael Bolle, Dr. Christian Fischer, Dr. Stefan Hartung, Dr. Markus
Heyn, Harald Kröger, Rolf Najork, Uwe Raschke

-----Ursprüngliche Nachricht-----
Von: tycho-dev <tycho-dev-bounces@xxxxxxxxxxx> Im Auftrag von
Christoph Läubrich
Gesendet: Donnerstag, 10. Juni 2021 09:01
An: tycho-dev@xxxxxxxxxxx
Betreff: Re: [tycho-dev] [pomless] maven-deploy-plugin configuration

@Hannes I'm glad that this feature is found useful by others :-)

@Dirk: First of all MANY thanks for describing the workflow! I'm not very familiar with the maven-deploy-plugin but would it help if pomless would generate the following in the "non-artifact-poms":

<build>
     <plugins>
       <plugin>
         <artifactId>maven-deploy-plugin</artifactId>
           <configuration>
             <skip>false</skip>
           </configuration>
       </plugin>
     </plugins>
</build>

or can tycho-pomless do anything else to tell the maven-deploy-plugin that some parts are only intermediates?

Am 10.06.21 um 08:33 schrieb Hannes Wellmann:
Hello,

since Tycho 2.0 it is possible to define (pom model) properties in
the build.properties of an Eclipse plug-in that are used by Maven:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwik
i
.eclipse.org%2FTycho%2FRelease_Notes%2F2.0%23Define_Maven_Project_pro
p
erties_in_build.properties&amp;data=04%7C01%7Cdirk.fauth%40de.bosch.c
o
m%7C05e2b8e71e3a445db0a508d92bdd9526%7C0ae51e1907c84e4bbb6d648ee58410
f
4%7C0%7C0%7C637589052951766653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj
A
wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=
y
40LLdLrzCkc6o9y67jJIas2yu07gZwnDmsjhvUcqXY%3D&amp;reserved=0

So for your case the pom could have elements like the following:

<properties>
    <skipDeployment>true</skipDeployment>  <!-- skip the publishing to
Maven by default --> </properties>

.
.
.
<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-deploy-plugin</artifactId>
     <version>2.8.2</version>
     <configuration>
       <skip>${skipDeployment}</skip>
     </configuration>
</plugin>


The build.properties of the plugins you want to deploy should have an
entry like this:

pom.model.property.skipDeployment=false


This feature of Tycho is a bit hidden and not advertised, but I find
it very handy for situations like yours.



Greetings

Hannes Wellmann
*Gesendet:* Donnerstag, 10. Juni 2021 um 07:05 Uhr
*Von:* "Fauth Dirk (XC-ECO/ESM1) via tycho-dev"
<tycho-dev@xxxxxxxxxxx>
*An:* "Tycho developers list" <tycho-dev@xxxxxxxxxxx>
*Cc:* "Fauth Dirk (XC-ECO/ESM1)" <Dirk.Fauth@xxxxxxxxxxxx>
*Betreff:* [tycho-dev] [pomless] maven-deploy-plugin configuration

Hi all,

I have written this wiki page to describe the process on how to
deploy on Maven Central on the Eclipse infra with Tycho:

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwik
i
.eclipse.org%2FTycho%3AHow_to_deploy_to_a_Maven_repository&amp;data=0
4
%7C01%7Cdirk.fauth%40de.bosch.com%7C05e2b8e71e3a445db0a508d92bdd9526%
7
C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637589052951766653%7CUnkn
o
wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwi
L
CJXVCI6Mn0%3D%7C1000&amp;sdata=IKVEjDoJIJmNMH00uphBbzfdADQ11W6flq1NHo
a
%2FQlQ%3D&amp;reserved=0
<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwi
k
i.eclipse.org%2FTycho%3AHow_to_deploy_to_a_Maven_repository&amp;data=
0
4%7C01%7Cdirk.fauth%40de.bosch.com%7C05e2b8e71e3a445db0a508d92bdd9526
%
7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637589052951766653%7CUnk
n
own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWw
i
LCJXVCI6Mn0%3D%7C1000&amp;sdata=IKVEjDoJIJmNMH00uphBbzfdADQ11W6flq1NH
o
a%2FQlQ%3D&amp;reserved=0>

I adapted this on one project already successfully and now adapt it
on other projects. One thing that is really bothering me is the
handling of the maven-deploy-plugin. Without additional
configuration, all artefacts are deployed. In a pomless Tycho build
this means that a lot of artefacts are deployed that actually should
not be in Maven Central, like

    * features
    * tests
    * parent
    * connector poms

You can see this for some Eclipse projects on Maven Central already.

I therefore decided to globally skip the deployment by adding this to
the parent pom:

*<plugin>*

*<groupId>*org.apache.maven.plugins*</groupId>*

*<artifactId>*maven-deploy-plugin*</artifactId>*

*<version>*2.8.2*</version>*

/<!-- skip the publishing to Maven by default -->/

*<configuration>*

*<skip>*true*</skip>*

*</configuration>*

*</plugin>*

But then you of course need to enable the deployment on those
projects that should be deployed by adding this to the project pom:

*<build**>*

*<plugins**>*

/<!-- publish this artifact to Maven repositories -->/

*<plugin**>*

*<artifactId**>*maven-deploy-plugin*</artifactId**>*

*<configuration**>*

*<skip**>*false*</skip**>*

*</configuration**>*

*</plugin**>*

*</plugins**>*

*</build**>*

For a pomless build this has the negative side effect that you
actually need to introduce again pom’s for the projects you want to
publish on Maven Central.

Would it be somehow possible to extend (pomless) Tycho to set that
configuration for example via build.properties? Not sure if and how
this could be done, therefore the question here to get some input.

Mit freundlichen Grüßen / Best regards

*Dirk Fauth*

Cross-Domain Computing Solutions, Cross Automotive Platforms -
System, Software and Tools Engineering Engineering Software Methods
and Tools1
(XC-ECO/ESM1)
Robert Bosch GmbH | Postfach 30 02 40 | 70442 Stuttgart | GERMANY |
www.bosch.com <http://www.bosch.com> Tel. +49 711 811-57819 | Telefax
+49 711 811 | Dirk.Fauth@xxxxxxxxxxxx
+<mailto:Dirk.Fauth@xxxxxxxxxxxx>

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr.
Volkmar Denner,
Prof. Dr. Stefan Asenkerschbaumer, Filiz Albrecht, Dr. Michael Bolle,
Dr. Christian Fischer, Dr. Stefan Hartung, Dr. Markus Heyn, Harald
Kröger, Rolf Najork, Uwe Raschke ​

_______________________________________________ tycho-dev mailing
list tycho-dev@xxxxxxxxxxx To unsubscribe from this list, visit
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
eclipse.org%2Fmailman%2Flistinfo%2Ftycho-dev&amp;data=04%7C01%7Cdirk.
f
auth%40de.bosch.com%7C05e2b8e71e3a445db0a508d92bdd9526%7C0ae51e1907c8
4
e4bbb6d648ee58410f4%7C0%7C0%7C637589052951766653%7CUnknown%7CTWFpbGZs
b
3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D
%
7C1000&amp;sdata=ljzdAdE39ghAZVeovNa8XGA5vb%2F6xsPkYSMr4VBSjBU%3D&amp
;
reserved=0
<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
w
.eclipse.org%2Fmailman%2Flistinfo%2Ftycho-dev&amp;data=04%7C01%7Cdirk.
fauth%40de.bosch.com%7C05e2b8e71e3a445db0a508d92bdd9526%7C0ae51e1907c
8
4e4bbb6d648ee58410f4%7C0%7C0%7C637589052951766653%7CUnknown%7CTWFpbGZ
s
b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
D
%7C1000&amp;sdata=ljzdAdE39ghAZVeovNa8XGA5vb%2F6xsPkYSMr4VBSjBU%3D&am
p
;reserved=0>

_______________________________________________
tycho-dev mailing list
tycho-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
eclipse.org%2Fmailman%2Flistinfo%2Ftycho-dev&amp;data=04%7C01%7Cdirk.
f
auth%40de.bosch.com%7C05e2b8e71e3a445db0a508d92bdd9526%7C0ae51e1907c8
4
e4bbb6d648ee58410f4%7C0%7C0%7C637589052951766653%7CUnknown%7CTWFpbGZs
b
3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D
%
7C1000&amp;sdata=ljzdAdE39ghAZVeovNa8XGA5vb%2F6xsPkYSMr4VBSjBU%3D&amp
;
reserved=0

_______________________________________________
tycho-dev mailing list
tycho-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
eclipse.org%2Fmailman%2Flistinfo%2Ftycho-dev&amp;data=04%7C01%7Cdirk.f
auth%40de.bosch.com%7Cd9bb91d2d13347fe468408d92bfd05f8%7C0ae51e1907c84
e4bbb6d648ee58410f4%7C0%7C0%7C637589187988548728%7CUnknown%7CTWFpbGZsb
3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
7C1000&amp;sdata=2hp4dawZaiOWX5cNoARfZ%2FF7w1mgAADghG6cd17Mqhw%3D&amp;
reserved=0 _______________________________________________
tycho-dev mailing list
tycho-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
eclipse.org%2Fmailman%2Flistinfo%2Ftycho-dev&amp;data=04%7C01%7Cdirk.f
auth%40de.bosch.com%7Cd9bb91d2d13347fe468408d92bfd05f8%7C0ae51e1907c84
e4bbb6d648ee58410f4%7C0%7C0%7C637589187988558699%7CUnknown%7CTWFpbGZsb
3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
7C1000&amp;sdata=LsRYwWp10fQSnUgHSqiay8BWO0WJpTvmLgaW86xo1ls%3D&amp;re
served=0

_______________________________________________
tycho-dev mailing list
tycho-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.eclipse.org%2Fmailman%2Flistinfo%2Ftycho-dev&amp;data=04%7C01%7Cdirk.fauth%40de.bosch.com%7Cd9bb91d2d13347fe468408d92bfd05f8%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637589187988558699%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=LsRYwWp10fQSnUgHSqiay8BWO0WJpTvmLgaW86xo1ls%3D&amp;reserved=0
_______________________________________________
tycho-dev mailing list
tycho-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-dev



Back to the top