0

I have a Maven parent project that has 6 modules, each module generates a specific artifact that is copied somewhere, when all the modules are built I want to be able to run an ant task that commits and pushes these artifacts into its GIT repository. Any idea how this could be achieved inside Maven? Currently I run Maven from Ant and then I run the GIT Commit/Push task.

Thanks!

Johann

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>Group</groupId>
    <artifactId>Parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <modules>
        <module>ModuleUtil</module>
        <module>ModuleDomain</module>
        <module>ModuleData</module>
        <module>ModuleUi</module>
        <module>ModuleAsync</module>
        <module>ModuleBatch</module>
        <!-- At this stage I would like to run something -->
    </modules>
</project>
bajistaman
  • 62
  • 8
  • 1
    look at this: http://maven.apache.org/maven-release/maven-release-plugin/ – Timothy Truckle May 05 '17 at 11:31
  • 2
    Just for the records: The order of entries in `` does not mean that much. Maven inspects the dependencies between the modules and triggers generation in desired order. – Timothy Truckle May 05 '17 at 11:32
  • Thanks @TimothyTruckle! – bajistaman May 05 '17 at 17:31
  • What kind of artifact are you generating? Why would you like to commit this? So each build of your current state will change your state in version control ? That sounds simply wrong to me... – khmarbaise May 05 '17 at 19:14
  • @khmarbaise the idea is to use it only for builds that are for release not every build – bajistaman Jul 14 '17 at 20:31
  • Storing binary artifacts into a Git repository is a really bad idea...For such purposes repository Manager like Nexus, Artifactory, Archiva is the right choice...but never use Git or any version control for such things(simply wrong)...Apart from that using a repository manager this can simply be achieved in the end by using `mvn clean deploy` nothing more... – khmarbaise Jul 17 '17 at 12:23

0 Answers0