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

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://wiki.eclipse.org/Tycho/Release_Notes/2.0#Define_Maven_Project_properties_in_build.properties
 
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://wiki.eclipse.org/Tycho:How_to_deploy_to_a_Maven_repository

 

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
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

_______________________________________________ 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