jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-4083

project.build.directory not set properly for plugins

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 2.0.9, 2.0.10
  • Fix Version/s: None
  • Component/s: Settings
  • Labels:
    None
  • Environment:
    Windows XP
  • Complexity:
    Intermediate
  • Testcase included:
    yes

Description

Maven 2.0.9 and above do not seem to set project.build.directory properly in down stream plugins. I have the below test case that shows the problem in the ant plugin, but I have also seen in in the javadoc plugin. Below is my test case and the results as seen from 2.0.7, 2.0.8, 2.0.9, and 2.0.10.

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

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNG-3747 relative build paths are not path-translated when using prefixed expressions (eg. project.build.directory) in plugin configurations

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Brett Porter
    Reporter:
    Jim McCaskey
Vote (0)
Watch (2)

Dates

  • Created:
    11/Mar/09 4:05 PM
    Updated:
    22/Mar/09 11:57 PM
    Resolved:
    22/Mar/09 11:57 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.