Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added missing stuff.

  • Loading branch information...
commit 98306fbd02afec7510815b8634702554c1a38c54 1 parent d1491e8
@jakewins jakewins authored
Showing with 1,818 additions and 37 deletions.
  1. +2 −37 .gitignore
  2. +285 −0 src/functionaltest/testprojects/attachChangelogTest/build.log
  3. +94 −0 src/functionaltest/testprojects/attachChangelogTest/combineProject/build.log
  4. +100 −0 src/functionaltest/testprojects/attachChangelogTest/firstProject/build.log
  5. +100 −0 src/functionaltest/testprojects/attachChangelogTest/secondProject/build.log
  6. +90 −0 src/functionaltest/testprojects/singleChangelogTest/build.log
  7. +4 −0 src/functionaltest/testprojects/singleChangelogTest/null/CHANGES.txt
  8. +98 −0 src/main/java/org/neo4j/build/plugins/changes/ChangeLogExtractorMojo.java
  9. +59 −0 src/main/java/org/neo4j/build/plugins/changes/Changelog.java
  10. +200 −0 src/main/java/org/neo4j/build/plugins/changes/ChangelogArtifact.java
  11. +293 −0 src/main/java/org/neo4j/build/plugins/changes/ChangelogAttachingMojo.java
  12. +83 −0 src/main/java/org/neo4j/build/plugins/changes/ChangelogSectionExtractor.java
  13. +77 −0 src/main/java/org/neo4j/build/plugins/changes/CombiningChangelogWriter.java
  14. +250 −0 src/main/java/org/neo4j/build/plugins/changes/DependencyUtil.java
  15. +29 −0 src/main/java/org/neo4j/build/plugins/changes/VersionMatcher.java
  16. +54 −0 src/test/java/org/neo4j/build/plugins/changes/TestChangelog.java
View
39 .gitignore
@@ -1,40 +1,5 @@
-# use glob syntax.
-syntax: glob
-*.ser
-*.class
*~
-*.bak
-*.off
-*.old
-
-# eclipse conf file
-.settings
-.classpath
.project
-.manager
-
-# idea
-*.iml
-*.iws
-*.ipr
-
-# building
+.classpath
+.settings
target
-build
-null
-tmp*
-temp*
-dist
-test-output
-build.log
-
-# other scm
-.svn
-.CVS
-.hg*
-
-# switch to regexp syntax.
-# syntax: regexp
-# ^\.pc/
-
-
View
285 src/functionaltest/testprojects/attachChangelogTest/build.log
@@ -0,0 +1,285 @@
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] Reactor build order:
+[INFO] Unnamed - it.sandbox:attachChangelogTest:pom:1.0-SNAPSHOT
+[INFO] Unnamed - it.sandbox:firstProject:jar:1.0-SNAPSHOT
+[INFO] Unnamed - it.sandbox:secondProject:jar:1.0-SNAPSHOT
+[INFO] Unnamed - it.sandbox:combineProject:jar:1.0-SNAPSHOT
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:attachChangelogTest:pom:1.0-SNAPSHOT
+[INFO] task-segment: [clean, compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [clean:clean {execution: default-clean}]
+[INFO] No goals needed for project - skipping
+[INFO] No goals needed for project - skipping
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:firstProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [clean, compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [clean:clean {execution: default-clean}]
+[INFO] Deleting file set: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target (included: [**], excluded: [])
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Compiling 1 source file to /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/test-classes
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.019 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:secondProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [clean, compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [clean:clean {execution: default-clean}]
+[INFO] Deleting file set: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target (included: [**], excluded: [])
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Compiling 1 source file to /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/test-classes
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.015 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:combineProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [clean, compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [clean:clean {execution: default-clean}]
+[INFO] Deleting file set: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/target (included: [**], excluded: [])
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Compiling 1 source file to /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/target/test-classes
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.018 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO]
+[INFO]
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO] ------------------------------------------------------------------------
+[INFO] Unnamed - it.sandbox:attachChangelogTest:pom:1.0-SNAPSHOT SUCCESS [0.357s]
+[INFO] Unnamed - it.sandbox:firstProject:jar:1.0-SNAPSHOT .... SUCCESS [1.285s]
+[INFO] Unnamed - it.sandbox:secondProject:jar:1.0-SNAPSHOT ... SUCCESS [0.629s]
+[INFO] Unnamed - it.sandbox:combineProject:jar:1.0-SNAPSHOT .. SUCCESS [0.546s]
+[INFO] ------------------------------------------------------------------------
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 3 seconds
+[INFO] Finished at: Mon Jan 23 17:28:08 CET 2012
+[INFO] Final Memory: 21M/215M
+[INFO] ------------------------------------------------------------------------
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] Reactor build order:
+[INFO] Unnamed - it.sandbox:attachChangelogTest:pom:1.0-SNAPSHOT
+[INFO] Unnamed - it.sandbox:firstProject:jar:1.0-SNAPSHOT
+[INFO] Unnamed - it.sandbox:secondProject:jar:1.0-SNAPSHOT
+[INFO] Unnamed - it.sandbox:combineProject:jar:1.0-SNAPSHOT
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:attachChangelogTest:pom:1.0-SNAPSHOT
+[INFO] task-segment: [compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] No goals needed for project - skipping
+[INFO] No goals needed for project - skipping
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:firstProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.018 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:secondProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.018 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:combineProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.015 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO]
+[INFO]
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO] ------------------------------------------------------------------------
+[INFO] Unnamed - it.sandbox:attachChangelogTest:pom:1.0-SNAPSHOT SUCCESS [0.002s]
+[INFO] Unnamed - it.sandbox:firstProject:jar:1.0-SNAPSHOT .... SUCCESS [1.109s]
+[INFO] Unnamed - it.sandbox:secondProject:jar:1.0-SNAPSHOT ... SUCCESS [0.357s]
+[INFO] Unnamed - it.sandbox:combineProject:jar:1.0-SNAPSHOT .. SUCCESS [0.271s]
+[INFO] ------------------------------------------------------------------------
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:28:11 CET 2012
+[INFO] Final Memory: 11M/211M
+[INFO] ------------------------------------------------------------------------
+Running post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/validate.groovy
+Finished post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/validate.groovy
View
94 src/functionaltest/testprojects/attachChangelogTest/combineProject/build.log
@@ -0,0 +1,94 @@
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:combineProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [clean, compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [clean:clean {execution: default-clean}]
+[INFO] Deleting file set: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/target (included: [**], excluded: [])
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Compiling 1 source file to /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/target/test-classes
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.015 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:28:13 CET 2012
+[INFO] Final Memory: 14M/214M
+[INFO] ------------------------------------------------------------------------
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:combineProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.02 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:28:14 CET 2012
+[INFO] Final Memory: 9M/149M
+[INFO] ------------------------------------------------------------------------
+Running post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/validate.groovy
+Finished post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/combineProject/validate.groovy
View
100 src/functionaltest/testprojects/attachChangelogTest/firstProject/build.log
@@ -0,0 +1,100 @@
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:firstProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [clean, compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [clean:clean {execution: default-clean}]
+[INFO] Deleting file set: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target (included: [**], excluded: [])
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Compiling 1 source file to /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/test-classes
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.019 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:28:03 CET 2012
+[INFO] Final Memory: 15M/213M
+[INFO] ------------------------------------------------------------------------
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:firstProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [compile, install]
+[INFO] ------------------------------------------------------------------------
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.018 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] [jar:jar {execution: default-jar}]
+[INFO] Building jar: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/singleChangelogTest.jar
+[INFO] [install:install {execution: default-install}]
+[INFO] Installing /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/singleChangelogTest.jar to /home/jake/.m2/repository/it/sandbox/firstProject/1.0-SNAPSHOT/firstProject-1.0-SNAPSHOT.jar
+[INFO] Installing /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/classes/CHANGES.txt to /home/jake/.m2/repository/it/sandbox/firstProject/1.0-SNAPSHOT/firstProject-1.0-SNAPSHOT-changelog.txt
+[INFO] Installing /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/target/classes/CHANGES.txt to /home/jake/.m2/repository/it/sandbox/firstProject/1.0-SNAPSHOT/firstProject-1.0-SNAPSHOT-changelog.txt
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:28:05 CET 2012
+[INFO] Final Memory: 14M/215M
+[INFO] ------------------------------------------------------------------------
+Running post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/validate.groovy
+Finished post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/firstProject/validate.groovy
View
100 src/functionaltest/testprojects/attachChangelogTest/secondProject/build.log
@@ -0,0 +1,100 @@
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:secondProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [clean, compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [clean:clean {execution: default-clean}]
+[INFO] Deleting file set: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target (included: [**], excluded: [])
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Compiling 1 source file to /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/test-classes
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.019 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:27:58 CET 2012
+[INFO] Final Memory: 14M/214M
+[INFO] ------------------------------------------------------------------------
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:secondProject:jar:1.0-SNAPSHOT
+[INFO] task-segment: [compile, install]
+[INFO] ------------------------------------------------------------------------
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/main/resources
+[INFO] [changes:attach-changelog {execution: default}]
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogAttachedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.018 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 2
+
+[INFO] [jar:jar {execution: default-jar}]
+[INFO] Building jar: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/singleChangelogTest.jar
+[INFO] [install:install {execution: default-install}]
+[INFO] Installing /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/singleChangelogTest.jar to /home/jake/.m2/repository/it/sandbox/secondProject/1.0-SNAPSHOT/secondProject-1.0-SNAPSHOT.jar
+[INFO] Installing /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/classes/CHANGES.txt to /home/jake/.m2/repository/it/sandbox/secondProject/1.0-SNAPSHOT/secondProject-1.0-SNAPSHOT-changelog.txt
+[INFO] Installing /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/target/classes/CHANGES.txt to /home/jake/.m2/repository/it/sandbox/secondProject/1.0-SNAPSHOT/secondProject-1.0-SNAPSHOT-changelog.txt
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:28:01 CET 2012
+[INFO] Final Memory: 14M/215M
+[INFO] ------------------------------------------------------------------------
+Running post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/validate.groovy
+Finished post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/attachChangelogTest/secondProject/validate.groovy
View
90 src/functionaltest/testprojects/singleChangelogTest/build.log
@@ -0,0 +1,90 @@
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:singleChangelogTest:jar:1.0-SNAPSHOT
+[INFO] task-segment: [clean, compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [clean:clean {execution: default-clean}]
+[INFO] Deleting file set: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/target (included: [**], excluded: [])
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/src/main/resources
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/src/main/resources
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Compiling 1 source file to /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/target/test-classes
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogDeployedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
+
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:27:54 CET 2012
+[INFO] Final Memory: 14M/214M
+[INFO] ------------------------------------------------------------------------
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Unnamed - it.sandbox:singleChangelogTest:jar:1.0-SNAPSHOT
+[INFO] task-segment: [compile, test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/src/main/resources
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [changes:extract-changelog {execution: default}]
+[INFO] [resources:resources {execution: default-resources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/src/main/resources
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+[INFO] skip non existing resourceDirectory /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.neo4j.ChangelogDeployedTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 sec
+
+Results :
+
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
+
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 second
+[INFO] Finished at: Mon Jan 23 17:27:56 CET 2012
+[INFO] Final Memory: 9M/149M
+[INFO] ------------------------------------------------------------------------
+Running post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/validate.groovy
+Finished post-build script in: /home/jake/Workspaces/Neo4j/changes-maven-plugin/src/functionaltest/testprojects/singleChangelogTest/validate.groovy
View
4 src/functionaltest/testprojects/singleChangelogTest/null/CHANGES.txt
@@ -0,0 +1,4 @@
+1.0 (2012-01-19)
+----------------
+o Fixes issues #173, #118, #138, #103
+
View
98 src/main/java/org/neo4j/build/plugins/changes/ChangeLogExtractorMojo.java
@@ -0,0 +1,98 @@
+package org.neo4j.build.plugins.changes;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ *
+ * @goal extract-changelog
+ * @phase generate-resources
+ *
+ */
+public class ChangeLogExtractorMojo extends AbstractMojo {
+
+ private static final CharSequence BASEVERSION_TEMPLATE = "$VERSION";
+
+ /**
+ * Location of the changelog
+ *
+ * @parameter default-value="${project.basedir}/CHANGES.txt"
+ */
+ private File changelogPath;
+
+ /**
+ * Location of the outputted changelog
+ *
+ * @parameter default-value="${project.build.outputDirectory}/CHANGES.txt"
+ */
+ private File extractedChangelogOutputFile;
+
+ /**
+ * Version to extract from the changelog and deploy with this project.
+ *
+ * @parameter default-value="${project.version}"
+ */
+ private String projectVersion;
+
+ /**
+ * List of regexes, version numbers in CHANGELOG headlines that match
+ * any of these regexes will be included in the deployed changelog.
+ *
+ * By default, this is populated with a matcher for the current project
+ * version, with the "-SNAPSHOT" removed, if there was one.
+ *
+ * You can expand this to include things like entries for milestone releases
+ * or release candidates. You can use the $VERSION template to inject
+ * a regex for the current project version. For example:
+ *
+ * <ul>
+ * <li>$VERSION</li>
+ * <li>$VERSION\.M\d*</li>
+ * <li>$VERSION\.RC\d*</li>
+ * </ul>
+ *
+ * @parameter
+ */
+ private List<String> includeVersions;
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ try {
+
+ Changelog changelog = new Changelog(changelogPath);
+
+ List<String> extractedSections = changelog.extractSectionForVersion(createVersionMatcher());
+
+ FileUtils.writeLines(extractedChangelogOutputFile, extractedSections);
+
+ } catch (RuntimeException exc) {
+ throw exc;
+ } catch (Exception exc) {
+ throw new MojoExecutionException(exc.getMessage(), exc);
+ }
+ }
+
+ private VersionMatcher createVersionMatcher()
+ {
+ return new VersionMatcher(createVersionRegexes());
+ }
+
+ private String [] createVersionRegexes()
+ {
+ String baseVersion = projectVersion.replace(".", "\\.").replace("-SNAPSHOT","");
+ if(includeVersions == null) {
+ includeVersions = new ArrayList<String>();
+ includeVersions.add(baseVersion);
+ }
+ String [] regexes = new String[includeVersions.size()];
+ for(int i=0;i<includeVersions.size();i++) {
+ regexes[i] = includeVersions.get(i).replace(BASEVERSION_TEMPLATE, baseVersion);
+ }
+ return regexes;
+ }
+}
View
59 src/main/java/org/neo4j/build/plugins/changes/Changelog.java
@@ -0,0 +1,59 @@
+package org.neo4j.build.plugins.changes;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Changelog {
+
+ private List<String> logLines = new ArrayList<String>();
+
+ public Changelog(File changelog) throws IOException
+ {
+ this(new FileInputStream(changelog));
+ }
+
+ protected Changelog(InputStream changesInput) throws IOException
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(
+ changesInput));
+
+ String line;
+ while ((line = br.readLine()) != null)
+ {
+ logLines.add(line);
+ }
+
+ // Add an extra blank line, makes the parser easier to write
+ logLines.add("");
+ } finally {
+ if(changesInput != null) {
+ changesInput.close();
+ }
+ }
+ }
+
+ public List<String> extractSectionForVersion(String version)
+ {
+ return extractSectionForVersion(new VersionMatcher(version));
+ }
+
+ public List<String> extractSectionForVersion(VersionMatcher versionMatcher)
+ {
+ ChangelogSectionExtractor extractor = new ChangelogSectionExtractor(logLines, versionMatcher);
+ return extractor.runExtraction(true);
+ }
+
+ public List<String> extractAllEntriesWithoutHeadlines()
+ {
+ ChangelogSectionExtractor extractor = new ChangelogSectionExtractor(logLines, VersionMatcher.ANY);
+ return extractor.runExtraction(false);
+ }
+}
View
200 src/main/java/org/neo4j/build/plugins/changes/ChangelogArtifact.java
@@ -0,0 +1,200 @@
+package org.neo4j.build.plugins.changes;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.StringUtils;
+
+public class ChangelogArtifact {
+ /**
+ * Group Id of Artifact
+ *
+ * @parameter
+ * @required
+ */
+ private String groupId;
+
+ /**
+ * Name of Artifact
+ *
+ * @parameter
+ * @required
+ */
+ private String artifactId;
+
+ /**
+ * Version of Artifact
+ *
+ * @parameter
+ */
+ private String version = null;
+
+ /**
+ * Type of Artifact (War,Jar,etc)
+ *
+ * @parameter
+ * @required
+ */
+ private String type = "txt";
+
+ /**
+ * Classifier for Artifact (tests,sources,etc)
+ *
+ * @parameter
+ */
+ private String classifier = "changelog";
+
+ /**
+ * Artifact Item
+ */
+ private Artifact artifact;
+
+ public ChangelogArtifact()
+ {
+ // default constructor
+ }
+
+ public ChangelogArtifact(Artifact artifact)
+ {
+ this.setArtifact(artifact);
+ this.setArtifactId(artifact.getArtifactId());
+ this.setClassifier(artifact.getClassifier());
+ this.setGroupId(artifact.getGroupId());
+ this.setType(artifact.getType());
+ this.setVersion(artifact.getVersion());
+ }
+
+ private String filterEmptyString(String in)
+ {
+ if ("".equals(in))
+ {
+ return null;
+ }
+ return in;
+ }
+
+ /**
+ * @return Returns the artifactId.
+ */
+ public String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ /**
+ * @param artifactId
+ * The artifactId to set.
+ */
+ public void setArtifactId(String artifact)
+ {
+ this.artifactId = filterEmptyString(artifact);
+ }
+
+ /**
+ * @return Returns the groupId.
+ */
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ /**
+ * @param groupId
+ * The groupId to set.
+ */
+ public void setGroupId(String groupId)
+ {
+ this.groupId = filterEmptyString(groupId);
+ }
+
+ /**
+ * @return Returns the type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * @param type
+ * The type to set.
+ */
+ public void setType(String type)
+ {
+ this.type = filterEmptyString(type);
+ }
+
+ /**
+ * @return Returns the version.
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * @param version
+ * The version to set.
+ */
+ public void setVersion(String version)
+ {
+ this.version = filterEmptyString(version);
+ }
+
+ /**
+ * @return Classifier.
+ */
+ public String getClassifier()
+ {
+ return classifier;
+ }
+
+ /**
+ * @param classifier
+ * Classifier.
+ */
+ public void setClassifier(String classifier)
+ {
+ this.classifier = filterEmptyString(classifier);
+ }
+
+ public String toString()
+ {
+ if (this.classifier == null)
+ {
+ return groupId + ":" + artifactId + ":"
+ + StringUtils.defaultString(version, "?") + ":" + type;
+ } else
+ {
+ return groupId + ":" + artifactId + ":" + classifier + ":"
+ + StringUtils.defaultString(version, "?") + ":" + type;
+ }
+ }
+
+ /**
+ * @return Returns the artifact.
+ */
+ public Artifact getArtifact()
+ {
+ return this.artifact;
+ }
+
+ /**
+ * @param artifact
+ * The artifact to set.
+ */
+ public void setArtifact(Artifact artifact)
+ {
+ this.artifact = artifact;
+ }
+
+ public void setDefaults(MavenProject mavenProject)
+ {
+ if(groupId == null) {
+ groupId = mavenProject.getGroupId();
+ }
+
+ if(version == null) {
+ version = mavenProject.getVersion();
+ }
+ }
+}
View
293 src/main/java/org/neo4j/build/plugins/changes/ChangelogAttachingMojo.java
@@ -0,0 +1,293 @@
+package org.neo4j.build.plugins.changes;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ *
+ * @goal attach-changelog
+ * @phase process-resources
+ *
+ */
+public class ChangelogAttachingMojo extends AbstractMojo {
+
+ /**
+ * Used to look up Artifacts in the remote repository.
+ *
+ * @component
+ */
+ protected ArtifactFactory factory;
+
+ /**
+ * Location of the local repository.
+ *
+ * @parameter expression="${localRepository}"
+ * @readonly
+ * @required
+ */
+ private ArtifactRepository local;
+
+ /**
+ * List of Remote Repositories used by the resolver
+ *
+ * @parameter expression="${project.remoteArtifactRepositories}"
+ * @readonly
+ * @required
+ */
+ protected List<ArtifactRepository> remoteRepos;
+
+ /**
+ * @component
+ */
+ private MavenProjectHelper mavenProjectHelper;
+
+ /**
+ * @parameter default-value="${project}"
+ */
+ private MavenProject mavenProject;/**
+
+ /* Used to look up Artifacts in the remote repository.
+ *
+ * @component
+ */
+ protected ArtifactResolver resolver;
+
+ /**
+ * Location of the outputted changelog
+ *
+ * @parameter default-value="${project.build.outputDirectory}/CHANGES.txt"
+ */
+ private File extractedChangelogOutputFile;
+
+ /**
+ * Location of the final, combined, changelog
+ *
+ * @parameter default-value="${project.build.directory}/CHANGES.txt"
+ */
+ private File combinedOutputFile;
+
+
+ /**
+ * Changelogs to include in the combined and deployed changelog for this
+ * project.
+ *
+ * Each entry is required to contain an artifact id.
+ *
+ * Optional attributes are:
+ *
+ * <ul>
+ * <li>groupId - default is the same as the current project</li>
+ * <li>version - default is the same as the current project</li>
+ * </ul>
+ *
+ * @parameter
+ */
+ private List<ChangelogArtifact> changelogArtifacts;
+
+ /**
+ * Contains the full list of projects in the reactor.
+ *
+ * @parameter expression="${reactorProjects}"
+ * @required
+ * @readonly
+ */
+ protected List<MavenProject> reactorProjects;
+
+ public void execute() throws MojoExecutionException, MojoFailureException
+ {
+ try
+ {
+
+ // Changelog changelog = new Changelog(changelogPath);
+ //
+ // String extractedSections =
+ // changelog.extractSectionForVersion(createVersionMatcher());
+ //
+ // FileUtils.writeStringToFile(outputPath, extractedSections);
+ //
+
+ // Create if output doesnt exist.
+ extractedChangelogOutputFile.getParentFile().mkdirs();
+ extractedChangelogOutputFile.createNewFile();
+
+ if(combinedOutputFile.exists()) {
+ combinedOutputFile.delete();
+ }
+
+ CombiningChangelogWriter combiner = new CombiningChangelogWriter(new Date(), mavenProject.getVersion());
+
+ combiner.addChangelog(mavenProject.getGroupId() + "." + mavenProject.getArtifactId(), extractedChangelogOutputFile);
+
+ if (changelogArtifacts != null)
+ {
+ for (ChangelogArtifact changelogArtifact : changelogArtifacts)
+ {
+ changelogArtifact.setDefaults(mavenProject);
+ Artifact a = getArtifact(changelogArtifact);
+
+ combiner.addChangelog(a.getGroupId() + "." + a.getArtifactId(), a.getFile());
+ }
+ }
+
+ combiner.writeTo(combinedOutputFile);
+
+ mavenProjectHelper.attachArtifact(mavenProject, "txt", "changelog",
+ extractedChangelogOutputFile);
+
+ } catch (RuntimeException exc)
+ {
+ throw exc;
+ } catch (Exception exc)
+ {
+ throw new MojoExecutionException(exc.getMessage(), exc);
+ }
+ }
+
+ /**
+ * Returns <code>true</code> if the artifact has a file.
+ * @param artifact the artifact (may be null)
+ * @return <code>true</code> if and only if the artifact is non-null and has a file.
+ */
+ private static boolean hasFile( Artifact artifact )
+ {
+ return artifact != null && artifact.getFile() != null && artifact.getFile().isFile();
+ }
+
+ /**
+ * Null-safe compare of two artifacts based on groupId, artifactId, version, type and classifier.
+ * @param a the first artifact.
+ * @param b the second artifact.
+ * @return <code>true</code> if and only if the two artifacts have the same groupId, artifactId, version,
+ * type and classifier.
+ */
+ private static boolean equals( Artifact a, Artifact b )
+ {
+ return a == b
+ || !( a == null || b == null )
+ && StringUtils.equals( a.getGroupId(), b.getGroupId() )
+ && StringUtils.equals( a.getArtifactId(), b.getArtifactId() )
+ && StringUtils.equals( a.getVersion(), b.getVersion() )
+ && StringUtils.equals( a.getType(), b.getType() )
+ && StringUtils.equals( a.getClassifier(), b.getClassifier() );
+ }
+
+ /**
+ * Resolves the Artifact from the remote repository if necessary. If no version is specified, it will be retrieved
+ * from the dependency list or from the DependencyManagement section of the pom.
+ *
+ * @param artifactItem containing information about artifact from plugin configuration.
+ * @return Artifact object representing the specified file.
+ * @throws MojoExecutionException with a message if the version can't be found in DependencyManagement.
+ */
+ protected Artifact getArtifact( ChangelogArtifact artifactItem )
+ throws MojoExecutionException
+ {
+ Artifact artifact;
+
+ // Map managedVersions = createManagedVersionMap( factory,
+ // project.getId(), project.getDependencyManagement() );
+ VersionRange vr;
+ try
+ {
+ vr = VersionRange.createFromVersionSpec( artifactItem.getVersion() );
+ }
+ catch ( InvalidVersionSpecificationException e1 )
+ {
+ e1.printStackTrace();
+ vr = VersionRange.createFromVersion( artifactItem.getVersion() );
+ }
+
+ if ( StringUtils.isEmpty( artifactItem.getClassifier() ) )
+ {
+ artifact =
+ factory.createDependencyArtifact( artifactItem.getGroupId(), artifactItem.getArtifactId(), vr,
+ artifactItem.getType(), null, Artifact.SCOPE_COMPILE );
+ }
+ else
+ {
+ artifact =
+ factory.createDependencyArtifact( artifactItem.getGroupId(), artifactItem.getArtifactId(), vr,
+ artifactItem.getType(), artifactItem.getClassifier(),
+ Artifact.SCOPE_COMPILE );
+ }
+
+ // Maven 3 will search the reactor for the artifact but Maven 2 does not
+ // to keep consistent behaviour, we search the reactor ourselves.
+ Artifact result = getArtifactFomReactor( artifact );
+ if ( result != null )
+ {
+ return result;
+ }
+ try
+ {
+ resolver.resolve( artifact, remoteRepos, local );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new MojoExecutionException( "Unable to resolve artifact.", e );
+ }
+ catch ( ArtifactNotFoundException e )
+ {
+ throw new MojoExecutionException( "Unable to find artifact.", e );
+ }
+
+ return artifact;
+ }
+
+
+ /**
+ * Checks to see if the specified artifact is available from the reactor.
+ * @param artifact The artifact we are looking for.
+ * @return The resolved artifact that is the same as the one we were looking for or <code>null</code> if one could
+ * not be found.
+ */
+ @SuppressWarnings("unchecked")
+ private Artifact getArtifactFomReactor( Artifact artifact )
+ {
+ // check project dependencies first off
+ for ( Artifact a : (Set<Artifact>) mavenProject.getArtifacts() )
+ {
+ if ( equals( artifact, a ) && hasFile( a ) )
+ {
+ return a;
+ }
+ }
+ // check reactor projects
+ for ( MavenProject p : reactorProjects == null ? Collections.<MavenProject>emptyList() : reactorProjects )
+ {
+ // check the main artifact
+ if ( equals( artifact, p.getArtifact() ) && hasFile( p.getArtifact() ) )
+ {
+ return p.getArtifact();
+ }
+ // check any side artifacts
+ for ( Artifact a : (List<Artifact>) p.getAttachedArtifacts() )
+ {
+ if ( equals( artifact, a ) && hasFile( a ) )
+ {
+ return a;
+ }
+ }
+ }
+ // not available
+ return null;
+ }
+}
View
83 src/main/java/org/neo4j/build/plugins/changes/ChangelogSectionExtractor.java
@@ -0,0 +1,83 @@
+package org.neo4j.build.plugins.changes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ChangelogSectionExtractor {
+
+ private enum ParseMode {SCANNING,EXTRACTING,DONE};
+
+ private List<String> logLines;
+ private VersionMatcher versionMatcher;
+
+ public ChangelogSectionExtractor(List<String> logLines,
+ VersionMatcher versionMatcher)
+ {
+ this.logLines = logLines;
+ this.versionMatcher = versionMatcher;
+ }
+
+ public List<String> runExtraction(boolean includeHeadlines)
+ {
+ ParseMode mode = ParseMode.SCANNING;
+ List<String> output = new ArrayList<String>();
+ String prevLine = "";
+
+ for(String line : logLines) {
+ mode = processLine(prevLine, line, output, mode, includeHeadlines);
+ prevLine = line;
+ }
+
+ if(!output.get(output.size() - 1).equals("")) {
+ output.add("");
+ }
+
+ if(!output.get(output.size() - 2).equals("")) {
+ output.add("");
+ }
+
+ return output;
+ }
+
+
+ private ParseMode processLine(String prevLine, String line, List<String> output,
+ ParseMode mode, boolean includeHeadlines)
+ {
+ switch(mode) {
+
+ case SCANNING:
+ if(isSectionStart(line) && isVersionHeadline(prevLine, versionMatcher)) {
+ mode = ParseMode.EXTRACTING;
+ if(includeHeadlines) {
+ output.add(prevLine);
+ }
+ }
+ break;
+
+ case EXTRACTING:
+ if(isSectionStart(line)) {
+ // Hit new section
+ output.add("");
+ mode = ParseMode.SCANNING;
+ return processLine(prevLine, line, output, mode, includeHeadlines);
+ } else if(prevLine.trim().length() > 0) {
+ if(includeHeadlines || !isSectionStart(prevLine)) {
+ output.add(prevLine);
+ }
+ }
+ break;
+ }
+ return mode;
+ }
+
+ private boolean isVersionHeadline(String line, VersionMatcher versionMatcher)
+ {
+ return versionMatcher.test(line.trim().split(" ")[0]);
+ }
+
+ private boolean isSectionStart(String line)
+ {
+ return line.startsWith("----");
+ }
+
+}
View
77 src/main/java/org/neo4j/build/plugins/changes/CombiningChangelogWriter.java
@@ -0,0 +1,77 @@
+package org.neo4j.build.plugins.changes;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class CombiningChangelogWriter {
+
+ class Pair<FIRST,SECOND> {
+ public FIRST first;
+ public SECOND second;
+ public Pair(FIRST first, SECOND second) {
+ this.first = first;
+ this.second = second;
+ }
+ }
+
+ private Object version;
+ private Date date;
+ private List<Pair<String,File>> changelogs = new ArrayList<Pair<String,File>>();
+
+ public CombiningChangelogWriter(Date date,
+ String version)
+ {
+ this.version = version;
+ this.date = date;
+ }
+
+ public void addChangelog(String title, File changelog)
+ {
+ changelogs.add(new Pair<String,File>(title, changelog));
+ }
+
+ public void writeTo(File combinedOutputFile) throws IOException
+ {
+ BufferedWriter out = null;
+ try {
+ out = new BufferedWriter(new FileWriter(combinedOutputFile, true));
+
+ writeTitleTo(out);
+ for (Pair<String, File> changelogMeta : changelogs)
+ {
+ Changelog changelog = new Changelog(changelogMeta.second);
+ List<String> lines = changelog.extractAllEntriesWithoutHeadlines();
+
+ out.write(changelogMeta.first + ":\n");
+
+ for(String line : lines) {
+ out.write(line + "\n");
+ }
+ }
+ } finally {
+ if(out != null) {
+ out.close();
+ }
+ }
+ }
+
+ private void writeTitleTo(Writer out) throws IOException
+ {
+ @SuppressWarnings("deprecation")
+ String dateStr = (date.getYear() + 1900) + "-" + (date.getMonth() + 1) + "-" + date.getDate();
+ String headline = version + " (" + dateStr + ")\n";
+
+ out.write(headline);
+ for(int i=0;i<headline.length();i++) {
+ out.write("-");
+ }
+ out.write("\n\n");
+ }
+
+}
View
250 src/main/java/org/neo4j/build/plugins/changes/DependencyUtil.java
@@ -0,0 +1,250 @@
+package org.neo4j.build.plugins.changes;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringReader;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * Utility class with static helper methods
+ *
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * @version $Id: DependencyUtil.java 1200108 2011-11-10 03:05:47Z carlos $
+ */
+public final class DependencyUtil
+{
+
+ /**
+ * Builds the file name. If removeVersion is set, then the file name must be reconstructed from the artifactId,
+ * Classifier (if used) and Type. Otherwise, this method returns the artifact file name.
+ *
+ * @param artifact File to be formatted.
+ * @param removeVersion Specifies if the version should be removed from the file name.
+ * @return Formatted file name in the format artifactId-[version]-[classifier].[type]
+ * @see {@link #getFormattedFileName(Artifact, boolean, boolean)}.
+ */
+ public static String getFormattedFileName( Artifact artifact, boolean removeVersion )
+ {
+ return getFormattedFileName( artifact, removeVersion, false );
+ }
+
+ /**
+ * Builds the file name. If removeVersion is set, then the file name must be
+ * reconstructed from the groupId (if <b>prependGroupId</b> is true) artifactId,
+ * Classifier (if used) and Type.
+ * Otherwise, this method returns the artifact file name.
+ *
+ * @param artifact
+ * File to be formatted.
+ * @param removeVersion
+ * Specifies if the version should be removed from the file name.
+ * @param prependGroupId
+ * Specifies if the groupId should be prepended to the file name.
+ * @return Formatted file name in the format
+ * [groupId].artifactId-[version]-[classifier].[type]
+ */
+ public static String getFormattedFileName( Artifact artifact, boolean removeVersion, boolean prependGroupId )
+ {
+ StringBuffer destFileName = new StringBuffer();
+
+ if ( prependGroupId )
+ {
+ destFileName.append( artifact.getGroupId() ).append( "." );
+ }
+
+ String versionString = null;
+ if ( !removeVersion )
+ {
+ versionString = "-" + artifact.getVersion();
+ }
+ else
+ {
+ versionString = "";
+ }
+
+ String classifierString = "";
+
+ if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
+ {
+ classifierString = "-" + artifact.getClassifier();
+ }
+ destFileName.append( artifact.getArtifactId() ).append( versionString );
+ destFileName.append( classifierString ).append( "." );
+ destFileName.append( artifact.getArtifactHandler().getExtension() );
+
+ return destFileName.toString();
+ }
+
+ /**
+ * Formats the outputDirectory based on type.
+ *
+ * @param useSubdirsPerType if a new sub directory should be used for each type.
+ * @param useSubdirPerArtifact if a new sub directory should be used for each artifact.
+ * @param useRepositoryLayout if dependencies must be moved into a Maven repository layout, if set, other settings
+ * will be ignored.
+ * @param removeVersion if the version must not be mentioned in the filename
+ * @param outputDirectory base outputDirectory.
+ * @param artifact information about the artifact.
+ * @return a formatted File object to use for output.
+ */
+ public static File getFormattedOutputDirectory( boolean useSubdirsPerScope, boolean useSubdirsPerType,
+ boolean useSubdirPerArtifact, boolean useRepositoryLayout,
+ boolean removeVersion, File outputDirectory, Artifact artifact )
+ {
+ StringBuffer sb = new StringBuffer( 128 );
+ if ( useRepositoryLayout )
+ {
+ // group id
+ sb.append( artifact.getGroupId().replace( '.', File.separatorChar ) ).append( File.separatorChar );
+ // artifact id
+ sb.append( artifact.getArtifactId() ).append( File.separatorChar );
+ // version
+ sb.append( artifact.getBaseVersion() ).append( File.separatorChar );
+ }
+ else
+ {
+ if ( useSubdirsPerScope )
+ {
+ sb.append( artifact.getScope() ).append( File.separatorChar );
+ }
+ if ( useSubdirsPerType )
+ {
+ sb.append( artifact.getType() ).append( "s" ).append( File.separatorChar );
+ }
+ if ( useSubdirPerArtifact )
+ {
+ String artifactString = getDependencyId( artifact, removeVersion );
+ sb.append( artifactString ).append( File.separatorChar );
+ }
+ }
+ return new File( outputDirectory, sb.toString() );
+ }
+
+ private static String getDependencyId( Artifact artifact, boolean removeVersion )
+ {
+ StringBuffer sb = new StringBuffer();
+
+ sb.append( artifact.getArtifactId() );
+
+ if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
+ {
+ sb.append( "-" );
+ sb.append( artifact.getClassifier() );
+ }
+
+ if ( !removeVersion )
+ {
+ sb.append( "-" );
+ sb.append( artifact.getVersion() );
+ sb.append( "-" );
+ sb.append( artifact.getType() );
+ }
+ else
+ {
+ // if the classifier and type are the same (sources), then don't
+ // repeat.
+ // avoids names like foo-sources-sources
+ if ( !StringUtils.equals( artifact.getClassifier(), artifact.getType() ) )
+ {
+ sb.append( "-" );
+ sb.append( artifact.getType() );
+ }
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Writes the specified string to the specified file.
+ *
+ * @param string the string to write
+ * @param file the file to write to
+ * @throws IOException if an I/O error occurs
+ */
+ public static synchronized void write( String string, File file, boolean append, Log log )
+ throws IOException
+ {
+ file.getParentFile().mkdirs();
+
+ FileWriter writer = null;
+
+ try
+ {
+ writer = new FileWriter( file, append );
+
+ writer.write( string );
+ }
+ finally
+ {
+ IOUtil.close( writer );
+ }
+ }
+
+ /**
+ * Writes the specified string to the log at info level.
+ *
+ * @param string the string to write
+ * @throws IOException if an I/O error occurs
+ */
+ public static synchronized void log( String string, Log log )
+ throws IOException
+ {
+ BufferedReader reader = new BufferedReader( new StringReader( string ) );
+
+ String line;
+
+ while ( ( line = reader.readLine() ) != null )
+ {
+ log.info( line );
+ }
+
+ reader.close();
+ }
+
+ //
+ // mainly used to parse excludes,includes configuration
+ //
+ public static String[] tokenizer( String str )
+ {
+ return StringUtils.split( cleanToBeTokenizedString( str ), "," );
+ }
+
+ //
+ // clean up configuration string before it can be tokenized
+ //
+ public static String cleanToBeTokenizedString( String str )
+ {
+ String ret = "";
+ if ( !StringUtils.isEmpty( str ) )
+ {
+ // remove initial and ending spaces, plus all spaces next to commas
+ ret = str.trim().replaceAll( "[\\s]*,[\\s]*", "," );
+ }
+
+ return ret;
+ }
+}
View
29 src/main/java/org/neo4j/build/plugins/changes/VersionMatcher.java
@@ -0,0 +1,29 @@
+package org.neo4j.build.plugins.changes;
+
+public class VersionMatcher {
+
+ public static final VersionMatcher ANY = new VersionMatcher() {
+ @Override
+ public boolean test(String version) {
+ return true;
+ }
+ };
+
+ private String[] patterns;
+
+ public VersionMatcher(String ... patterns)
+ {
+ this.patterns = patterns;
+ }
+
+ public boolean test(String version)
+ {
+ for(String pattern : patterns ) {
+ if(version.matches(pattern)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
View
54 src/test/java/org/neo4j/build/plugins/changes/TestChangelog.java
@@ -0,0 +1,54 @@
+package org.neo4j.build.plugins.changes;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.InputStream;
+
+import org.apache.commons.lang.StringUtils;
+import org.junit.Test;
+import org.neo4j.build.plugins.changes.Changelog;
+import org.neo4j.build.plugins.changes.VersionMatcher;
+
+
+public class TestChangelog {
+
+ private static final String EXPECTED_1_6_SECTION =
+ "1.6 (2012-01-19)\n"+
+ "----------------\n"+
+ "o Fixes issues #173, #118, #138, #103\n\n";
+
+ private static final String EXPECTED_1_6_M01_SECTION =
+ "1.6.M01 (2011-11-24)\n"+
+ "--------------------\n"+
+ "o Cypher console in webadmin is now a Neo4j Shell console with the exact same Cypher support included.\n" +
+ "o More documentation and examples.\n\n";
+
+ private static final String EXPECTED_0_1_SECTION =
+ "0.1 (2010-11-18)\n"+
+ "------------------------\n"+
+ "Initial release.\n\n";
+
+ @Test
+ public void testExtractSectionForVersion() throws Exception
+ {
+ InputStream changesInput = this.getClass().getResourceAsStream("/changelogs/BASIC.txt");
+
+ Changelog changelog = new Changelog(changesInput);
+
+ // Extract the first entry
+ assertThat(StringUtils.join(changelog.extractSectionForVersion("1\\.6"),"\n"), is(EXPECTED_1_6_SECTION));
+
+ // Extract an entry in the middle
+ assertThat(StringUtils.join(changelog.extractSectionForVersion("1\\.6\\.M01"),"\n"), is(EXPECTED_1_6_M01_SECTION));
+
+ // Extract the last entry
+ assertThat(StringUtils.join(changelog.extractSectionForVersion("0\\.1"),"\n"), is(EXPECTED_0_1_SECTION));
+
+ // Extract all 1.6 entries, including milestones
+ VersionMatcher versionMatcher = new VersionMatcher("1\\.6","1\\.6\\.M.*");
+ assertThat(StringUtils.join(changelog.extractSectionForVersion(versionMatcher),"\n"), is(EXPECTED_1_6_SECTION + EXPECTED_1_6_M01_SECTION));
+
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.