How can I get Hudson to automatically create and install release artifacts, not just snapshots?

I develop several mavenized projects on my laptop and periodically click on github. I installed a private hudson cloud server in the cloud, which tried out the git repositories for updates and thus does the builds - so far so good.

Unfortunately, when I issue the “mvn release: cook” release on my laptop in order to complete the release (say “1.5”), two commits will occur (change 1.5-SNAPSHOT to 1.5, then from 1.5 to 1.6-SNAPSHOT) into my git repository, and Hudson is obviously building the very latest, i.e. 1.6-SNAPSHOT, and completely ignoring release 1.5.

It doesn't really matter, but the projects are interdependent, and I would like to declare non-pictures in my poses. However, when project B depends on version 1.5 of project A, it is nowhere to be found in the local maven repository for the hudson user in Hudson's box - because it was never built - and therefore the assembly of project B fails.

It would be great if I could make Hudson a little smarter, and when he sees the missing version of the maven release, forces the build and installation of that particular version before proceeding with the assembly of the later snapshot commit.

I looked at Hudson's plugins and, in particular, the M2 Release Plugin:

http://wiki.hudson-ci.org//display/HUDSON/M2+Release+Plugin

-, , , , Maven Repo, , , .

: , , , :

  • open-source , , , - git clone - , mvn install, - , maven central.
  • ( , hudson ), , , , , ( , ).
  • , "mvn install" , , Hudson B , A ( )

:

  • sonotype oss-, GPG - , GPG , :) - Hudson - .
  • , Hudson - CI.
+3
3

. Maven - :

. Maven , . maven.

release:perform:

  • , .
  • maven .
  • .

+2

, , :

<project>
    <profile>
        <id>local-deploy</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <distributionManagement>
            <repository>
                <id>local-repo</id>
                <name>My Local Repo</name>
                <url>file://my/local/repo/dir</url>
            </repository>
        </distributionManagement>
    </profile>
    <profile>
        <id>remote-deploy</id>
        <activation>
            <activeByDefault>false</activeByDefault>
            <property>
                <name>remote.repo.url</name>    
            </property>
        </activation>

        <distributionManagement>
            <repository>
                <id>remote-repo</id>
                <name>My Remote Repo</name>
                <url>${remote.repo.url}</url>
            </repository>
        </distributionManagement>
    </profile>
</project>

release:perform , remote.repo.url, .

0

, - ( , ), ( , hudson checkouts) - , , .

, , , - "" , , , maven.

, , - , , : .. , maven . /p >

( !), - , , , maven.

, , "enforcer":

http://maven.apache.org/enforcer/enforcer-rules/requireReleaseDeps.html

- 'onlyWhenRelease', true, , , .

( " , ?" ), :

  • , ( , "" , , "", , GPG)
  • .
0

Source: https://habr.com/ru/post/1770377/


All Articles