From 89423d23dee868578a371abce4b39f0b7811ee3c Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 1 Apr 2005 01:01:20 +0000 Subject: [PATCH] fix for windows, add profiling if needed git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163735 13f79535-47bb-0310-9956-ffa450edef68 --- sandbox/repoclean/src/main/bash/repoclean.sh | 11 ++++++++++- .../repoclean/discover/LegacyArtifactDiscoverer.java | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sandbox/repoclean/src/main/bash/repoclean.sh b/sandbox/repoclean/src/main/bash/repoclean.sh index f875599c5a..40da34437b 100644 --- a/sandbox/repoclean/src/main/bash/repoclean.sh +++ b/sandbox/repoclean/src/main/bash/repoclean.sh @@ -19,4 +19,13 @@ if [ $cygwin ]; then CP=`cygpath -pw $CP` fi -java -classpath ${CP} org.apache.maven.tools.repoclean.Main $* | tee repoclean-log.txt +JAVA_OPTS="" + +if [ "$1" == "profile" ]; then + JAVA_OPTS="-agentlib:yjpagent=onexit=memory" + # You need to customise this path for your environment + export PATH=$PATH:/usr/local/yourkit/bin/win32 + shift +fi + +java $JAVA_OPTS -classpath ${CP} org.apache.maven.tools.repoclean.Main $* | tee repoclean-log.txt diff --git a/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java b/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java index a48b5755c8..b3f3a480d7 100644 --- a/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java +++ b/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java @@ -68,7 +68,7 @@ public class LegacyArtifactDiscoverer private Artifact buildArtifact( String path, Reporter reporter ) throws Exception { - StringTokenizer tokens = new StringTokenizer( path, "/" ); + StringTokenizer tokens = new StringTokenizer( path, "/\\" ); int numberOfTokens = tokens.countTokens();