RE: Problem with Current Working Directory
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 > $MAVEN_HOME/plugins/maven-checkstyle-plugin/plugin-resources/c > heckstyle.jsl> >value="${pom.build.sourceDirectory}"/> > value="${fileutil.file(fullSrcDir).getAbsolutePath()}"/> > > > > > >value="${file.attribute('name').getValue()}"/> >value="${name.substring(mavenTool.toInteger(srcDirLength.toStr > ing()))}"/> >oldChar="\\" newChar="/"/> > >select="count($file/error)"/> > > > > > ${name} > >string="${errorCount}" pattern="0"/> > > > > > > > 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 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]
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 > $MAVEN_HOME/plugins/maven-checkstyle-plugin/plugin-resources/c > heckstyle.jsl> >value="${pom.build.sourceDirectory}"/> > value="${fileutil.file(fullSrcDir).getAbsolutePath()}"/> > > > > > >value="${file.attribute('name').getValue()}"/> >value="${name.substring(mavenTool.toInteger(srcDirLength.toStr > ing()))}"/> >oldChar="\\" newChar="/"/> > >select="count($file/error)"/> > > > > > ${name} > >string="${errorCount}" pattern="0"/> > > > > > > > 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 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] >
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 ${name} 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 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]
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 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
RE: Problem with Current Working Directory
Brett, Thank you for your answer. I use beta-10. >Can you confirm that calling 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 would assume that after invocation of jvm returns to the ${basedir} and not stays in "somedir". Thank you for you time. P.S. Can any one explain this problem more understandable, so that it can be added to jira. --Alexey -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 3:37 PM To: 'Maven Users List' Subject: RE: Problem with Current Working Directory What version of Maven? As of RC1, ${pom.build.sourceDirectory} is an absolute path already. Can you confirm that calling 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. - Brett > -Original Message- > From: Alexey Krasnoriadtsev > [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 7 October 2003 3:02 AM > To: 'Maven Users List' (E-mail) > Subject: Problem with Current Working Directory > > > > Hi All, > > I am not familiar with Maven internals, and was wondering if > any one can explain me the issue (and possible solution) that > I'm experiencing. > > After the invoking ant from a different directory, maven > "stays" there. And when > org.apache.velocity.texen.util.FileUtil is used with relative > path, the file is created in the directory where ant was > invoked from, not the ${basedir} > > Why is it a problem for me? > Well, fileutil.file(fullSrcDir).getAbsolutePath() is used on > checkstyle and PMD to determine the package names, and create > broken links, because of the wrong directory. Here is some > code to back it up: > > Maven.xml > > > src.ant.dir -- ${src.ant.dir} > target="clean" /> > > base ${basedir} > > full ${fullSrcDir} > value="${fileutil.file(fullSrcDir).getAbsolutePath()}"/> > srcDir = ${srcDir} > > value="${fileutil.file(curr).getAbsolutePath()}" /> > Current Dir -- ${dir} > > > > [echo] src.ant.dir -- /export/home/bp/projects/cs/src/ant > [echo] base /export/home/bp/projects/cs > [echo] full src/java > [echo] srcDir = /export/home/bp/projects/cs/src/ant/src/java > [echo] Current Dir -- /export/home/bp/projects/cs/src/ant/. > [echo] Site > BUILD SUCCESSFUL > > > > Alex Krasnoriadtsev > Application Development > 408-964-1564 > > > - > 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]
RE: Problem with Current Working Directory
What version of Maven? As of RC1, ${pom.build.sourceDirectory} is an absolute path already. Can you confirm that calling 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. - Brett > -Original Message- > From: Alexey Krasnoriadtsev > [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 7 October 2003 3:02 AM > To: 'Maven Users List' (E-mail) > Subject: Problem with Current Working Directory > > > > Hi All, > > I am not familiar with Maven internals, and was wondering if > any one can explain me the issue (and possible solution) that > I'm experiencing. > > After the invoking ant from a different directory, maven > "stays" there. And when > org.apache.velocity.texen.util.FileUtil is used with relative > path, the file is created in the directory where ant was > invoked from, not the ${basedir} > > Why is it a problem for me? > Well, fileutil.file(fullSrcDir).getAbsolutePath() is used on > checkstyle and PMD to determine the package names, and create > broken links, because of the wrong directory. Here is some > code to back it up: > > Maven.xml > > > src.ant.dir -- ${src.ant.dir} > target="clean" /> > > base ${basedir} > > full ${fullSrcDir} > value="${fileutil.file(fullSrcDir).getAbsolutePath()}"/> > srcDir = ${srcDir} > > value="${fileutil.file(curr).getAbsolutePath()}" /> > Current Dir -- ${dir} > > > > [echo] src.ant.dir -- /export/home/bp/projects/cs/src/ant > [echo] base /export/home/bp/projects/cs > [echo] full src/java > [echo] srcDir = /export/home/bp/projects/cs/src/ant/src/java > [echo] Current Dir -- /export/home/bp/projects/cs/src/ant/. > [echo] Site > BUILD SUCCESSFUL > > > > Alex Krasnoriadtsev > Application Development > 408-964-1564 > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >