문제

We have a Java EE 5 project built with Ant, which we are porting to a Maven build infrastructure.

We are using SVN as version control and a Jenkins build server.

The odd thing is that some "patch" deliveries include only the sources and binaries modified since the last major version, these called the "patch delta". This delta is then applied over the major version binaries.

The way we achieved this is to record the last revision of the major version, run an svn log since that revision to obtain the list of modified sources, then use a custom script that matches the source name (output from svn log) with its corresponding binary(ies), which are then copied in the "delta structure".

Before adapting the custom script to the new Maven project structure, I'd like to know if there is a Maven way to do all this?

Also, other ideas to generate this "delta structure" are much appreciated.

도움이 되었습니까?

해결책

Your requirement is unique and I doubt any existing plugins will satisfy it.

You could develop your own Maven plugin which will do this. Alternatively, if you have things ready which work with Ant, you could use Maven ANT Plugin although this would be regarded as abusing Maven as you really are building using ANT and can skip Maven entirely. I do not see any better alternatives.

다른 팁

Once I participated in development of such Maven plugin under the same circumstances - migration from Ant to Maven, delta builds.

I think one of the reasons why such plugin doesn't exist in open source (besides conflict with Maven philosophy) is that rules for the assembly of patch (delta) is highly specific to every concrete situation. For example, our patch structure consisted of more than a dozen subdirectories, all with different rules for inclusion in patch, also affected by merges.

However, in my opinion, our decision to write Maven plugin instead of supporting old Ant scripts was right. Testing and support of Ant code is quite expensive, and integration with Maven adds even more complexity. On the other hand, it's not very hard to cover Maven plugin, written in plain Java, with unit and integration tests, so regressions could be caught easily.

So, if you plan to keep requirement of making delta builds, I recommend you to invest time in writing custom Maven plugin.

We used SVNKit library for integration with SVN to simplify development (no need to parse text output of svn log) and make our plugin environment-independent (no need to have svn binary in PATH).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top