maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim McCaskey <jim.mccas...@pervasive.com>
Subject RE: project.build.directory not set properly for ant
Date Fri, 13 Mar 2009 23:37:24 GMT
Hello,

I did not hear from anyone regarding this so assumed no one has seen it.  I went ahead and
opened a bug for it a couple of days ago:

http://jira.codehaus.org/browse/MNG-4083

It occurred to me that I should post this to the list in case someone searches and sees this
problem, they will know what happened with it.  Sorry for the noise.

-Jim

-----Original Message-----
From: Jim McCaskey [mailto:jim.mccaskey@pervasive.com] 
Sent: Tuesday, March 10, 2009 12:53 PM
To: 'users@maven.apache.org'
Subject: project.build.directory not set properly for ant

Hello,

We are currently using Maven 2.0.7 and I am working on upgrading us to Maven 2.0.10.  I ran
into a problem which I think is in maven-antrun-plugin, but can't be sure.

I do not think it is interpreting ${project.build.directory} properly. In a lot of our POM's
we override the output directories to shovel stuff out of the source directory.  I stripped
down a pom to show the problem below.  Where I have the ant echo's below, we would typically
do "other things", but those things are breaking because the ${project.build.directory} is
incorrectly set.  

As you can see from my test output below, 2.0.7 and 2.0.8 work fine, but starting with 2.0.9
and carried over to 2.0.10 things don't work so well.  It looks like it is prepending ${basedir}
even though we don't want that.  

I should also note that the output is going where I expect.  In other words all the .class
and .jar files are being pushed out to the E:\obj directory as my pom specifies.  It's just
within ant that the values don't seem correct.

I tried searching Jira for any problems like this, and found some that are around this area.
 This one for example seems to have some similarity, but not exactly (and it's resolution
seems to be in the Maven 2.1 code):

http://jira.codehaus.org/browse/MNG-3475

A work around is obviously just to hand roll the paths we need, but I wanted to see if this
change in behavior was intentional. Am I doing something wrong or should I just open a bug
for this?

-Jim

Test POM:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>test</artifactId>
  <packaging>jar</packaging>
  <version>1.0.0</version>
  <name>Foo</name>
  <properties>
    <djobj>E:\obj</djobj>
  </properties>
  <build>
    <defaultGoal>package</defaultGoal>
    <outputDirectory>${djobj}/${project.artifactId}/classes</outputDirectory>
    <testOutputDirectory>${djobj}/${project.artifactId}/test-classes</testOutputDirectory>
    <directory>${djobj}/${project.artifactId}</directory>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <configuration>
              <tasks>
                <echo message="Debug data"/>
                <echo message="basedir                             = ${basedir}"/>
                <echo message="djobj                               = ${djobj}"/>
                <echo message="project.build.sourceDirectory       = ${project.build.sourceDirectory}"/>
                <echo message="project.build.scriptSourceDirectory = ${project.build.scriptSourceDirectory}"/>
                <echo message="project.build.testSourceDirectory   = ${project.build.testSourceDirectory}"/>
                <echo message="project.build.outputDirectory       = ${project.build.outputDirectory}"/>
                <echo message="project.build.testOutputDirectory   = ${project.build.testOutputDirectory}"/>
                <echo message="project.build.directory             = ${project.build.directory}"/>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>



Test output:

Maven 2.0.7

[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
     [echo] Debug data
     [echo] basedir                             = E:\foo
     [echo] djobj                               = E:\obj
     [echo] project.build.sourceDirectory       = E:\foo\src\main\java
     [echo] project.build.scriptSourceDirectory = src/main/scripts
     [echo] project.build.testSourceDirectory   = E:\foo\src\test\java
     [echo] project.build.outputDirectory       = E:\obj/test/classes
     [echo] project.build.testOutputDirectory   = E:\obj/test/test-classes
     [echo] project.build.directory             = E:\obj/test
[INFO] Executed tasks

Maven 2.0.8

[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
     [echo] Debug data
     [echo] basedir                             = E:\foo
     [echo] djobj                               = E:\obj
     [echo] project.build.sourceDirectory       = E:\foo\src\main\java
     [echo] project.build.scriptSourceDirectory = src/main/scripts
     [echo] project.build.testSourceDirectory   = E:\foo\src\test\java
     [echo] project.build.outputDirectory       = E:\obj/test/classes
     [echo] project.build.testOutputDirectory   = E:\obj/test/test-classes
     [echo] project.build.directory             = E:\obj/test
[INFO] Executed tasks

Maven 2.0.9

[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
     [echo] Debug data
     [echo] basedir                             = E:\foo
     [echo] djobj                               = E:\obj
     [echo] project.build.sourceDirectory       = E:\foo\src\main\java
     [echo] project.build.scriptSourceDirectory = src/main/scripts
     [echo] project.build.testSourceDirectory   = E:\foo\src\test\java
     [echo] project.build.outputDirectory       = E:\foo\E:\obj\test\classes
     [echo] project.build.testOutputDirectory   = E:\foo\E:\obj\test\test-classes
     [echo] project.build.directory             = E:\foo\E:\obj\test
[INFO] Executed tasks

Maven 2.0.10

[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
     [echo] Debug data
     [echo] basedir                             = E:\foo
     [echo] djobj                               = E:\obj
     [echo] project.build.sourceDirectory       = E:\foo\src\main\java
     [echo] project.build.scriptSourceDirectory = src/main/scripts
     [echo] project.build.testSourceDirectory   = E:\foo\src\test\java
     [echo] project.build.outputDirectory       = E:\foo\E:\obj\test\classes
     [echo] project.build.testOutputDirectory   = E:\foo\E:\obj\test\test-classes
     [echo] project.build.directory             = E:\foo\E:\obj\test
[INFO] Executed tasks



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message