It works in RC1. Thank you. -----Original Message----- From: Brett Porter [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 5:16 PM To: 'Maven Users List' Subject: RE: Problem with Current Working Directory
Ok, now I've got it. If this is still a problem in RC1, let me know. I believe I removed this behaviour when I fixed the ${basedir} problems, but am not entirely sure. Thanks, Brett > -----Original Message----- > From: Alexey Krasnoriadtsev > [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 7 October 2003 10:10 AM > To: 'Maven Users List' > Subject: RE: Problem with Current Working Directory > > > I will try RC1 > > >Can you try RC1, and remove the use of FileUtil? > >Pom.build.sourceDirectory > should be absolute already, and you can use the > maven:makeAbsolutePath tag to do this otherwise. > > I don't actually use it directly. Both checkstyle and PMD plugins use > FileUtil to parse the dir structure (absolute.path.of.file - > absolute.path.of.src.java) to produce the package names and > create links to the files. But because I call ant before the > site (to check out the latest source, as we do not use cvs) > the absolute.path.of.src.java becomes invalid and therefore > all the links in checkstyle report and PMD report are broken. > > here is how checkstyle uses FileUtil > <snip from > $MAVEN_HOME/plugins/maven-checkstyle-plugin/plugin-resources/c > heckstyle.jsl> > <j:set var="fullSrcDir" > value="${pom.build.sourceDirectory}"/> > <j:set var="srcDir" > value="${fileutil.file(fullSrcDir).getAbsolutePath()}"/> > <j:set var="srcDirLength" value="${srcDir.length() + 1}"/> > <x:set var="files" select="file"/> > <!-- x:forEach is busted --> > <j:forEach var="file" items="${files}"> > <!-- Type coercion doesn't work worth a fuck in > jexl. --> > <j:set var="name" > value="${file.attribute('name').getValue()}"/> > <j:set var="name" > value="${name.substring(mavenTool.toInteger(srcDirLength.toStr > ing()))}"/> > <util:replace var="name" value="${name}" > oldChar="\\" newChar="/"/> > <!--- +1 is for the trailing slash above --> > <j:set var="errorCount"><x:expr > select="count($file/error)"/></j:set> > > <j:if test="${errorCount != 0}"> > <tr> > <td> > <a href="#${name}">${name}</a> > </td> > <td><doc:formatAsNumber > string="${errorCount}" pattern="0"/></td> > </tr> > </j:if> > </j:forEach> > </snip> > > > Thank you. > > --Alexey > > -----Original Message----- > From: Brett Porter [mailto:[EMAIL PROTECTED] > Sent: Monday, October 06, 2003 4:57 PM > To: 'Maven Users List' > Subject: RE: Problem with Current Working Directory > > > > Brett, > > Thank you for your answer. > > > > I use beta-10. > > Can you try RC1, and remove the use of FileUtil? > Pom.build.sourceDirectory should be absolute already, and you > can use the maven:makeAbsolutePath tag to do this otherwise. > > > >Can you confirm that calling <ant /> changes ${basedir} > > itself? If so, > > >file > > a bug in JIRA - my guess is if this is happening, that they > > both use a system property and ant scrogs maven's value. > > > > that's the point, ${basedir} is not changed, but the CWD > > (current working > > dir) of jvm is changed, so that when > > in org.apache.velocity.texen.util.FileUtil creates new file > > with relative > > path: > > new File(relativePath);, the file is created not in the > > ${basedir}, but in the dir from where the ant was invoked. > > I don't see how the JVM CWD can be changed, unless user.dir > is being modified. But this only affects things that use > user.dir, not the actual CWD which is a real nuisance. This > sounds as if it is a problem in ant though and beyond what > Maven can fix. Happy to be told otherwise if I am wrong here. > > Can you output ${systemScope.getVariable('user.dir')} before > and after to confirm it changes? > > Cheers, > Brett > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]