Il 10/06/2013 15:45, Nik ha scritto:
Hi Guys.
I have managed to understand how to create my maven project over the
past weeks (thanks to this users group help).
Now I can build my own maven based project, if I identify bugs that
are important for me to make
my project work correctly: how/what is the method/mechanism which I
should use to integrate these
fixes into my maven based and customised project?
Hi Nik, if you have generated you project by using the archetype you
don't have to do so much: it is enough to keep the right dependencies
into your pom.
As you can see taking a look at your pom.xml files, your syncope project
depends from the actual syncope project; any fix done on syncope will
automatically inherited by your project (of course, if the fixed version
is which one your depend from).
When have you to take care to perform some manual operations?
1. if the fix involves some changes to the db schema
- this can happen working with the trunk or updating your project
from a major version to an earlier one - i.e. 1.1.1 --> 1.1.2
2. if the fix involves changes on one or more classes that you have
overridden in your project
- this can happen frequently if you have a lot of customizations to
the actual code (resources copied from syncope and changed in the overlay)
I tried, as a first blind/hopeful attempt, the following based on what
I did with some config files a few weeks ago (which worked),
but I don't know if this is the correct way to go about things (the
customised config, pom, files etc do get integrated fine) but
maybe this is not what to do when dealing with actual code.
I have a repo with the trunk code up to date (source for my fix)!
[nik@anvil syncope_trunk]$ svn info
Path: .
Working Copy Root Path: /home/nik/UShareSoft/WKS/syncope_trunk
URL: http://svn.apache.org/repos/asf/syncope/trunk
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 1491434
Node Kind: directory
Schedule: normal
Last Changed Author: ilgrosso
Last Changed Rev: 1490583
Last Changed Date: 2013-06-07 12:59:19 +0200 (Fri, 07 Jun 2013)
[nik@anvil syncope_trunk]$
I assume that the fix to bug
https://issues.apache.org/jira/browse/SYNCOPE-285
is available in my Revision: 1491434 based on the bug report info:
Hudson
<https://issues.apache.org/jira/secure/ViewProfile.jspa?name=hudson>added
a comment - 24/May/13 13:44
Integrated in Syncope-trunk #221 (See
[https://builds.apache.org/job/Syncope-trunk/221/])
SYNCOPE-285 <https://issues.apache.org/jira/browse/SYNCOPE-285>Added
missing JAX-B Annotations (Revision 1485957)
[nik@anvil syncope-archetype]$ mkdir -p
common/src/main/java/org/apache/syncope/common/mod
[nik@anvil syncope-archetype]$ cd !$
cd common/src/main/java/org/apache/syncope/common/mod
[nik@anvil mod]$ pwd
/home/nik/UShareSoft/WKS/trunk/BetaWorkspace/idmRBAC/syncope-archetype/common/src/main/java/org/apache/syncope/common/mod
[nik@anvil mod]$ ls
[nik@anvil mod]$ cp
/home/nik/UShareSoft/WKS/syncope_trunk/common/src/main/java/org/apache/syncope
it builds.
:
[INFO] Processing war project
[INFO] Copying webapp resources
[/home/nik/UShareSoft/WKS/trunk/BetaWorkspace/idmRBAC/syncope-archetype/console/src/main/webapp]
[INFO] Processing overlay [ id org.apache.syncope:syncope-console]
[INFO] Webapp assembled in [1912 msecs]
[INFO] Building war:
/home/nik/UShareSoft/WKS/trunk/BetaWorkspace/idmRBAC/syncope-archetype/console/target/syncope-console.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- maven-site-plugin:3.2:attach-descriptor (attach-descriptor)
@ console ---
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Syncope sample project ..................... SUCCESS
[3.169s]
[INFO] Apache Syncope sample project core ................ SUCCESS
[9.073s]
[INFO] Apache Syncope sample project console ............. SUCCESS
[4.205s]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 17.031s
[INFO] Finished at: Mon Jun 10 14:49:52 CEST 2013
[INFO] Final Memory: 24M/194M
[INFO]
------------------------------------------------------------------------
assumption: is the syncope/common/modnew bug fixed classes code
actually integrated in the syncope-war?
big assumption: Is this the correct way to go about patching a
project, I'm totally open to be ridiculed here (I'm not maven
experienced)?
See above. If you are working with the fixed version (I mean, your
project depends on the fixed version of syncope) you will import fix
automatically.
next assumption: Is it safe to copy this trunk code to a branch
1.1.2-SNAPSHOT and expect it to work (I'm very nervous about this)
Absolutely not. May be it works fine this time but this approach is not
the correct one.
We someone fix an issue related both to the branch and to the trunk,
he/she fix the issue on the branch and merge changes on the trunk;
unfortunately, sometimes the merge must be done manually by replicating
the changes row-by-row.
next assumption: if this is unsafe and stupid, what is the way to port
such fixes to such a project?
manually, in your project, overriding all the needed resources (see above).
Anyway, consider that may be you are lucky today: revision changes about
1485957 are back-ported on the branch as well.
Best regards,
F.
Any assistance on this subject, would be as usual, much appreciated.
Regards,
Nik