Hi all,
We are using apache axis2 version 1.6.1 for the deployment of our artifacts
and the flow that takes place is as follows:
[image: Inline image 1]
What is expected here is for the artifacts that are
deployed/undeployed/redployed to be commited to svn. What we could observe
was that, when we add the same artifact to the deployment directoy, within
axis2, it is considered as modified file since the last modified time of
the file has changed. Thus the redployment takes place. However, since it
is the same file that was redeployed, the md5sum will not be changed hence
svn commit will not take place. Would it be a better approach if we modify
the axis2 engine so that an artifact is cosidered modified if and only if
it's md5sum has changed?
Right now, the isModified() method of WSInfoList is as follows:
private boolean isModified(File file, WSInfo wsInfo) {
long currentTimeStamp = wsInfo.getLastModifiedDate();
setLastModifiedDate(file, wsInfo);
return (currentTimeStamp != wsInfo.getLastModifiedDate());
}
My suggestion is to improve it as below:
private boolean isModified(File file, WSInfo wsInfo) {
long previousModifiedDate = wsInfo.getLastModifiedDate();
setLastModifiedDate(file, wsInfo);
String previousMD5Sum = wsInfo.getMd5Sum();
setMD5Sum(file, wsInfo);
String currentMd5Sum = wsInfo.getMd5Sum();
if ((wsInfo.getLastModifiedDate() != previousModifiedDate) &&
(wsInfo.getMd5Sum().equals(previousMD5Sum))) {
log.info("The file has been touched without a modification.
Thus not considered for redeployment");
}
return (!wsInfo.getMd5Sum().equals(previousMD5Sum));
}
Any suggestion is warmly welcome.
Thank you,
Sasikala
--
Sasikala Kottegoda
*Senior Software Engineer*
WSO2 Inc., http://wso2.com/
lean. enterprise. middleware
Mobile: +94 774835928
[image: https://wso2.com/signature] <https://wso2.com/signature>