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-2220

${pom.build.sourceDirectory} and ${pom.build.testSourceDirectory} no longer recognized

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 2.0.4
  • Fix Version/s: None
  • Component/s: POM
  • Labels:
    None
  • Environment:
    n/a
  • Complexity:
    Intermediate
  • Testcase included:
    yes

Description

The properties ${pom.build.sourceDirectory} and ${pom.build.testSourceDirectory} (and perhaps others as well) are no longer recognized in pom.xml. The following pom fragment had the desired effect of copying resources from the sourceDirectory in version 2.0.3, but doesn't work in 2.0.4:

<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>src-test</testSourceDirectory>
<resources>
<resource>
<directory>${pom.build.sourceDirectory}</directory>
<includes>
<include>*/.properties</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>${pom.build.testSourceDirectory}</directory>
<includes>
<include>**/mockfiles/</include>
</includes>
</testResource>
</testResources>

The attached project will fail on a 'mvn test' under maven 2.0.4 and succeed under 2.0.3

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    buglet.zip
    11/Apr/06 6:22 AM
    1 kB
    Marcel Schutte
    1. XML File
      buglet/pom.xml 1 kB
    2. File
      buglet/src/src.properties 0.0 kB
    3. Java Source File
      buglet/src-test/BugletTest.java 0.5 kB
    4. File
      buglet/src-test/test.properties 0.0 kB
    Download Zip
    Show
    Zip Archive
    buglet.zip
    11/Apr/06 6:22 AM
    1 kB
    Marcel Schutte

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNG-3355 CLONE -${pom.build.sourceDirectory} and ${pom.build.testSourceDirectory} no longer recognized

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

Bug - A problem which impairs or prevents the functions of the product. MNG-2223 Interpolation in resources section appears not to work correctly

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

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Brett Porter added a comment - 11/Apr/06 10:39 PM

what about ${project.*} ?

Show
Brett Porter added a comment - 11/Apr/06 10:39 PM what about ${project.*} ?
Hide
Permalink
John Casey added a comment - 12/Apr/06 11:10 AM

I've verified this issue using ${pom.*} and ${project.*}. It seems that this problem was fixed in 2.0.3, then regressed in 2.0.4, when we fixed the other issues with path alignment of interpolated values (the context stuff in the project builder).

Show
John Casey added a comment - 12/Apr/06 11:10 AM I've verified this issue using ${pom.*} and ${project.*}. It seems that this problem was fixed in 2.0.3, then regressed in 2.0.4, when we fixed the other issues with path alignment of interpolated values (the context stuff in the project builder).
Hide
Permalink
Brett Porter added a comment - 12/Apr/06 5:45 PM

yes, I think Jason established the same in MNG-2223. Are these dupes?

Show
Brett Porter added a comment - 12/Apr/06 5:45 PM yes, I think Jason established the same in MNG-2223. Are these dupes?
Hide
Permalink
Jason van Zyl added a comment - 05/Jun/07 12:04 AM

This was fixed long ago.

Show
Jason van Zyl added a comment - 05/Jun/07 12:04 AM This was fixed long ago.
Hide
Permalink
Venelin Mitov added a comment - 07/Jan/08 5:12 AM

Hello All,

I used the attached buglet.zip project to reproduce the problem on versions 2.0.5, 2.0.7 and 2.0.8 of maven. Here is the output I got when executing mvn clean test.

$ /cygdrive/c/maven/maven-2.0.8/bin/mvn clean test
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - maven:buglet:jar:01.01-SNAPSHOT
[INFO] task-segment: [clean, test]
[INFO] ------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-clean-plugin: checking for updates from internal
[INFO] [clean:clean]
[INFO] Deleting directory c:\adhoc\buglet\target
[INFO] Deleting directory c:\adhoc\buglet\target\classes
[INFO] Deleting directory c:\adhoc\buglet\target\test-classes
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from internal
[INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for updates from internal
[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from internal
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to c:\adhoc\buglet\target\test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: c:\adhoc\buglet\target\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running BugletTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.187 sec <<< FAILURE!

Results :

Tests in error:
testOne(BugletTest)

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Mon Jan 07 11:43:01 CET 2008
[INFO] Final Memory: 6M/13M
[INFO] ------------------------------------------------------------------------

And this is the test error:

mitovv@GM02442 /cygdrive/c/adhoc/buglet
$ less target/surefire-reports/*.txt
-------------------------------------------------------------------------------
Test set: BugletTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.109 sec <<< FAILURE!
testOne(BugletTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:74)
at java.io.InputStreamReader.<init>(InputStreamReader.java:118)
at java.util.Properties.load(Properties.java:298)
at BugletTest.testOne(BugletTest.java:10)
at BugletTest.testOne(BugletTest.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)

This is the jvm I use:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM Windows 32 build cn142-20060421 (SR5) (JIT enabled: jitc))

Kind regards,
Venelin Mitov

Show
Venelin Mitov added a comment - 07/Jan/08 5:12 AM Hello All, I used the attached buglet.zip project to reproduce the problem on versions 2.0.5, 2.0.7 and 2.0.8 of maven. Here is the output I got when executing mvn clean test. $ /cygdrive/c/maven/maven-2.0.8/bin/mvn clean test [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Unnamed - maven:buglet:jar:01.01-SNAPSHOT [INFO] task-segment: [clean, test] [INFO] ------------------------------------------------------------------------ [INFO] artifact org.apache.maven.plugins:maven-clean-plugin: checking for updates from internal [INFO] [clean:clean] [INFO] Deleting directory c:\adhoc\buglet\target [INFO] Deleting directory c:\adhoc\buglet\target\classes [INFO] Deleting directory c:\adhoc\buglet\target\test-classes [INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from internal [INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for updates from internal [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from internal [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] [INFO] Compiling 1 source file to c:\adhoc\buglet\target\test-classes [INFO] [surefire:test] [INFO] Surefire report directory: c:\adhoc\buglet\target\surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running BugletTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.187 sec <<< FAILURE! Results : Tests in error: testOne(BugletTest) Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] There are test failures. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7 seconds [INFO] Finished at: Mon Jan 07 11:43:01 CET 2008 [INFO] Final Memory: 6M/13M [INFO] ------------------------------------------------------------------------ And this is the test error: mitovv@GM02442 /cygdrive/c/adhoc/buglet $ less target/surefire-reports/*.txt ------------------------------------------------------------------------------- Test set: BugletTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.109 sec <<< FAILURE! testOne(BugletTest) Time elapsed: 0 sec <<< ERROR! java.lang.NullPointerException at java.io.Reader.<init>(Reader.java:74) at java.io.InputStreamReader.<init>(InputStreamReader.java:118) at java.util.Properties.load(Properties.java:298) at BugletTest.testOne(BugletTest.java:10) at BugletTest.testOne(BugletTest.java:10) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125) at org.apache.maven.surefire.Surefire.run(Surefire.java:132) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818) This is the jvm I use: Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2) Classic VM (build 1.4.2, J2RE 1.4.2 IBM Windows 32 build cn142-20060421 (SR5) (JIT enabled: jitc)) Kind regards, Venelin Mitov

People

  • Assignee:
    Unassigned
    Reporter:
    Marcel Schutte
Vote (0)
Watch (0)

Dates

  • Created:
    11/Apr/06 6:22 AM
    Updated:
    28/Nov/08 4:33 PM
    Resolved:
    02/Aug/07 12:34 AM
  • 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.