OW2 Consortium novaforge

Compare Revisions

Ignore whitespace Rev 5116 → Rev 5117

/work-experiences/deployment/NovaCICTools/trunk/novadeploy-plugin/src/main/java/org/novaforge/novacic/novadeployplugin/packaging/PackagingUtils.java
544,6 → 544,7
List<Dependency> dependencies = model.getDependencies();
getLog().debug("Dependencies (before):\n\t" + dependencies);
ListIterator<Dependency> i = dependencies.listIterator();
boolean isFound=false;
while (i.hasNext())
{
Dependency d = i.next();
551,7 → 552,15
{
newDependencies.add(d);
}
else
{
isFound=true;
}
}
if (!isFound)
{
getLog().warn("Version to remove was not referenced. Nothing done.");
}
 
model.setDependencies(newDependencies);
 
/work-experiences/deployment/NovaCICTools/trunk/novadeploy-plugin/src/main/java/org/novaforge/novacic/novadeployplugin/packaging/ListVersionMojo.java
3,6 → 3,7
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
 
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
35,6 → 36,13
private String sFilter;
 
/**
* get a repoId list separated by ',' used to limit the research to the given repositories
* @parameter expression="${repoIdList}"
* @optional
*/
private String sRepositoriesList;
 
/**
* The artifactId to add to parent POM
*
* @parameter expression="${verbose}" default-value="false"
47,48 → 55,103
{
try
{
Artifact versionsArtifact = createArtifact(sTargetGroupId, PackagingUtils.EXISTING_VERSIONS_ARTIFACT_NAME, Artifact.SNAPSHOT_VERSION, "pom");
for (Object remoteRepo : getRemoteRepos())
 
// map used to 1) store the couple asked repo ID / known repo and 2) output a warning if an ask repo is not known
HashMap<String, ArtifactRepository> repoIdToArtifactRepo = new HashMap<String, ArtifactRepository>();
if (null !=sRepositoriesList)
{
if (resolveLocalArtifact(versionsArtifact))
for (String repoId : sRepositoriesList.split(","))
{
// if some data are in cache, purge it to force remote resolution
versionsArtifact.getFile().delete();
repoIdToArtifactRepo.put(repoId, null);
}
versionsArtifact = createArtifact(sTargetGroupId, PackagingUtils.EXISTING_VERSIONS_ARTIFACT_NAME, Artifact.SNAPSHOT_VERSION, "pom");
try
{
resolveArtifactForOneRepository(versionsArtifact, ((ArtifactRepository)remoteRepo).getUrl());
getLog().info("Repository : "+((ArtifactRepository)remoteRepo).getUrl());
FileReader fr = new FileReader(versionsArtifact.getFile());
Model model = new MavenXpp3Reader().read(fr);
fr.close();
for (Dependency d : model.getDependencies())
for (ArtifactRepository remoteRepo : getRemoteRepos())
{
if (repoIdToArtifactRepo.containsKey(remoteRepo.getId()))
{
if (null == sFilter || d.getArtifactId().contains(sFilter))
repoIdToArtifactRepo.put(remoteRepo.getId(), remoteRepo);
}
}
}
else
{
for (ArtifactRepository remoteRepo : getRemoteRepos())
{
repoIdToArtifactRepo.put(remoteRepo.getId(), remoteRepo);
}
}
Artifact versionsArtifact = createArtifact(sTargetGroupId, PackagingUtils.EXISTING_VERSIONS_ARTIFACT_NAME, Artifact.SNAPSHOT_VERSION, "pom");
for (String remoteRepoId : repoIdToArtifactRepo.keySet())
{
ArtifactRepository remoteRepo=repoIdToArtifactRepo.get(remoteRepoId);
if (null != remoteRepo)
{
if (resolveLocalArtifact(versionsArtifact))
{
// if some data are in cache, purge it to force remote resolution
versionsArtifact.getFile().delete();
}
versionsArtifact = createArtifact(sTargetGroupId,
PackagingUtils.EXISTING_VERSIONS_ARTIFACT_NAME,
Artifact.SNAPSHOT_VERSION, "pom");
try
{
resolveArtifactForOneRepository(versionsArtifact,
remoteRepo.getUrl());
getLog().info("Repository "+remoteRepo.getId()+": " + remoteRepo.getUrl());
FileReader fr = new FileReader(versionsArtifact.getFile());
Model model = new MavenXpp3Reader().read(fr);
fr.close();
for (Dependency d : model.getDependencies())
{
getLog().info(d.getGroupId() + " : " + d.getArtifactId());
if (isVerbose)
if (null == sFilter
|| d.getArtifactId().contains(sFilter))
{
Artifact latestPom = fileDownload(createArtifact(d.getGroupId(), d.getArtifactId(), Artifact.SNAPSHOT_VERSION, "pom"), ((ArtifactRepository)remoteRepo).getUrl(), true);
// compare latest pom with the snapshot one
FileReader frdep = new FileReader(latestPom.getFile());
Model versionModel = new MavenXpp3Reader().read(frdep);
frdep.close();
for (Dependency snapshotVerDep : versionModel.getDependencies())
{
getLog().info(snapshotVerDep.getGroupId()+"."+snapshotVerDep.getArtifactId()+"-"+snapshotVerDep.getVersion()+"."+snapshotVerDep.getType());
}
getLog().info(" "+
d.getGroupId() + " : "
+ d.getArtifactId());
if (isVerbose)
{
Artifact latestPom = fileDownload(
createArtifact(d.getGroupId(),
d.getArtifactId(),
Artifact.SNAPSHOT_VERSION,
"pom"),
((ArtifactRepository) remoteRepo).getUrl(),
true);
// compare latest pom with the snapshot one
FileReader frdep = new FileReader(latestPom.getFile());
Model versionModel = new MavenXpp3Reader().read(frdep);
frdep.close();
for (Dependency snapshotVerDep : versionModel.getDependencies())
{
getLog().info(" "+
snapshotVerDep.getGroupId()
+ "."
+ snapshotVerDep.getArtifactId()
+ "-"
+ snapshotVerDep.getVersion()
+ "."
+ snapshotVerDep.getType());
}
 
}
}
}
}
}
catch (ArtifactNotFoundException e)
catch (ArtifactNotFoundException e)
{
getLog().info(
"Repository : "
+ ((ArtifactRepository) remoteRepo).getUrl());
getLog().info("No version found");
}
}
else
{
getLog().info("Repository : "+((ArtifactRepository)remoteRepo).getUrl());
getLog().info("No version found");
getLog().warn("Repository : "+remoteRepoId+" not declared in maven configuration");
}
 
}
/work-experiences/deployment/NovaCICTools/trunk/novadeploy-plugin/src/main/java/org/novaforge/novacic/novadeployplugin/packaging/UploadArtifactMojo.java
1,6 → 1,7
package org.novaforge.novacic.novadeployplugin.packaging;
 
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
102,6 → 103,13
* @optional
*/
private boolean snapshot;
/**
* @parameter expression="${multiplesVersions}" default-value="false"
* @optional
*/
private boolean bMultipleArtifactVersions;
 
/**
* @parameter expression="${keepFiles}" default-value="false"
189,7 → 197,8
{
Dependency d = i.next();
if (!d.getArtifactId().equals(dep.getArtifactId())
|| !d.getGroupId().equals(dep.getGroupId()))
|| !d.getGroupId().equals(dep.getGroupId())
|| (bMultipleArtifactVersions && !d.getVersion().equals(dep.getVersion())))
{
newDependencies.add(d);
}
236,6 → 245,7
{
getLog().info("Snapshot mode enabled : artifact may be overwritten!");
}
try
{
if (null != sVersionName)
250,7 → 260,8
}
if (false == snapshot && artifactExists(sTargetGroupId, sTargetArtifactId, sFileVersion, sFileExtension, getUrl()))
{
getLog().warn("Artifact: "+sTargetArtifactId+" already exists for version: "+sFileVersion+" artifact won't be updated");
getLog().error("Artifact: "+sTargetArtifactId+" already exists for version: "+sFileVersion+" artifact won't be updated");
throw new MojoFailureException("Artifact: "+sTargetArtifactId+" already exists for version: "+sFileVersion+" artifact won't be updated");
}
else
{
281,8 → 292,50
{
if (null == sFileExtension)
{
throw new MojoFailureException("If no file is specified, an artifact type must be specified (use option -Dtarget.extension=VALUE)");
String artifactExt = sFileExtension;
try
{
Artifact pomStoredArtifact = createArtifact(sTargetGroupId, sTargetArtifactId, sFileVersion, "pom");
if (null != getUrl())
{
resolveArtifactForOneRepository(pomStoredArtifact, getUrl());
}
else
{
pomStoredArtifact = resolveArtifact(createArtifact(sTargetGroupId, sTargetArtifactId, sFileVersion, "pom"));
}
FileReader fr = new FileReader(pomStoredArtifact.getFile());
Model model = new MavenXpp3Reader().read(fr);
artifactExt=model.getPackaging();
}
catch (ArtifactNotFoundException e)
{
getLog().error("The artifact \"" + sTargetGroupId +"." + sTargetArtifactId +"."+ sFileVersion +" does not exists");
throw new MojoFailureException("The artifact \"" + sTargetGroupId +"." + sTargetArtifactId +"."+ sFileVersion +" does not exists");
}
catch (ArtifactResolutionException e)
{
throw new MojoFailureException("The artifact \"" + sTargetGroupId +"." + sTargetArtifactId +"."+ sFileVersion +" cannot be resolved");
}
catch (FileNotFoundException e)
{
throw new MojoFailureException("Can not parse the \"" + sTargetGroupId +"." + sTargetArtifactId +"."+ sFileVersion + "\" pom file");
}
catch (IOException e)
{
throw new MojoFailureException("Can not parse the \"" + sTargetGroupId +"." + sTargetArtifactId +"."+ sFileVersion + "\" pom file");
}
catch (XmlPullParserException e)
{
throw new MojoFailureException("Can not parse the \"" + sTargetGroupId +"." + sTargetArtifactId +"."+ sFileVersion + "\" pom file");
}
sFileExtension=artifactExt;
}
if (null == sFileExtension)
{
getLog().error("Cannot automatically determine artifact type, either check repository integrity or force the artifact type using option -Dtarget.extension=VALUE");
throw new MojoFailureException("Cannot automatically determine artifact type, either check repository integrity or force the artifact type using option -Dtarget.extension=VALUE");
}
// add existing artifact to version, no use to give file in such case, but we must assert that artifact exists in repository
if (!artifactExists(sTargetGroupId, sTargetArtifactId, sFileVersion, sFileExtension, getUrl()))
{
/work-experiences/deployment/NovaCICTools/trunk/novadeploy-plugin/src/main/java/org/novaforge/novacic/novadeployplugin/packaging/DownloadVersion.java
10,8 → 10,13
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
61,12 → 66,19
private boolean forceUpdate;
 
/**
* @parameter expression="${recover}" default-value="false"
* @optional
*/
private boolean recover;
 
/**
* @parameter expression="${tempFile}" default-value="newVersionPom.xml"
* @optional
*/
private File fTempFile;
 
 
 
/**
* In the pattern the following arguments can be used, and will be replaced
* by the corresponding part
86,6 → 98,32
*/
private String sPathTemplate;
 
/**
* This pattern use the same args as {@link #sPathTemplate}
*
* When specified, any file matching the gin directories will be purged out if not deployed by that goal.
*
* @parameter expression="${target.pathToCleanUp}"
* @optional
*/
private String sPathToCleanUp;
 
/**
* This pattern use the same args as {@link #sPathTemplate}
*
* When specified, only directories matching that pattern will be cleaned, else, the contained files are preserved.
*
* @parameter expression="${target.cleanUpPathFilter}"
* @optional
*/
private String sCleanUpFilter;
/**
*
*/
private String sCompiledCleanUpFilter=null;
 
private Model model;
 
/**
95,11 → 133,11
* @param sExtension
* @return
*/
private String replaceMarkers(final String sVersion, final String sGroupId,final String sArtifactGroupId, final String sArtifactId, final String sArtifactVersion, final String sExtension)
private String replaceMarkers(final String sPattern, final String sVersion, final String sGroupId,final String sArtifactGroupId, final String sArtifactId, final String sArtifactVersion, final String sExtension)
{
Matcher matcher;
Pattern pattern;
String buffer = sPathTemplate;
String buffer = sPattern;
 
// System.out.println("Provided string : " + sPathTemplate);
 
162,35 → 200,104
 
}
 
private static void copyFile(final File in, final File out) throws IOException
private static String getMD5 (final File fileToHash)
throws IOException, MojoFailureException
{
FileInputStream fis = new FileInputStream(in);
FileOutputStream fos = new FileOutputStream(out);
try
{
byte[] buf = new byte[1024];
int i = 0;
while ((i = fis.read(buf)) != -1)
{
fos.write(buf, 0, i);
}
}
catch (IOException e)
{
throw e;
}
finally
{
if (fis != null)
{
fis.close();
}
if (fos != null)
{
fos.close();
}
}
String rSum ="";
InputStream hashStream = null;
try
{
hashStream = new FileInputStream(fileToHash);
byte[] buffer = new byte[1024];
MessageDigest complete = MessageDigest.getInstance("MD5");
int readLength;
do
{
readLength = hashStream.read(buffer);
if (readLength > 0)
{
complete.update(buffer, 0, readLength);
}
}
while (readLength != -1);
byte[] sum = complete.digest();
StringBuilder sb = new StringBuilder(sum.length*2);
for (byte b : sum) {
sb.append( String.format("%x", b) );
}
rSum = sb.toString();
}
catch (FileNotFoundException e)
{
throw new MojoFailureException("Cannot compute "+fileToHash+" MD5 sum",e);
}
catch (NoSuchAlgorithmException e)
{
throw new MojoFailureException("Internal error, cannot use MD5 algorithm",e);
}
finally
{
if (null != hashStream) { try {hashStream.close();} catch (IOException e) {/*nothing to do with */}}
}
return rSum;
}
private void copyFile(final File in, final File out, boolean keepOnSameSum)
throws IOException, MojoFailureException
{
String sumIn="int";
String sumOut="out";
if (keepOnSameSum)
{
if (in.exists())
{
sumIn= getMD5(in);
}
if (out.exists())
{
sumOut= getMD5(out);
}
}
if (sumIn.compareTo(sumOut) != 0)
{
getLog().info("Copying file: "+out.getName());
FileInputStream fis = new FileInputStream(in);
FileOutputStream fos = new FileOutputStream(out);
try
{
byte[] buf = new byte[1024];
int i = 0;
while ((i = fis.read(buf)) != -1)
{
fos.write(buf, 0, i);
}
}
catch (IOException e)
{
throw e;
}
finally
{
if (fis != null)
{
fis.close();
}
if (fos != null)
{
fos.close();
}
}
}
}
 
/*
* (non-Javadoc)
205,7 → 312,29
{
throw new MojoFailureException("Parameter URL (-Durl=VALUE) is mandatory for that goal");
}
if (null != sPathToCleanUp)
{
// assert that we are not on "/"
if ("/".compareTo(sPathToCleanUp) == 0 || ".".compareTo(sPathToCleanUp) ==0)
{
throw new MojoFailureException("\"/\" ou \".\" are not legal filter options");
}
// assert that filter pattern is part of pattern
if (!sPathTemplate.startsWith(sPathToCleanUp))
{
throw new MojoFailureException("Filter can only be part of of output path");
}
}
 
if (!isVersionReferencedInCustomArtifact(sTargetGroupId, sTargetArtifactId, getUrl()) && !recover)
{
getLog().error("Required version is no more refrenced, try with -recover option");
throw new MojoFailureException("Required version is no more refrenced, try with -recover option");
}
try
{
// get the pom.xml for the requested version
229,6 → 358,8
model = new MavenXpp3Reader().read(fr);
fr.close();
// download all dependencies of the version
HashMap<File, LinkedList<String>> proceededFiles = new HashMap<File, LinkedList<String>>();
for (Dependency d : model.getDependencies())
{
getLog().debug(
237,26 → 368,48
+ d.getVersion() + ":" + d.getType());
Artifact artifact = createArtifact(d.getGroupId(), d.getArtifactId(), d.getVersion(),d.getType());
artifact = fileDownload(artifact, getUrl(), forceUpdate);
String sFileName = replaceMarkers(
String sFileName = replaceMarkers(sPathTemplate,
pomVersion.getArtifactId(), sTargetGroupId, d.getGroupId(),
d.getArtifactId(), d.getVersion(), d.getType());
File f = new File(sFileName);
getLog().debug("FileName : " + f.getAbsolutePath());
File dir = new File(f.getParent());
if ((dir.isDirectory() && dir.canWrite())
|| (dir.mkdirs() == true))
{
copyFile(artifact.getFile(), f);
getLog().info(
"Retrieved file : " + f.getName() + " => "
+ f.getCanonicalPath());
copyFile(artifact.getFile(), f, !forceUpdate);
if (null != sPathToCleanUp)
{
String filterPath = replaceMarkers(sPathToCleanUp,
pomVersion.getArtifactId(), sTargetGroupId, d.getGroupId(),
d.getArtifactId(), d.getVersion(), d.getType());
LinkedList<String> target = proceededFiles.get(new File (filterPath));
if (null == target)
{
target = new LinkedList<String>();
proceededFiles.put(new File(filterPath), target);
}
target.add(f.toString());
}
getLog().info("Retrieved file : " + f.getName() + " => "+ f.getCanonicalPath());
}
else
{
throw new MojoFailureException("Can't create directory : "
+ dir.getCanonicalPath());
throw new MojoFailureException("Can't create directory : "+ dir.getCanonicalPath());
}
}
if (null != sPathToCleanUp)
{
for (File dir: proceededFiles.keySet())
{
getLog().info("Applying cleaning phase to : "+dir);
searchDirToClean(dir, proceededFiles.get(dir));
}
}
incrementVersionPom(pomVersion);
}
}
286,7 → 439,73
}
}
 
/**
private void searchDirToClean(File aDir, LinkedList<String> aKnownFileList)
{
if (null == sCompiledCleanUpFilter)
{
if ( null != sCleanUpFilter)
{
sCompiledCleanUpFilter = replaceMarkers(sCleanUpFilter, sTargetArtifactId, "", "", "", "", "");
sCompiledCleanUpFilter = ".*/"+sCompiledCleanUpFilter+"/.*";
}
else
{
sCompiledCleanUpFilter=".*";
}
}
getLog().info("Cleaning directory: "+aDir+"/ filter : "+sCompiledCleanUpFilter + " match ?: "+(aDir.toString()+"/").matches(sCompiledCleanUpFilter));
if ((aDir.toString()+"/").matches(sCompiledCleanUpFilter))
{
cleanDir(aDir, aKnownFileList);
}
else
{
for (File nextOne : aDir.listFiles())
{
if (nextOne.isDirectory())
{
searchDirToClean(nextOne, aKnownFileList);
}
}
}
}
/**
* @param aDir
* @param aPrefix
* @param aKnownFileList
*/
private void cleanDir(File aDir, LinkedList<String> aKnownFileList)
{
getLog().info("Cleaning directory: "+aDir);
for (File toProceed : aDir.listFiles())
{
if (toProceed.isFile())
{
if (!aKnownFileList.contains(toProceed.toString()))
{
getLog().info("deleting file: "+toProceed);
if (! toProceed.delete())
{
getLog().error("Cannot delete: "+toProceed);
}
}
}
else
{
cleanDir(toProceed,aKnownFileList );
}
}
if (aDir.listFiles().length == 0)
{
getLog().info("Removing empty directory: "+aDir);
if (!aDir.delete())
{
getLog().error("Cannot delete: "+aDir);
}
}
}
 
/**
* @param pomVersion
* @throws ArtifactMetadataRetrievalException
* @throws MojoFailureException
/work-experiences/deployment/NovaCICTools/trunk/novadeploy-plugin/src/main/java/org/novaforge/novacic/novadeployplugin/packaging/CreateVersionMojo.java
65,6 → 65,12
private String sArtifactIdForVersionName;
 
/**
* @parameter expression="${newVersionName}"
* @optional
*/
private String sArtifactIdForNewVersionName;
/**
* @parameter expression="${tempFile}" default-value="tmpCreateVersionPom.xml"
* @optional
*/
169,15 → 175,26
throw new MojoFailureException("Parameter URL (-Durl=VALUE) is mandatory for that goal");
}
 
if (artifactExists(sTargetGroupId, sArtifactIdForVersionName, Artifact.SNAPSHOT_VERSION, "pom", getUrl()))
if (null != sArtifactIdForNewVersionName && false == bFromSnapshot)
{
throw new MojoFailureException("Parameter newVersionName is not allowed if not in fromSnapshot mode");
}
String artifactIdDestVersion = sArtifactIdForVersionName;
if (null != sArtifactIdForNewVersionName)
{
artifactIdDestVersion=sArtifactIdForNewVersionName;
}
if (artifactExists(sTargetGroupId, artifactIdDestVersion, Artifact.SNAPSHOT_VERSION, "pom", getUrl()))
{
//previous version already exists, check if it's indexed (else, it has been remove -see removeVersion goal-)
if (isVersionReferencedInCustomArtifact(sTargetGroupId,sArtifactIdForVersionName,getUrl()))
if (isVersionReferencedInCustomArtifact(sTargetGroupId,artifactIdDestVersion,getUrl()))
{
getLog().error("Version already registered, version overwritting is forbidden");
throw new MojoFailureException("Version already registered, version overwritting is forbidden");
}
}
try
{
if (true == bFromSnapshot)
187,11 → 204,13
throw new MojoFailureException("Missing the snapshot repository URL");
}
getLog().info("You are creating this version from a snapshot");
// download the artifact containing the version to duplicate
Artifact artifact = fileDownload(createArtifact(sTargetGroupId, sArtifactIdForVersionName, Artifact.SNAPSHOT_VERSION, "pom"), sSnapshotURL, true);
if (artifactExists(artifact, getUrl()))
// chack that the destination version is not used
if (artifactExists(createArtifact(sTargetGroupId, artifactIdDestVersion, Artifact.SNAPSHOT_VERSION, "pom"), getUrl()))
{
//previous version already exists, check if it's indexed (else, it has been remove -see removeVersion goal-)
if (isVersionReferencedInCustomArtifact(sTargetGroupId,sArtifactIdForVersionName,getUrl()))
if (isVersionReferencedInCustomArtifact(sTargetGroupId,artifactIdDestVersion,getUrl()))
{
getLog().error("Version already registered, version overwritting is forbidden");
throw new MojoFailureException("Version already registered, version overwritting is forbidden");
201,8 → 220,20
model = new MavenXpp3Reader().read(fr);
fr.close();
dependenciesUpload();
addVersionToCustomArtifact(sTargetGroupId, sArtifactIdForVersionName, getUrl());
fileUpload(artifact.getFile(), artifact, getUrl(), false);
// if needed create a new model to rename
if (null != sArtifactIdForNewVersionName)
{
model.setArtifactId(sArtifactIdForNewVersionName);
FileWriter fw = new FileWriter(fTempFile);
new MavenXpp3Writer().write(fw, model);
fw.close();
fileUpload(fTempFile, sTargetGroupId, sArtifactIdForNewVersionName, "pom", Artifact.SNAPSHOT_VERSION, getUrl(), false);
}
else
{
fileUpload(artifact.getFile(), artifact, getUrl(), false);
}
addVersionToCustomArtifact(sTargetGroupId, artifactIdDestVersion, getUrl());
}
else
{
/work-experiences/deployment/NovaCICTools/trunk/novadeploy-plugin/src/main/java/org/novaforge/novacic/novadeployplugin/packaging/RemoveArtifactMojo.java
96,6 → 96,12
*/
private String targetVersion;
 
/**
* @parameter expression="${multiplesVersions}" default-value="false"
* @optional
*/
private boolean bMultipleArtifactVersions;
 
private Artifact pomParent;
private Model pomParentModel;
 
144,15 → 150,26
LinkedList<Dependency> newDependencies = new LinkedList<Dependency>();
getLog().debug("Dependencies (before):\n\t" + dependencies);
ListIterator<Dependency> i = dependencies.listIterator();
boolean hasRemovedSomething=false;
while (i.hasNext())
{
Dependency d = i.next();
if (!d.getArtifactId().equals(dep.getArtifactId())
|| !d.getGroupId().equals(dep.getGroupId()))
|| !d.getGroupId().equals(dep.getGroupId())
|| (bMultipleArtifactVersions && !d.getVersion().equals(dep.getVersion())))
{
newDependencies.add(d);
}
else
{
hasRemovedSomething=true;
}
}
if (!hasRemovedSomething)
{
getLog().warn("No artifat matches "+ dep.getGroupId()+"."+dep.getArtifactId()+"-"+dep.getVersion()+". Dependencies are not modified.");
}
pomParentModel.setDependencies(newDependencies);
getLog().debug("Dependencies (after):\n\t" + pomParentModel.getDependencies());
}