diff --git a/.gitignore b/.gitignore index 0d52d70..795da38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,23 @@ +# MacOS +.DS_Store + +# Eclipse .classpath .project .settings/ +.factorypath + +# VSCode .vscode/ -*.sh + +# maven target/ + +# intelliJ +*.iml +.idea/ + +# Other + issue47.txt -maven-compiler-plugin/ \ No newline at end of file +.okhttpcache/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e6d5536 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,792 @@ +# Maven Confluence Plugin - Changelog + + + +## Next release +### Generic changes + +**update changelog** + + +[42d5623ace037c2](https://github.com/bsorrentino/maven-annotation-plugin/commit/42d5623ace037c2) bartolomeo sorrentino *2020-03-02 19:02:33* + +**update ignore** + + +[0d2cb8114432cbd](https://github.com/bsorrentino/maven-annotation-plugin/commit/0d2cb8114432cbd) bartolomeo sorrentino *2020-03-02 18:59:31* + +**add changelog support** + + +[57b41626d1e6ab3](https://github.com/bsorrentino/maven-annotation-plugin/commit/57b41626d1e6ab3) bsorrentino *2020-02-26 02:30:48* + +**move to next developer version** + + +[abd261ca0b3e498](https://github.com/bsorrentino/maven-annotation-plugin/commit/abd261ca0b3e498) bsorrentino *2020-02-24 23:31:45* + +**move to next developer version** + + +[6b5f170872c766f](https://github.com/bsorrentino/maven-annotation-plugin/commit/6b5f170872c766f) bsorrentino *2020-02-24 23:23:43* + +**update ignore** + + +[03482b5e2d2f909](https://github.com/bsorrentino/maven-annotation-plugin/commit/03482b5e2d2f909) bsorrentino *2020-02-24 23:21:23* + +**update ignore** + + +[23cfeff0350f118](https://github.com/bsorrentino/maven-annotation-plugin/commit/23cfeff0350f118) Bartolomeo Sorrentino *2019-04-23 15:36:20* + +**modernize code** + + +[5cc364404c3ba1c](https://github.com/bsorrentino/maven-annotation-plugin/commit/5cc364404c3ba1c) Bartolomeo Sorrentino *2019-04-23 15:36:10* + +**update pom for next major release** + + +[0f00f5860ba309f](https://github.com/bsorrentino/maven-annotation-plugin/commit/0f00f5860ba309f) Bartolomeo Sorrentino *2019-04-23 15:28:09* + +**remove netbeans references** + + +[04a8f939627a8ac](https://github.com/bsorrentino/maven-annotation-plugin/commit/04a8f939627a8ac) Bartolomeo Sorrentino *2019-04-22 17:00:51* + +**override method addModules in javax.tools.JavaCompiler.CompilationTask** + + +[b7434e5617baa16](https://github.com/bsorrentino/maven-annotation-plugin/commit/b7434e5617baa16) bsorrentino *2019-04-12 15:07:59* + +**update readme** + + +[8065847d06dde32](https://github.com/bsorrentino/maven-annotation-plugin/commit/8065847d06dde32) bsorrentino *2018-08-12 13:56:30* + +**update readme** + + +[2d639c43eb66e2a](https://github.com/bsorrentino/maven-annotation-plugin/commit/2d639c43eb66e2a) bsorrentino *2018-08-12 13:54:32* + + +### [#79](https://github.com/bsorrentino/maven-annotation-plugin/issues/79) move to java9 *enhancement* + +**#79 add maven shell in docker** + + +[8000153b4e6b00a](https://github.com/bsorrentino/maven-annotation-plugin/commit/8000153b4e6b00a) bartolomeo sorrentino *2020-03-02 19:00:40* + +**#79 update readme** + + +[41242f465f6b338](https://github.com/bsorrentino/maven-annotation-plugin/commit/41242f465f6b338) bartolomeo sorrentino *2020-03-02 18:58:10* + +**#79 add docker to test jdk version** + + +[afcff71d8a5b9f4](https://github.com/bsorrentino/maven-annotation-plugin/commit/afcff71d8a5b9f4) bartolomeo sorrentino *2020-03-02 18:56:28* + +**issue #79** + + * make multimodule project + +[3ec2718dfe15dab](https://github.com/bsorrentino/maven-annotation-plugin/commit/3ec2718dfe15dab) bsorrentino *2020-02-26 03:37:03* + +**issue #79** + + * code refactoring + * update source / target to java 9 + * upgrade dependencies + +[f84460766d58da5](https://github.com/bsorrentino/maven-annotation-plugin/commit/f84460766d58da5) bsorrentino *2020-02-26 02:09:21* + + +## v3.3.3 +### Generic changes + +**update release** + + +[393a51d1639f1ea](https://github.com/bsorrentino/maven-annotation-plugin/commit/393a51d1639f1ea) bsorrentino *2018-02-24 11:45:59* + +**merge hotfix** + + +[df019e60082b212](https://github.com/bsorrentino/maven-annotation-plugin/commit/df019e60082b212) bsorrentino *2017-09-12 09:09:09* + +**merge hotfix** + + +[f1dde13e924cb73](https://github.com/bsorrentino/maven-annotation-plugin/commit/f1dde13e924cb73) bsorrentino *2017-09-12 09:07:36* + +**update readme** + + +[f37985e048b01f1](https://github.com/bsorrentino/maven-annotation-plugin/commit/f37985e048b01f1) bsorrentino *2017-09-12 09:06:18* + +**update doc** + + +[469b8c60cbb92c8](https://github.com/bsorrentino/maven-annotation-plugin/commit/469b8c60cbb92c8) bsorrentino *2017-09-07 11:44:17* + +**update readme** + + +[00b4ca81a0472f4](https://github.com/bsorrentino/maven-annotation-plugin/commit/00b4ca81a0472f4) bsorrentino *2017-09-07 11:24:33* + +**update readme** + + +[667baa6d69b44b0](https://github.com/bsorrentino/maven-annotation-plugin/commit/667baa6d69b44b0) bsorrentino *2017-09-07 11:23:25* + +**update readme** + + +[a0d31294e3e7551](https://github.com/bsorrentino/maven-annotation-plugin/commit/a0d31294e3e7551) bsorrentino *2017-09-07 11:20:28* + +**update to next version** + + +[1c2ff82d8877d45](https://github.com/bsorrentino/maven-annotation-plugin/commit/1c2ff82d8877d45) bsorrentino *2017-09-07 11:13:26* + + +### [#72](https://github.com/bsorrentino/maven-annotation-plugin/issues/72) Multiple executions of plugin *question* + +**Issue #72 - Add notes to documentation** + + +[babeeb619ce69ab](https://github.com/bsorrentino/maven-annotation-plugin/commit/babeeb619ce69ab) bsorrentino *2018-08-12 13:39:42* + + +### [#75](https://github.com/bsorrentino/maven-annotation-plugin/issues/75) Add support for Java9 --release parameter *enhancement* + +**add support for --relase option #75** + + +[9bd60c8b23aa980](https://github.com/bsorrentino/maven-annotation-plugin/commit/9bd60c8b23aa980) bsorrentino *2017-11-28 23:32:56* + + +## v3.3.2 +### Generic changes + +**update README** + + +[4619f9670511292](https://github.com/bsorrentino/maven-annotation-plugin/commit/4619f9670511292) bsorrentino *2017-09-07 10:52:30* + +**prepare for release** + + +[7a6ee16de022056](https://github.com/bsorrentino/maven-annotation-plugin/commit/7a6ee16de022056) bsorrentino *2017-09-07 10:43:46* + +**Windows path separator fix** + + +[d22ab3b8a0be5b3](https://github.com/bsorrentino/maven-annotation-plugin/commit/d22ab3b8a0be5b3) Christian Beikov *2017-09-07 10:25:59* + +**Pass through additional compiler arguments** + + * This will allow to pass arguments like "--add-modules=java.se.ee" as `compilerArguments` + +[fed8bfecc523ec9](https://github.com/bsorrentino/maven-annotation-plugin/commit/fed8bfecc523ec9) Christian Beikov *2017-09-07 10:06:58* + +**update ignore** + + +[ef30ce5fdb71f82](https://github.com/bsorrentino/maven-annotation-plugin/commit/ef30ce5fdb71f82) bsorrentino *2017-07-30 16:11:50* + +**merge from hotfix** + + +[a8d17f63fe747b5](https://github.com/bsorrentino/maven-annotation-plugin/commit/a8d17f63fe747b5) bsorrentino *2017-04-11 20:30:30* + +**update test version** + + +[d5b95a9ac4845f6](https://github.com/bsorrentino/maven-annotation-plugin/commit/d5b95a9ac4845f6) bsorrentino *2017-04-11 20:29:06* + +**update test version** + + +[276e977ec9dfc29](https://github.com/bsorrentino/maven-annotation-plugin/commit/276e977ec9dfc29) bsorrentino *2017-04-11 20:28:07* + +**move to next version** + + +[9d9a5d185241e67](https://github.com/bsorrentino/maven-annotation-plugin/commit/9d9a5d185241e67) bsorrentino *2017-04-11 20:25:40* + + +### [#68](https://github.com/bsorrentino/maven-annotation-plugin/issues/68) License inconsistency + +**#68 - update license tag** + + +[1e43ba3b13f4ccb](https://github.com/bsorrentino/maven-annotation-plugin/commit/1e43ba3b13f4ccb) bsorrentino *2017-07-30 16:10:49* + + +### [#69](https://github.com/bsorrentino/maven-annotation-plugin/issues/69) Java 9 support *enhancement* + +**fix #69 merge #70** + + * Merge branch 'release/3.3.2' + +[694b5232f4369d5](https://github.com/bsorrentino/maven-annotation-plugin/commit/694b5232f4369d5) bsorrentino *2017-09-07 11:07:24* + +**#69 remove redundant if** + + +[4cefcc36056e9af](https://github.com/bsorrentino/maven-annotation-plugin/commit/4cefcc36056e9af) bsorrentino *2017-09-07 10:38:51* + + +### [#70](https://github.com/bsorrentino/maven-annotation-plugin/pull/70) Pass through additional compiler arguments *enhancement* + +**fix #69 merge #70** + + * Merge branch 'release/3.3.2' + +[694b5232f4369d5](https://github.com/bsorrentino/maven-annotation-plugin/commit/694b5232f4369d5) bsorrentino *2017-09-07 11:07:24* + + +## v3.3.1 +### Generic changes + +**prepare release** + + +[91113cb72b411ac](https://github.com/bsorrentino/maven-annotation-plugin/commit/91113cb72b411ac) bsorrentino *2017-04-11 20:16:30* + +**move to next dev version** + + +[6709b3a8f23fc9f](https://github.com/bsorrentino/maven-annotation-plugin/commit/6709b3a8f23fc9f) bsorrentino *2017-04-10 17:38:10* + +**add support of env vars : maven.processor.source & maven.processor.target** + + +[4e81968ea5ee538](https://github.com/bsorrentino/maven-annotation-plugin/commit/4e81968ea5ee538) bsorrentino *2017-04-09 11:10:32* + +**finalize Toolchain integration** + + +[5dc726a14ca66cc](https://github.com/bsorrentino/maven-annotation-plugin/commit/5dc726a14ca66cc) bsorrentino *2017-04-09 10:58:55* + +**add ToolchainManager component** + + +[0e6e2947d94ccbc](https://github.com/bsorrentino/maven-annotation-plugin/commit/0e6e2947d94ccbc) bsorrentino *2017-04-08 20:04:57* + +**update** + + +[40a6e2ec2ab4686](https://github.com/bsorrentino/maven-annotation-plugin/commit/40a6e2ec2ab4686) bsorrentino *2017-03-28 16:14:31* + +**Customize Plexus Compiler to capture output** + + +[8ce007e4f1f97d0](https://github.com/bsorrentino/maven-annotation-plugin/commit/8ce007e4f1f97d0) bsorrentino *2017-03-28 11:08:12* + +**plexus compiler refinements** + + +[384cc666c61d4ce](https://github.com/bsorrentino/maven-annotation-plugin/commit/384cc666c61d4ce) bsorrentino *2017-03-27 22:45:50* + +**add support of plexus compiler** + + +[91128bea35178d1](https://github.com/bsorrentino/maven-annotation-plugin/commit/91128bea35178d1) bsorrentino *2017-03-21 17:14:50* + +**move to next develop version** + + +[75059592db5173e](https://github.com/bsorrentino/maven-annotation-plugin/commit/75059592db5173e) bsorrentino *2017-03-09 16:39:07* + + +### [#66](https://github.com/bsorrentino/maven-annotation-plugin/issues/66) (use -source 8 or higher to enable lambda expressions) *bug* + +**fix issue#66 and issue#67** + + +[c5dd497e8f2477a](https://github.com/bsorrentino/maven-annotation-plugin/commit/c5dd497e8f2477a) bsorrentino *2017-04-11 20:00:12* + + +### [#67](https://github.com/bsorrentino/maven-annotation-plugin/issues/67) from version 3.3 options are not taking in consideration *bug* + +**fix issue#66 and issue#67** + + +[c5dd497e8f2477a](https://github.com/bsorrentino/maven-annotation-plugin/commit/c5dd497e8f2477a) bsorrentino *2017-04-11 20:00:12* + + +## v3.3 +### Generic changes + +**update comments** + + +[063f735be3a4227](https://github.com/bsorrentino/maven-annotation-plugin/commit/063f735be3a4227) bsorrentino *2017-04-10 17:34:50* + +**update readme** + + +[fa257b153e9cb95](https://github.com/bsorrentino/maven-annotation-plugin/commit/fa257b153e9cb95) bsorrentino *2017-04-10 13:20:19* + +**update site doc** + + +[165ad0853b3ed37](https://github.com/bsorrentino/maven-annotation-plugin/commit/165ad0853b3ed37) bsorrentino *2017-04-10 13:18:45* + +**update README** + + +[b36c0435ecb71e2](https://github.com/bsorrentino/maven-annotation-plugin/commit/b36c0435ecb71e2) bsorrentino *2017-04-09 17:59:47* + +**update readme** + + +[83635f07abf09eb](https://github.com/bsorrentino/maven-annotation-plugin/commit/83635f07abf09eb) bsorrentino *2017-04-09 17:44:03* + +**prepare for release** + + +[fc0f4631c9e0a08](https://github.com/bsorrentino/maven-annotation-plugin/commit/fc0f4631c9e0a08) bsorrentino *2017-04-09 17:33:55* + +**update doc** + + +[eeb362efe21faa7](https://github.com/bsorrentino/maven-annotation-plugin/commit/eeb362efe21faa7) bsorrentino *2016-10-07 13:24:41* + + +## v3.2.0 +### Generic changes + +**update for release 3.2.0** + + +[c144aec79429c54](https://github.com/bsorrentino/maven-annotation-plugin/commit/c144aec79429c54) bsorrentino *2016-10-07 13:07:59* + +**get sourcepath from project.getCompileSourceRoot()** + + +[29deb573c93a757](https://github.com/bsorrentino/maven-annotation-plugin/commit/29deb573c93a757) bsorrentino *2016-09-28 11:37:34* + +**update projects description** + + +[0b6bc2c37173a44](https://github.com/bsorrentino/maven-annotation-plugin/commit/0b6bc2c37173a44) bsorrentino *2016-09-12 14:57:20* + +**add utils and test project** + + +[30bbb057c63be23](https://github.com/bsorrentino/maven-annotation-plugin/commit/30bbb057c63be23) bsorrentino *2016-09-12 14:43:45* + +**add -sourcepath option** + + +[94f1fe0ff5aa55e](https://github.com/bsorrentino/maven-annotation-plugin/commit/94f1fe0ff5aa55e) bsorrentino *2016-09-12 14:30:30* + +**update links** + + +[7b10c05f908a8a4](https://github.com/bsorrentino/maven-annotation-plugin/commit/7b10c05f908a8a4) bsorrentino *2016-02-02 22:30:10* + +**update to next development release** + + +[eee1a25b33dc0c3](https://github.com/bsorrentino/maven-annotation-plugin/commit/eee1a25b33dc0c3) bsorrentino *2016-02-02 22:28:00* + + +## v3.1.0 +### Generic changes + +**update README** + + +[b0f2f4fd56a3264](https://github.com/bsorrentino/maven-annotation-plugin/commit/b0f2f4fd56a3264) bsorrentino *2016-02-02 22:24:48* + +**Add "skip" property to MOJOs** + + * This fixes https://github.com/bsorrentino/maven-annotation-plugin/issues/59 + +[c674eaa8be96a44](https://github.com/bsorrentino/maven-annotation-plugin/commit/c674eaa8be96a44) Boris Brodski *2016-01-28 17:50:04* + +**update doc** + + +[41973e17f79b1fd](https://github.com/bsorrentino/maven-annotation-plugin/commit/41973e17f79b1fd) bsorrentino *2015-04-07 16:18:50* + +**update issues link** + + +[d6b9599560fc01e](https://github.com/bsorrentino/maven-annotation-plugin/commit/d6b9599560fc01e) bsorrentino *2015-04-07 16:17:24* + +**update site** + + +[215d2050a509f44](https://github.com/bsorrentino/maven-annotation-plugin/commit/215d2050a509f44) bsorrentino *2015-03-19 20:35:37* + +**update doc** + + +[3a301b758d984ac](https://github.com/bsorrentino/maven-annotation-plugin/commit/3a301b758d984ac) bsorrentino *2015-03-19 20:31:19* + +**Create README.md** + + +[b8a9ccfd2c97357](https://github.com/bsorrentino/maven-annotation-plugin/commit/b8a9ccfd2c97357) bsorrentino *2015-03-18 14:21:44* + +**update site skin** + + +[fe5256ee0da3045](https://github.com/bsorrentino/maven-annotation-plugin/commit/fe5256ee0da3045) bsorrentino *2014-06-28 21:05:37* + + +### [#61](https://github.com/bsorrentino/maven-annotation-plugin/pull/61) Add "skip" property to MOJOs + +**pull request #61 merged** + + * site deploy on branch gh-pages automated + * site plugin updated + +[05e9e0e92cb38ee](https://github.com/bsorrentino/maven-annotation-plugin/commit/05e9e0e92cb38ee) bsorrentino *2016-02-02 21:57:32* + + +## maven-processor-plugin-3.1.0-beta1 +### Generic changes + +**update compiler plugin version** + + +[f1b29c955fe99be](https://github.com/bsorrentino/maven-annotation-plugin/commit/f1b29c955fe99be) bsorrentino *2014-06-28 16:54:08* + +**fix issue 56** + + +[b0b4a24b15a5cff](https://github.com/bsorrentino/maven-annotation-plugin/commit/b0b4a24b15a5cff) bsorrentino *2014-06-28 16:39:52* + +**fix problem on windows os** + + +[35541bcd173d4c0](https://github.com/bsorrentino/maven-annotation-plugin/commit/35541bcd173d4c0) bsorrentino *2013-09-18 13:00:14* + +**update error message** + + +[3746795747919e0](https://github.com/bsorrentino/maven-annotation-plugin/commit/3746795747919e0) bsorrentino *2013-09-17 09:49:16* + +**require maven 3.1** + + +[65188be477a8ca2](https://github.com/bsorrentino/maven-annotation-plugin/commit/65188be477a8ca2) bsorrentino *2013-09-15 20:52:29* + +**issue55 plugin for maven release 3.1.0** + + +[79bd3e63fe9b3af](https://github.com/bsorrentino/maven-annotation-plugin/commit/79bd3e63fe9b3af) bsorrentino *2013-09-15 20:48:34* + +**issue55 plugin for maven release 3.0.5** + + +[0a2400736eccf2e](https://github.com/bsorrentino/maven-annotation-plugin/commit/0a2400736eccf2e) bsorrentino *2013-09-15 20:28:42* + +**issue55** + + +[6106c78b7de5e53](https://github.com/bsorrentino/maven-annotation-plugin/commit/6106c78b7de5e53) bsorrentino *2013-09-15 19:20:37* + + +## maven-processor-plugin-2.2.4 +### Generic changes + +**Issue 54** + + +[e92be425742664f](https://github.com/bsorrentino/maven-annotation-plugin/commit/e92be425742664f) softphone *2013-06-14 19:44:13* + + +## maven-processor-plugin-2.2.3 +### Generic changes + +**Issue 53** + + +[60db10784d6b596](https://github.com/bsorrentino/maven-annotation-plugin/commit/60db10784d6b596) softphone *2013-05-22 20:53:02* + + +## maven-processor-plugin-2.2.2 +### Generic changes + +**Issue 48** + + +[70957ebf1386ce3](https://github.com/bsorrentino/maven-annotation-plugin/commit/70957ebf1386ce3) softphone *2013-05-14 13:28:18* + + +## maven-processor-plugin-2.2.1 +### Generic changes + +**Issue 51** + + +[bbfd5ea26f874c0](https://github.com/bsorrentino/maven-annotation-plugin/commit/bbfd5ea26f874c0) softphone *2013-04-06 12:34:06* + + +## maven-processor-plugin-2.2.0 +### Generic changes + +**merge patch from Heiko Braun** + + +[c7f9172bc143a11](https://github.com/bsorrentino/maven-annotation-plugin/commit/c7f9172bc143a11) bsorrentino *2013-04-03 15:32:13* + + +## maven-processor-plugin-2.1.1 +### Generic changes + +**issue 47** + + +[68d6174fd75a59d](https://github.com/bsorrentino/maven-annotation-plugin/commit/68d6174fd75a59d) softphone *2013-01-30 13:43:39* + +**update unit test** + + +[e29da4cf58db458](https://github.com/bsorrentino/maven-annotation-plugin/commit/e29da4cf58db458) softphone *2013-01-26 21:19:00* + + +## maven-processor-plugin-2.1.0 +### Generic changes + +**issue46** + + +[20a4b6ad38e80f8](https://github.com/bsorrentino/maven-annotation-plugin/commit/20a4b6ad38e80f8) softphone *2012-11-01 13:50:49* + +**allow maven3 report generation** + + +[64b0901fbc675e2](https://github.com/bsorrentino/maven-annotation-plugin/commit/64b0901fbc675e2) softphone *2012-10-17 21:32:51* + + +## maven-processor-plugin-2.1.0-beta1 +### Generic changes + +**update docs url** + + +[77f6a994384d49d](https://github.com/bsorrentino/maven-annotation-plugin/commit/77f6a994384d49d) softphone *2012-10-17 20:23:32* + +**organize import** + + +[9309c89f4d2bfa8](https://github.com/bsorrentino/maven-annotation-plugin/commit/9309c89f4d2bfa8) softphone *2012-10-17 18:51:21* + +**Issue 44** + + +[57a0baf1a1cc8b0](https://github.com/bsorrentino/maven-annotation-plugin/commit/57a0baf1a1cc8b0) bsorrentino *2012-10-12 16:02:24* + + +## maven-processor-plugin-2.0.8 +### Generic changes + +**update release** + + +[e7a28e644424dc5](https://github.com/bsorrentino/maven-annotation-plugin/commit/e7a28e644424dc5) bsorrentino *2012-10-09 09:05:32* + +**Issue 43** + + +[d5ca7ea13f28c38](https://github.com/bsorrentino/maven-annotation-plugin/commit/d5ca7ea13f28c38) bsorrentino *2012-10-08 15:14:37* + + +## maven-processor-plugin-2.0.7 +### Generic changes + +**revert to 7c9b55a41816** + + +[0ed5a71475e76d4](https://github.com/bsorrentino/maven-annotation-plugin/commit/0ed5a71475e76d4) bsorrentino *2012-10-09 08:13:17* + +**Issue 42** + + +[7c9b55a41816270](https://github.com/bsorrentino/maven-annotation-plugin/commit/7c9b55a41816270) bsorrentino *2012-08-27 14:47:44* + +**Issue 43** + + +[34ac342d30de616](https://github.com/bsorrentino/maven-annotation-plugin/commit/34ac342d30de616) softphone *2012-08-26 18:41:20* + +**Issue 42 apply patch** + + +[5f82c3d82f3d3c9](https://github.com/bsorrentino/maven-annotation-plugin/commit/5f82c3d82f3d3c9) bsorrentino *2012-08-26 17:21:54* + + +## maven-processor-plugin-2.0.6 +### Generic changes + +**update scm to git** + + +[54d09d93cad49e8](https://github.com/bsorrentino/maven-annotation-plugin/commit/54d09d93cad49e8) bsorrentino *2012-08-07 08:23:05* + +**update** + + +[4c7b75962c4446b](https://github.com/bsorrentino/maven-annotation-plugin/commit/4c7b75962c4446b) bsorrentino *2012-08-07 08:16:47* + +**update ignore** + + +[a480a4273587a61](https://github.com/bsorrentino/maven-annotation-plugin/commit/a480a4273587a61) bsorrentino *2012-08-07 08:13:53* + +**sync refinements** + + +[bf958dd87dd0dcd](https://github.com/bsorrentino/maven-annotation-plugin/commit/bf958dd87dd0dcd) bsorrentino *2012-06-26 07:56:40* + +**first import** + + +[fe72619e8ba7d55](https://github.com/bsorrentino/maven-annotation-plugin/commit/fe72619e8ba7d55) bsorrentino *2012-06-25 20:29:30* + +**initial import** + + +[a6874bc1ff14c88](https://github.com/bsorrentino/maven-annotation-plugin/commit/a6874bc1ff14c88) bsorrentino *2012-06-25 16:48:43* + +**update** + + +[7947063192fb47f](https://github.com/bsorrentino/maven-annotation-plugin/commit/7947063192fb47f) bsorrentino *2012-06-25 16:44:59* + +**git-svn-id: https://projectname.googlecode.com/svn/trunk@23 c416075f-80b4-e980-4839-00ea3ed24e77** + + +[55f7bad93e6f969](https://github.com/bsorrentino/maven-annotation-plugin/commit/55f7bad93e6f969) valery.isaev@gmail.com *2011-05-30 22:19:40* + +**git-svn-id: https://projectname.googlecode.com/svn/trunk@22 c416075f-80b4-e980-4839-00ea3ed24e77** + + +[95968c267a723a9](https://github.com/bsorrentino/maven-annotation-plugin/commit/95968c267a723a9) valery.isaev@gmail.com *2011-05-30 19:34:39* + +**autotools** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@21 c416075f-80b4-e980-4839-00ea3ed24e77 + +[b81461aaf2af6b6](https://github.com/bsorrentino/maven-annotation-plugin/commit/b81461aaf2af6b6) valery.isaev@gmail.com *2011-05-30 13:28:43* + +**git-svn-id: https://projectname.googlecode.com/svn/trunk@20 c416075f-80b4-e980-4839-00ea3ed24e77** + + +[df3bfd087410566](https://github.com/bsorrentino/maven-annotation-plugin/commit/df3bfd087410566) valery.isaev@gmail.com *2011-05-29 13:07:53* + +**config** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@19 c416075f-80b4-e980-4839-00ea3ed24e77 + +[2a0f098cf259a56](https://github.com/bsorrentino/maven-annotation-plugin/commit/2a0f098cf259a56) valery.isaev@gmail.com *2011-05-27 21:57:33* + +**git-svn-id: https://projectname.googlecode.com/svn/trunk@18 c416075f-80b4-e980-4839-00ea3ed24e77** + + +[bffbbceebf2f845](https://github.com/bsorrentino/maven-annotation-plugin/commit/bffbbceebf2f845) valery.isaev@gmail.com *2011-04-25 11:23:57* + +**magic added** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@17 c416075f-80b4-e980-4839-00ea3ed24e77 + +[7db308b4bc8d4f2](https://github.com/bsorrentino/maven-annotation-plugin/commit/7db308b4bc8d4f2) valery.isaev@gmail.com *2011-03-28 13:19:58* + +**minor fixes** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@16 c416075f-80b4-e980-4839-00ea3ed24e77 + +[9a616dc849b8a73](https://github.com/bsorrentino/maven-annotation-plugin/commit/9a616dc849b8a73) valery.isaev@gmail.com *2011-03-28 00:04:58* + +**image comparison** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@15 c416075f-80b4-e980-4839-00ea3ed24e77 + +[ac33873072edf71](https://github.com/bsorrentino/maven-annotation-plugin/commit/ac33873072edf71) valery.isaev@gmail.com *2011-03-27 22:33:28* + +**precompare** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@14 c416075f-80b4-e980-4839-00ea3ed24e77 + +[ab43a43c581bdfc](https://github.com/bsorrentino/maven-annotation-plugin/commit/ab43a43c581bdfc) valery.isaev@gmail.com *2011-03-27 18:46:05* + +**missing files added** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@13 c416075f-80b4-e980-4839-00ea3ed24e77 + +[a0c5f27a0f67c1f](https://github.com/bsorrentino/maven-annotation-plugin/commit/a0c5f27a0f67c1f) valery.isaev@gmail.com *2011-03-23 19:32:10* + +**git-svn-id: https://projectname.googlecode.com/svn/trunk@12 c416075f-80b4-e980-4839-00ea3ed24e77** + + +[5b40a56e28847de](https://github.com/bsorrentino/maven-annotation-plugin/commit/5b40a56e28847de) valery.isaev@gmail.com *2011-03-23 18:39:30* + +**git-svn-id: https://projectname.googlecode.com/svn/trunk@11 c416075f-80b4-e980-4839-00ea3ed24e77** + + +[ae9b7905bf47ac5](https://github.com/bsorrentino/maven-annotation-plugin/commit/ae9b7905bf47ac5) valery.isaev@gmail.com *2011-03-23 08:17:42* + +**grouping comparator added** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@10 c416075f-80b4-e980-4839-00ea3ed24e77 + +[e752bc478c1bbff](https://github.com/bsorrentino/maven-annotation-plugin/commit/e752bc478c1bbff) valery.isaev@gmail.com *2011-03-22 21:26:59* + +**clusterization added** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@9 c416075f-80b4-e980-4839-00ea3ed24e77 + +[a397a365bb84d5f](https://github.com/bsorrentino/maven-annotation-plugin/commit/a397a365bb84d5f) valery.isaev@gmail.com *2011-03-21 21:07:17* + +**error handling added** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@8 c416075f-80b4-e980-4839-00ea3ed24e77 + +[87d1e30973e4751](https://github.com/bsorrentino/maven-annotation-plugin/commit/87d1e30973e4751) valery.isaev@gmail.com *2011-03-21 19:26:00* + +**git-svn-id: https://projectname.googlecode.com/svn/trunk@7 c416075f-80b4-e980-4839-00ea3ed24e77** + + +[9ad65ebfcff060b](https://github.com/bsorrentino/maven-annotation-plugin/commit/9ad65ebfcff060b) valery.isaev@gmail.com *2011-03-21 17:14:29* + +**add file types** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@6 c416075f-80b4-e980-4839-00ea3ed24e77 + +[26178ed3ba6920b](https://github.com/bsorrentino/maven-annotation-plugin/commit/26178ed3ba6920b) valery.isaev@gmail.com *2011-03-16 17:33:52* + +**added forgotten files** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@5 c416075f-80b4-e980-4839-00ea3ed24e77 + +[ec42fe6a4f5c3ea](https://github.com/bsorrentino/maven-annotation-plugin/commit/ec42fe6a4f5c3ea) valery.isaev@gmail.com *2011-03-15 17:55:23* + +**git-svn-id: https://projectname.googlecode.com/svn/trunk@4 c416075f-80b4-e980-4839-00ea3ed24e77** + + +[c5991caa924b465](https://github.com/bsorrentino/maven-annotation-plugin/commit/c5991caa924b465) valery.isaev@gmail.com *2011-03-15 17:54:25* + +**some makefile improvements** + + * added sequences + * git-svn-id: https://projectname.googlecode.com/svn/trunk@3 c416075f-80b4-e980-4839-00ea3ed24e77 + +[4b6a2bd4275193b](https://github.com/bsorrentino/maven-annotation-plugin/commit/4b6a2bd4275193b) valery.isaev@gmail.com *2011-03-14 11:09:56* + +**first commit** + + * git-svn-id: https://projectname.googlecode.com/svn/trunk@2 c416075f-80b4-e980-4839-00ea3ed24e77 + +[22a3c1b1a9be1a6](https://github.com/bsorrentino/maven-annotation-plugin/commit/22a3c1b1a9be1a6) valery.isaev@gmail.com *2011-03-13 00:01:25* + + diff --git a/README.md b/README.md index 37cc20c..48ee348 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,22 @@ This plugin could be considered the 'alter ego' of maven apt plugin http://mojo. * [ANNOTATION PROCESSING 101](http://hannesdorfmann.com/annotation-processing/annotationprocessing101) + +## Snapshot + + Date | Info +--- | --- +Currently | **[Release 4.0-SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/bsc/maven/maven-processor-plugin/4.0-SNAPSHOT/)** | available from **[MAVEN CENTRAL REPO]** | + ## Releases + Date | Info +--- | --- + **Mar 02, 2020** | [Release 4.0-beta1](https://github.com/bsorrentino/maven-confluence-plugin/releases/tag/v4.0-beta1) + + +## History + Aug 12,2018 | **Release 3.3.3**. | Available on **[MAVEN CENTRAL REPO](http://search.maven.org/#artifactdetails%7Corg.bsc.maven%7Cmaven-processor-plugin%7C3.3.3%7Cmaven-plugin)** | ----|----|---- diff --git a/changelog.json b/changelog.json new file mode 100644 index 0000000..a0b6a33 --- /dev/null +++ b/changelog.json @@ -0,0 +1,24 @@ +{ +"fromRepo": ".", +"toRef": "refs/heads/master", +//"fromCommit": "0000000000000000000000000000000000000000", +// "ignoreCommitsIfMessageMatches": "^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*", +// "readableTagName": "-([^-]+?)$", +// "dateFormat": "YYYY-MM-dd HH:mm:ss", +"untaggedName": "Next release", +"noIssueName": "Generic changes", +"timeZone": "UTC", +// "removeIssueFromMessage": "true", + +// "jiraServer": "https://jiraserver/jira", +// "jiraIssuePattern": "\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b", + +// "gitHubApi": "https://api.github.com/repos/bsorrentino/maven-confluence-plugin", +// "gitHubIssuePattern": "#([0-9]+)", + +// "customIssues": [ +// { "name": "Bugs", "pattern": "#bug" }, +// { "name": "Features", "pattern": "#feature" } +// ], +"void":"" +} diff --git a/changelog.mustache b/changelog.mustache new file mode 100644 index 0000000..94089b6 --- /dev/null +++ b/changelog.mustache @@ -0,0 +1,32 @@ +# Maven Confluence Plugin - Changelog + + + +{{#tags}} +## {{name}} + {{#issues}} + {{#hasIssue}} + {{#hasLink}} +### {{!name}} [{{issue}}]({{link}}) {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}} + {{/hasLink}} + {{^hasLink}} +### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}} + {{/hasLink}} + {{/hasIssue}} + {{^hasIssue}} +### {{name}} + {{/hasIssue}} + + {{#commits}} +**{{{messageTitle}}}** + +{{#messageBodyItems}} + * {{.}} +{{/messageBodyItems}} + +[{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}* + + {{/commits}} + + {{/issues}} +{{/tags}} diff --git a/pom.xml b/pom.xml index d32e037..22ccb75 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,10 @@ 4.0.0 org.bsc.maven - maven-processor-plugin - maven-plugin - 3.3.3 - MAVEN PROCESSOR PLUGIN - ${project.version} + maven-processor-plugin-parent + pom + 4.0-beta1 + MAVEN PROCESSOR PLUGIN PARENT A maven plugin to process annotation for jdk6 at compile time This plugin helps to use from maven the new annotation processing provided by JDK6 integrated in java compiler @@ -13,7 +13,7 @@ This plugin could be considered the 'alter ego' of maven apt plugin http://mojo. https://github.com/bsorrentino/maven-annotation-plugin - 3.1 + 3.5 @@ -26,15 +26,12 @@ This plugin could be considered the 'alter ego' of maven apt plugin http://mojo. ${snapshot.repo.url} false - - ${release.site.id} - ${release.site.url} - + 1.9 + 1.9 UTF-8 - 3.1.0 sonatype-repo https://oss.sonatype.org/content/repositories/snapshots @@ -81,261 +78,141 @@ This plugin could be considered the 'alter ego' of maven apt plugin http://mojo. - - - - org.codehaus.plexus - plexus-compiler-api - 2.8.2 - - - org.codehaus.plexus - plexus-compiler-manager - 2.8.2 - - - org.codehaus.plexus - plexus-compiler-javac - 2.8.2 - compile - - - - - - org.apache.maven - maven-plugin-api - ${maven.release} - - - org.apache.maven - maven-core - ${maven.release} - + + processor + utils + + + + + - - - org.apache.maven.plugin-tools - maven-plugin-annotations - 3.2 - - - - org.codehaus.plexus - plexus-utils - 3.0.15 - - - org.codehaus.plexus - plexus-compiler-api - - - org.codehaus.plexus - plexus-compiler-manager - - - org.codehaus.plexus - plexus-compiler-javac - + junit junit - 4.11 + 4.13 test + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + + org.apache.maven.plugins + maven-site-plugin + 3.8.2 + + + + io.fabric8 + docker-maven-plugin + 0.33.0 + + + + - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.6 - 1.6 - - - - - org.apache.maven.plugins - maven-plugin-plugin - 3.1 - - true - - - - mojo-descriptor - - descriptor - - - - - help-goal - - helpmojo - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.4 - - - - org.apache.maven.plugin-tools - maven-plugin-annotations - 3.4 - runtime - - - - org.apache.maven.reporting - maven-reporting-exec - 1.2 - - - - org.apache.maven.doxia - doxia-module-markdown - 1.6 - - - + se.bjurr.gitchangelog + git-changelog-maven-plugin + false + 1.60 + - - - - org.apache.maven.plugins - maven-plugin-plugin - 3.4 - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.4 - - - - false - - - + changelog.json + CHANGELOG.md - - - + - - - - release - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.3 - - - - sign-artifacts - verify - - sign - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.5.1 - true - - sonatype-server - https://oss.sonatype.org/ - - - - - - - - - report - - - - - - - com.github.github - site-maven-plugin - 0.10 - - Creating site for ${project.version} - github - maven-annotation-plugin - bsorrentino - - - - - site - - site - - - - - - - - - - - + + + release + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-no-snapshots + + enforce + + verify + + + + No Snapshots Allowed! + + + true + + + + + + + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + --pinentry-mode + loopback + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.5.1 + true + + sonatype-server + https://oss.sonatype.org/ + + + + + + + diff --git a/processor/pom.xml b/processor/pom.xml new file mode 100644 index 0000000..dc81449 --- /dev/null +++ b/processor/pom.xml @@ -0,0 +1,219 @@ + + 4.0.0 + maven-processor-plugin + maven-plugin + MAVEN PROCESSOR PLUGIN + A maven plugin to process annotation for jdk6 at compile time + +This plugin helps to use from maven the new annotation processing provided by JDK6 integrated in java compiler + +This plugin could be considered the 'alter ego' of maven apt plugin http://mojo.codehaus.org/apt-maven-plugin/ + https://github.com/bsorrentino/maven-annotation-plugin + + + org.bsc.maven + maven-processor-plugin-parent + 4.0-beta1 + + + + 3.5.4 + 3.6.0 + 2.8.3 + + + + + + org.codehaus.plexus + plexus-compiler-api + ${plexus.compiler.version} + + + org.codehaus.plexus + plexus-compiler-manager + ${plexus.compiler.version} + + + org.codehaus.plexus + plexus-compiler-javac + ${plexus.compiler.version} + compile + + + + + + + org.apache.maven + maven-plugin-api + ${maven.plugin.version} + + + org.apache.maven + maven-core + ${maven.version} + + + + + org.apache.maven.plugin-tools + maven-plugin-annotations + ${maven.plugin.version} + + + + org.codehaus.plexus + plexus-utils + 3.1.1 + + + org.codehaus.plexus + plexus-compiler-api + + + org.codehaus.plexus + plexus-compiler-manager + + + org.codehaus.plexus + plexus-compiler-javac + + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + ${maven.plugin.version} + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.4 + + + + false + + + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.apache.maven.plugins + maven-plugin-plugin + ${maven.plugin.version} + + true + + + + mojo-descriptor + + descriptor + + + + + help-goal + + helpmojo + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + + + org.apache.maven.plugin-tools + maven-plugin-annotations + ${maven.plugin.version} + runtime + + + + org.apache.maven.reporting + maven-reporting-exec + 1.4 + + + + org.apache.maven.doxia + doxia-module-markdown + 1.9.1 + + + + + + + + + + + + + + + report + + + + + + com.github.github + site-maven-plugin + 0.10 + + Creating site for ${project.version} + github + maven-annotation-plugin + bsorrentino + + + + + site + + site + + + + + + + + + + + + + diff --git a/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java b/processor/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java similarity index 87% rename from src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java rename to processor/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java index 69901a6..56f0a72 100644 --- a/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java +++ b/processor/src/main/java/org/bsc/maven/plugin/processor/AbstractAnnotationProcessorMojo.java @@ -33,6 +33,7 @@ import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Consumer; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import javax.tools.JavaCompiler.CompilationTask; @@ -48,7 +49,6 @@ import org.apache.maven.project.MavenProject; import org.apache.maven.toolchain.Toolchain; import org.apache.maven.toolchain.ToolchainManager; -import org.bsc.function.Consumer; import org.codehaus.plexus.compiler.manager.CompilerManager; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; @@ -101,8 +101,7 @@ interface ArtifactClosure { /** * */ - //@MojoParameter(expression = "${project}", readonly = true, required = true) - @Component + @Parameter( defaultValue = "${project}", readonly = true ) protected MavenProject project; /** @@ -288,7 +287,7 @@ interface ArtifactClosure { * * @since 3.3 */ - @Component + @Parameter( defaultValue = "${session}", readonly = true ) protected MavenSession session; /** @@ -379,7 +378,7 @@ private String buildCompileSourcepath( Consumer onSuccess) { private String buildCompileClasspath() { - java.util.Set pathElements = new java.util.LinkedHashSet(); + final java.util.Set pathElements = new java.util.LinkedHashSet<>(); if( pluginArtifacts!=null ) { @@ -522,14 +521,12 @@ private void executeWithExceptionsHandled() throws Exception if( additionalSourceDirectories != null && !additionalSourceDirectories.isEmpty() ) { sourceDirs.addAll( additionalSourceDirectories ); } - - + if( sourceDirs == null ) { throw new IllegalStateException("getSourceDirectories is null!"); } - - - List files = new java.util.ArrayList(); + + final List files = new java.util.ArrayList<>(); for( File sourceDir : sourceDirs ) { @@ -548,35 +545,29 @@ private void executeWithExceptionsHandled() throws Exception getLog().warn( String.format("source directory [%s] is invalid! Processor task will be skipped!", sourceDir.getPath())); continue; } - files.addAll( FileUtils.getFiles(sourceDir, includesString, excludesString) ); } - final String compileClassPath = buildCompileClasspath(); final String processor = buildProcessor(); - final List options = new ArrayList(10); + final List options = new ArrayList<>(10); options.add("-cp"); options.add(compileClassPath); - buildCompileSourcepath( new Consumer() { - public void accept(String sourcepath) { - + buildCompileSourcepath( sourcepath -> { options.add("-sourcepath"); options.add(sourcepath); - } }); options.add("-proc:only"); addCompilerArguments(options); - if (processor != null) - { + if (processor != null) { options.add("-processor"); options.add(processor); } @@ -602,45 +593,39 @@ public void accept(String sourcepath) { } } - final DiagnosticListener dl = new DiagnosticListener() - { - @Override - public void report(Diagnostic< ? extends JavaFileObject> diagnostic) { + final DiagnosticListener dl = diagnostic -> { - if (!outputDiagnostics) { - return; - } - - final Kind kind = diagnostic.getKind(); - - if (null != kind) - switch (kind) { - case ERROR: - getLog().error(String.format("diagnostic: %s", diagnostic)); - break; - case MANDATORY_WARNING: - case WARNING: - getLog().warn(String.format("diagnostic: %s", diagnostic)); - break; - case NOTE: - getLog().info(String.format("diagnostic: %s", diagnostic)); - break; - case OTHER: - getLog().info(String.format("diagnostic: %s", diagnostic)); - break; - default: - break; - } + if (!outputDiagnostics) { + return; + } + final Kind kind = diagnostic.getKind(); + + if (null != kind) + switch (kind) { + case ERROR: + getLog().error(String.format("diagnostic: %s", diagnostic)); + break; + case MANDATORY_WARNING: + case WARNING: + getLog().warn(String.format("diagnostic: %s", diagnostic)); + break; + case NOTE: + getLog().info(String.format("diagnostic: %s", diagnostic)); + break; + case OTHER: + getLog().info(String.format("diagnostic: %s", diagnostic)); + break; + default: + break; } + }; - if (systemProperties != null) - { + if (systemProperties != null) { java.util.Set< Map.Entry> pSet = systemProperties.entrySet(); - for ( Map.Entry e : pSet ) - { + for ( Map.Entry e : pSet ) { getLog().debug( String.format("set system property : [%s] = [%s]", e.getKey(), e.getValue() )); System.setProperty(e.getKey(), e.getValue()); } @@ -650,36 +635,32 @@ public void report(Diagnostic< ? extends JavaFileObject> diagnostic) { // // add to allSource the files coming out from source archives // - final List allSources = new java.util.ArrayList(); + final List allSources = new java.util.ArrayList<>(); - processSourceArtifacts( new ArtifactClosure() { + processSourceArtifacts( artifact -> { + try { - @Override - public void execute(Artifact artifact) { - try { - - java.io.File f = artifact.getFile(); + File f = artifact.getFile(); - ZipFile zipFile = new ZipFile(f); - Enumeration entries = zipFile.entries(); - int sourceCount = 0; + ZipFile zipFile = new ZipFile(f); + Enumeration entries = zipFile.entries(); + int sourceCount = 0; - while (entries.hasMoreElements()) { - ZipEntry entry = (ZipEntry) entries.nextElement(); + while (entries.hasMoreElements()) { + final ZipEntry entry = entries.nextElement(); - if (entry.getName().endsWith(".java")) { - ++sourceCount; - allSources.add(ZipFileObject.create(zipFile, entry)); + if (entry.getName().endsWith(".java")) { + ++sourceCount; + allSources.add(ZipFileObject.create(zipFile, entry)); - } } - - getLog().debug(String.format("** Discovered %d java sources in %s", sourceCount, f.getAbsolutePath())); - - } catch (Exception ex) { - getLog().warn(String.format("Problem reading source archive [%s]", artifact.getFile().getPath())); - getLog().debug(ex); } + + getLog().debug(String.format("** Discovered %d java sources in %s", sourceCount, f.getAbsolutePath())); + + } catch (Exception ex) { + getLog().warn(String.format("Problem reading source archive [%s]", artifact.getFile().getPath())); + getLog().debug(ex); } }); @@ -743,26 +724,20 @@ public void execute(Artifact artifact) { allSources.add(f); }; - - - + } - - - + if( allSources.isEmpty() ) { getLog().warn( "no source file(s) detected! Processor task will be skipped"); return; } - final Iterable classes = null; - - CompilationTask task = compiler.getTask( + final CompilationTask task = compiler.getTask( new PrintWriter(System.out), fileManager, dl, options, - classes, + null, allSources); /* @@ -775,9 +750,7 @@ public void execute(Artifact artifact) { */ // Perform the compilation task. - if (!task.call()) - { - + if (!task.call()) { throw new Exception("error during compilation"); } } @@ -804,18 +777,14 @@ private List scanSourceDirectorySources(File sourceDir) throws IOException final String includesString = ( includes==null || includes.length==0) ? "**/*.java" : StringUtils.join(includes, ","); final String excludesString = ( excludes==null || excludes.length==0) ? null : StringUtils.join(excludes, ","); - List files = FileUtils.getFiles(sourceDir, includesString, excludesString); + final List files = FileUtils.getFiles(sourceDir, includesString, excludesString); return files; } - private void addCompilerArguments(List options) - { - if (!StringUtils.isEmpty(compilerArguments)) - { - for (String arg : compilerArguments.split(" ")) - { - if (!StringUtils.isEmpty(arg)) - { + private void addCompilerArguments(List options) { + if (!StringUtils.isEmpty(compilerArguments)) { + for (String arg : compilerArguments.split(" ")) { + if (!StringUtils.isEmpty(arg)) { arg = arg.trim(); getLog().debug(String.format("Adding compiler arg: %s", arg)); options.add(arg); @@ -838,8 +807,7 @@ private void addCompilerArguments(List options) private void addOutputToSourcesIfNeeded() { final Boolean add = addOutputDirectoryToCompilationSources; - if (add == null || add.booleanValue()) - { + if (add == null || add.booleanValue()) { getLog().debug(String.format("Source directory: %s added", outputDirectory)); addCompileSourceRoot(project, outputDirectory.getAbsolutePath()); } @@ -848,8 +816,7 @@ private void addOutputToSourcesIfNeeded() private void ensureOutputDirectoryExists() { final File f = outputDirectory; - if (!f.exists()) - { + if (!f.exists()) { f.mkdirs(); } if( !getOutputClassDirectory().exists()) { @@ -900,13 +867,11 @@ private Artifact resolveSourceArtifact( Artifact dep ) throws ArtifactResolution final ArtifactTypeRegistry typeReg = repoSession.getArtifactTypeRegistry(); - final String extension = null; - - final DefaultArtifact artifact = + final DefaultArtifact artifact = new DefaultArtifact( dep.getGroupId(), dep.getArtifactId(), SOURCE_CLASSIFIER, - extension, + null, dep.getVersion(), typeReg.get(dep.getType())); diff --git a/src/main/java/org/bsc/maven/plugin/processor/AnnotationProcessorCompiler.java b/processor/src/main/java/org/bsc/maven/plugin/processor/AnnotationProcessorCompiler.java similarity index 98% rename from src/main/java/org/bsc/maven/plugin/processor/AnnotationProcessorCompiler.java rename to processor/src/main/java/org/bsc/maven/plugin/processor/AnnotationProcessorCompiler.java index dba6841..3174948 100644 --- a/src/main/java/org/bsc/maven/plugin/processor/AnnotationProcessorCompiler.java +++ b/processor/src/main/java/org/bsc/maven/plugin/processor/AnnotationProcessorCompiler.java @@ -266,7 +266,7 @@ public static JavaCompiler createInProcess() { return ToolProvider.getSystemJavaCompiler(); } - private static void printCommand( final org.codehaus.plexus.compiler.Compiler javac, + static void printCommand( final org.codehaus.plexus.compiler.Compiler javac, final CompilerConfiguration javacConf, final java.io.PrintWriter out ) throws CompilerException { @@ -412,6 +412,11 @@ public void setLocale(Locale locale) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + @Override + public void addModules(Iterable moduleNames) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + @Override public Boolean call() { try { @@ -457,6 +462,7 @@ public String toString() { }); return false; } + } }; } diff --git a/src/main/java/org/bsc/maven/plugin/processor/MainAnnotationProcessorMojo.java b/processor/src/main/java/org/bsc/maven/plugin/processor/MainAnnotationProcessorMojo.java similarity index 95% rename from src/main/java/org/bsc/maven/plugin/processor/MainAnnotationProcessorMojo.java rename to processor/src/main/java/org/bsc/maven/plugin/processor/MainAnnotationProcessorMojo.java index a91c5ba..a8ac2b3 100644 --- a/src/main/java/org/bsc/maven/plugin/processor/MainAnnotationProcessorMojo.java +++ b/processor/src/main/java/org/bsc/maven/plugin/processor/MainAnnotationProcessorMojo.java @@ -69,26 +69,25 @@ public class MainAnnotationProcessorMojo extends AbstractAnnotationProcessorMojo private File outputClassDirectory; @Override - protected File getOutputClassDirectory() - { + protected File getOutputClassDirectory() { + return outputClassDirectory; } @Override - protected void addCompileSourceRoot(MavenProject project, String dir) - { + protected void addCompileSourceRoot(MavenProject project, String dir) { + project.addCompileSourceRoot(dir); } @Override - public File getDefaultOutputDirectory() - { + public File getDefaultOutputDirectory() { + return defaultOutputDirectory; } @Override - public java.util.Set getSourceDirectories( final java.util.Set result ) - { + public java.util.Set getSourceDirectories( final java.util.Set result ) { result.add( sourceDirectory ); return result; @@ -96,8 +95,7 @@ public java.util.Set getSourceDirectories( final java.util.Set resul @Override @SuppressWarnings("unchecked") - protected java.util.Set getClasspathElements( final java.util.Set result) - { + protected java.util.Set getClasspathElements( final java.util.Set result) { List resources = project.getResources(); diff --git a/src/main/java/org/bsc/maven/plugin/processor/TestAnnotationProcessorMojo.java b/processor/src/main/java/org/bsc/maven/plugin/processor/TestAnnotationProcessorMojo.java similarity index 92% rename from src/main/java/org/bsc/maven/plugin/processor/TestAnnotationProcessorMojo.java rename to processor/src/main/java/org/bsc/maven/plugin/processor/TestAnnotationProcessorMojo.java index 8f06599..ebdd5cd 100644 --- a/src/main/java/org/bsc/maven/plugin/processor/TestAnnotationProcessorMojo.java +++ b/processor/src/main/java/org/bsc/maven/plugin/processor/TestAnnotationProcessorMojo.java @@ -33,8 +33,7 @@ * */ @Mojo(name="process-test",threadSafe=true,requiresDependencyResolution= ResolutionScope.TEST,defaultPhase= LifecyclePhase.GENERATE_TEST_SOURCES) -public class TestAnnotationProcessorMojo extends AbstractAnnotationProcessorMojo -{ +public class TestAnnotationProcessorMojo extends AbstractAnnotationProcessorMojo { /** * project classpath @@ -69,26 +68,25 @@ public class TestAnnotationProcessorMojo extends AbstractAnnotationProcessorMojo private File outputClassDirectory; @Override - protected void addCompileSourceRoot(MavenProject project, String dir) - { + protected void addCompileSourceRoot(MavenProject project, String dir) { + project.addTestCompileSourceRoot(dir); } @Override - public File getDefaultOutputDirectory() - { + public File getDefaultOutputDirectory() { + return defaultOutputDirectory; } @Override - protected File getOutputClassDirectory() - { + protected File getOutputClassDirectory() { + return outputClassDirectory; } @Override - public java.util.Set getSourceDirectories( final java.util.Set result ) - { + public java.util.Set getSourceDirectories( final java.util.Set result ) { result.add( sourceDirectory ); return result; @@ -97,9 +95,8 @@ public java.util.Set getSourceDirectories( final java.util.Set resul @SuppressWarnings("unchecked") @Override - protected java.util.Set getClasspathElements( final java.util.Set result ) - { - List resources = project.getTestResources(); + protected java.util.Set getClasspathElements( final java.util.Set result ) { + final List resources = project.getTestResources(); if( resources!=null ) { for( Resource r : resources ) { diff --git a/src/main/java/org/bsc/maven/plugin/processor/ZipFileObject.java b/processor/src/main/java/org/bsc/maven/plugin/processor/ZipFileObject.java similarity index 100% rename from src/main/java/org/bsc/maven/plugin/processor/ZipFileObject.java rename to processor/src/main/java/org/bsc/maven/plugin/processor/ZipFileObject.java diff --git a/src/main/resources/COPYING.LESSER b/processor/src/main/resources/COPYING.LESSER similarity index 100% rename from src/main/resources/COPYING.LESSER rename to processor/src/main/resources/COPYING.LESSER diff --git a/src/site/apt/usage.apt b/processor/src/site/apt/usage.apt similarity index 100% rename from src/site/apt/usage.apt rename to processor/src/site/apt/usage.apt diff --git a/src/site/markdown/qa.md b/processor/src/site/markdown/qa.md similarity index 100% rename from src/site/markdown/qa.md rename to processor/src/site/markdown/qa.md diff --git a/src/site/resources/site2/css/maven-base.css b/processor/src/site/resources/site2/css/maven-base.css similarity index 100% rename from src/site/resources/site2/css/maven-base.css rename to processor/src/site/resources/site2/css/maven-base.css diff --git a/src/site/resources/site2/css/maven-theme.css b/processor/src/site/resources/site2/css/maven-theme.css similarity index 100% rename from src/site/resources/site2/css/maven-theme.css rename to processor/src/site/resources/site2/css/maven-theme.css diff --git a/src/site/resources/site2/css/print.css b/processor/src/site/resources/site2/css/print.css similarity index 100% rename from src/site/resources/site2/css/print.css rename to processor/src/site/resources/site2/css/print.css diff --git a/src/site/resources/site2/css/site.css b/processor/src/site/resources/site2/css/site.css similarity index 100% rename from src/site/resources/site2/css/site.css rename to processor/src/site/resources/site2/css/site.css diff --git a/src/site/resources/site2/dependencies.html b/processor/src/site/resources/site2/dependencies.html similarity index 100% rename from src/site/resources/site2/dependencies.html rename to processor/src/site/resources/site2/dependencies.html diff --git a/src/site/resources/site2/distribution-management.html b/processor/src/site/resources/site2/distribution-management.html similarity index 100% rename from src/site/resources/site2/distribution-management.html rename to processor/src/site/resources/site2/distribution-management.html diff --git a/src/site/resources/site2/help-mojo.html b/processor/src/site/resources/site2/help-mojo.html similarity index 100% rename from src/site/resources/site2/help-mojo.html rename to processor/src/site/resources/site2/help-mojo.html diff --git a/src/site/resources/site2/images/close.gif b/processor/src/site/resources/site2/images/close.gif similarity index 100% rename from src/site/resources/site2/images/close.gif rename to processor/src/site/resources/site2/images/close.gif diff --git a/src/site/resources/site2/images/collapsed.gif b/processor/src/site/resources/site2/images/collapsed.gif similarity index 100% rename from src/site/resources/site2/images/collapsed.gif rename to processor/src/site/resources/site2/images/collapsed.gif diff --git a/src/site/resources/site2/images/expanded.gif b/processor/src/site/resources/site2/images/expanded.gif similarity index 100% rename from src/site/resources/site2/images/expanded.gif rename to processor/src/site/resources/site2/images/expanded.gif diff --git a/src/site/resources/site2/images/external.png b/processor/src/site/resources/site2/images/external.png similarity index 100% rename from src/site/resources/site2/images/external.png rename to processor/src/site/resources/site2/images/external.png diff --git a/src/site/resources/site2/images/icon_error_sml.gif b/processor/src/site/resources/site2/images/icon_error_sml.gif similarity index 100% rename from src/site/resources/site2/images/icon_error_sml.gif rename to processor/src/site/resources/site2/images/icon_error_sml.gif diff --git a/src/site/resources/site2/images/icon_info_sml.gif b/processor/src/site/resources/site2/images/icon_info_sml.gif similarity index 100% rename from src/site/resources/site2/images/icon_info_sml.gif rename to processor/src/site/resources/site2/images/icon_info_sml.gif diff --git a/src/site/resources/site2/images/icon_success_sml.gif b/processor/src/site/resources/site2/images/icon_success_sml.gif similarity index 100% rename from src/site/resources/site2/images/icon_success_sml.gif rename to processor/src/site/resources/site2/images/icon_success_sml.gif diff --git a/src/site/resources/site2/images/icon_warning_sml.gif b/processor/src/site/resources/site2/images/icon_warning_sml.gif similarity index 100% rename from src/site/resources/site2/images/icon_warning_sml.gif rename to processor/src/site/resources/site2/images/icon_warning_sml.gif diff --git a/src/site/resources/site2/images/logos/build-by-maven-black.png b/processor/src/site/resources/site2/images/logos/build-by-maven-black.png similarity index 100% rename from src/site/resources/site2/images/logos/build-by-maven-black.png rename to processor/src/site/resources/site2/images/logos/build-by-maven-black.png diff --git a/src/site/resources/site2/images/logos/build-by-maven-white.png b/processor/src/site/resources/site2/images/logos/build-by-maven-white.png similarity index 100% rename from src/site/resources/site2/images/logos/build-by-maven-white.png rename to processor/src/site/resources/site2/images/logos/build-by-maven-white.png diff --git a/src/site/resources/site2/images/logos/maven-feather.png b/processor/src/site/resources/site2/images/logos/maven-feather.png similarity index 100% rename from src/site/resources/site2/images/logos/maven-feather.png rename to processor/src/site/resources/site2/images/logos/maven-feather.png diff --git a/src/site/resources/site2/images/newwindow.png b/processor/src/site/resources/site2/images/newwindow.png similarity index 100% rename from src/site/resources/site2/images/newwindow.png rename to processor/src/site/resources/site2/images/newwindow.png diff --git a/src/site/resources/site2/index.html b/processor/src/site/resources/site2/index.html similarity index 100% rename from src/site/resources/site2/index.html rename to processor/src/site/resources/site2/index.html diff --git a/src/site/resources/site2/integration.html b/processor/src/site/resources/site2/integration.html similarity index 100% rename from src/site/resources/site2/integration.html rename to processor/src/site/resources/site2/integration.html diff --git a/src/site/resources/site2/issue-tracking.html b/processor/src/site/resources/site2/issue-tracking.html similarity index 100% rename from src/site/resources/site2/issue-tracking.html rename to processor/src/site/resources/site2/issue-tracking.html diff --git a/src/site/resources/site2/license.html b/processor/src/site/resources/site2/license.html similarity index 100% rename from src/site/resources/site2/license.html rename to processor/src/site/resources/site2/license.html diff --git a/src/site/resources/site2/mail-lists.html b/processor/src/site/resources/site2/mail-lists.html similarity index 100% rename from src/site/resources/site2/mail-lists.html rename to processor/src/site/resources/site2/mail-lists.html diff --git a/src/site/resources/site2/plugin-info.html b/processor/src/site/resources/site2/plugin-info.html similarity index 100% rename from src/site/resources/site2/plugin-info.html rename to processor/src/site/resources/site2/plugin-info.html diff --git a/src/site/resources/site2/plugin-management.html b/processor/src/site/resources/site2/plugin-management.html similarity index 100% rename from src/site/resources/site2/plugin-management.html rename to processor/src/site/resources/site2/plugin-management.html diff --git a/src/site/resources/site2/plugins.html b/processor/src/site/resources/site2/plugins.html similarity index 100% rename from src/site/resources/site2/plugins.html rename to processor/src/site/resources/site2/plugins.html diff --git a/src/site/resources/site2/process-mojo.html b/processor/src/site/resources/site2/process-mojo.html similarity index 100% rename from src/site/resources/site2/process-mojo.html rename to processor/src/site/resources/site2/process-mojo.html diff --git a/src/site/resources/site2/process-test-mojo.html b/processor/src/site/resources/site2/process-test-mojo.html similarity index 100% rename from src/site/resources/site2/process-test-mojo.html rename to processor/src/site/resources/site2/process-test-mojo.html diff --git a/src/site/resources/site2/project-info.html b/processor/src/site/resources/site2/project-info.html similarity index 100% rename from src/site/resources/site2/project-info.html rename to processor/src/site/resources/site2/project-info.html diff --git a/src/site/resources/site2/project-reports.html b/processor/src/site/resources/site2/project-reports.html similarity index 100% rename from src/site/resources/site2/project-reports.html rename to processor/src/site/resources/site2/project-reports.html diff --git a/src/site/resources/site2/project-summary.html b/processor/src/site/resources/site2/project-summary.html similarity index 100% rename from src/site/resources/site2/project-summary.html rename to processor/src/site/resources/site2/project-summary.html diff --git a/src/site/resources/site2/source-repository.html b/processor/src/site/resources/site2/source-repository.html similarity index 100% rename from src/site/resources/site2/source-repository.html rename to processor/src/site/resources/site2/source-repository.html diff --git a/src/site/resources/site2/team-list.html b/processor/src/site/resources/site2/team-list.html similarity index 100% rename from src/site/resources/site2/team-list.html rename to processor/src/site/resources/site2/team-list.html diff --git a/src/site/resources/site2/usage.html b/processor/src/site/resources/site2/usage.html similarity index 100% rename from src/site/resources/site2/usage.html rename to processor/src/site/resources/site2/usage.html diff --git a/src/site/site.xml b/processor/src/site/site.xml similarity index 98% rename from src/site/site.xml rename to processor/src/site/site.xml index ad3f04a..8eeec97 100644 --- a/src/site/site.xml +++ b/processor/src/site/site.xml @@ -7,7 +7,7 @@ org.apache.maven.skins maven-fluido-skin - 1.3.1 + 1.8 diff --git a/src/test/java/org/bsc/maven/plugin/processor/ProcessorTest.java b/processor/src/test/java/org/bsc/maven/plugin/processor/ProcessorTest.java similarity index 100% rename from src/test/java/org/bsc/maven/plugin/processor/ProcessorTest.java rename to processor/src/test/java/org/bsc/maven/plugin/processor/ProcessorTest.java diff --git a/src/main/java/org/bsc/function/Consumer.java b/src/main/java/org/bsc/function/Consumer.java deleted file mode 100644 index 0d3e485..0000000 --- a/src/main/java/org/bsc/function/Consumer.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.bsc.function; - -/** - * - * @author bsorrentino - * @param - */ -public interface Consumer { - - void accept(T t); -} diff --git a/src/main/java/org/bsc/maven/plugin/processor/Debug.java b/src/main/java/org/bsc/maven/plugin/processor/Debug.java deleted file mode 100644 index 3b371ef..0000000 --- a/src/main/java/org/bsc/maven/plugin/processor/Debug.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2009 2010 2011 Bartolomeo Sorrentino - * - * This file is part of maven-annotation-plugin. - * - * maven-annotation-plugin is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * maven-annotation-plugin is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with maven-annotation-plugin. If not, see . - */ -package org.bsc.maven.plugin.processor; - -import java.io.File; -import java.util.Collection; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.ArtifactUtils; -import org.apache.maven.project.MavenProject; - -/** - * Debug helpers - */ -class Debug -{ - private final MavenProject project; - - public Debug(MavenProject project) - { - if (project == null) - { - throw new IllegalArgumentException("Argument 'project' cannot be null"); - } - this.project = project; - } - - public void println(String name, Collection e) - { - System.out.println(name); - if (null == e) - { - return; - } - - for (T a : e) - { - System.out.printf("\t[%s] %s\n", a.getClass().getName(), a.toString()); - } - - } - - public void printDeps(String name, Collection dependencies) - { - System.out.println(name); - for (org.apache.maven.model.Dependency d : dependencies) - { - - System.out.printf("dependency [%s]\n", d.toString()); - - String versionlessKey = ArtifactUtils.versionlessKey(d.getGroupId(), d.getArtifactId()); - - Artifact artifact = (Artifact)project.getArtifactMap().get(versionlessKey); - - if (null != artifact) - { - File file = artifact.getFile(); - System.out.printf("artifact [%s]\n", file.getPath()); - } - } - } - - public void printDebugInfo() throws Exception //DependencyResolutionRequiredException - { - //println("project.getCompileClasspathElements", project.getCompileClasspathElements()); - println("project.getCompileArtifacts", project.getCompileArtifacts()); - println("project.getCompileDependencies", project.getCompileDependencies()); - println("project.getDependencyArtifacts", project.getDependencyArtifacts()); - println("project.getArtifactMap", project.getArtifactMap().keySet()); - println("project.getArtifacts", project.getArtifacts()); - printDeps("project.getRuntimeDependencies", project.getRuntimeDependencies()); - printDeps("project.getDependencies", project.getDependencies()); - } - -} diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..438b0ea --- /dev/null +++ b/test/README.md @@ -0,0 +1,27 @@ +# Maven Annotation plugin - test + +## Steps for test + +Deploy project assets. (need only for the SNAPSHOT) +> let's go in root folder and run +>```dockerfile +>mvn deploy +>``` + +Build docker image +> let's go in `test` folder and run +>```dockerfile +>mvn -Pdocker docker:build +>``` + +Create docker volume +> let's go in `test` folder and run +>```dockerfile +>mvn -Pdocker docker:volume-create +>``` + +Run test +> let's go in `test` folder and run +>```dockerfile +>mvn -Pdocker docker:rund +>``` diff --git a/test/pom.xml b/test/pom.xml index 4f7da7a..a3732ba 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -1,35 +1,29 @@ - 4.0.0 - - org.bsc.maven - maven-processor-plugin-test - 3.3.2-SNAPSHOT - jar - MAVEN PROCESSOR PLUGIN TEST- ${project.version} - - - - 1.7 - 1.7 - - + 4.0.0 - + org.bsc.maven + maven-processor-plugin-test + jar + MAVEN PROCESSOR PLUGIN TEST + 4.0-beta1 + - - junit - junit - 4.10 - test - + + 1.9 + 1.9 + UTF-8 + - + - 2012 + + org.bsc.util + processor-utils + ${project.version} + + @@ -40,11 +34,6 @@ build-helper-maven-plugin 1.7 - - org.apache.maven.plugins - maven-toolchains-plugin - 1.1 - @@ -61,12 +50,13 @@ PROCESSOR PLUGIN maven-processor-plugin ${project.version} + @@ -88,7 +78,6 @@ PROCESSOR PLUGIN false org.bsc.maven.plugin.processor.test.TESTWikiProcessor - @@ -171,13 +160,68 @@ PROCESSOR PLUGIN - toolchain + docker + + io.fabric8 + docker-maven-plugin + true + + default + true + IfNotPresent + + + + mvn-repo + local + + + + + maven-3.5.4-jdk9 + + + . + + latest + ${project.version} + + + + + + + mvn-repo:/usr/share/maven/ref/repository + ${project.basedir}:/home + + + mvn -Ptoolchain clean package -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true + + + + + + + + + + + toolchain + + org.apache.maven.plugins maven-toolchains-plugin + 3.0.0 @@ -188,8 +232,8 @@ PROCESSOR PLUGIN - 1.6 - sun + [1.9,) + open diff --git a/test/src/main/docker/Dockerfile b/test/src/main/docker/Dockerfile new file mode 100644 index 0000000..fcf8e84 --- /dev/null +++ b/test/src/main/docker/Dockerfile @@ -0,0 +1,31 @@ +FROM adoptopenjdk/openjdk9 + +ARG MAVEN_VERSION=3.5.4 +ARG USER_HOME_DIR="/root" +ARG SHA=2a803f578f341e164f6753e410413d16ab60fabe31dc491d1fe35c984a5cce696bc71f57757d4538fe7738be04065a216f3ebad4ef7e0ce1bb4c51bc36d6be86 +ARG BASE_URL=https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/ + + +RUN mkdir -p /usr/share/maven /usr/share/maven/ref \ + && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ + && echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \ + && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ + && rm -f /tmp/apache-maven.tar.gz \ + && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn + +ENV MAVEN_HOME /usr/share/maven +ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2" + +COPY mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh +RUN chmod +x /usr/local/bin/mvn-entrypoint.sh + +COPY settings-docker.xml /usr/share/maven/ref/settings.xml +COPY toolchains.xml /usr/share/maven/ref + +WORKDIR /home + +VOLUME /home +VOLUME /usr/share/maven/ref/repository + +ENTRYPOINT ["/usr/local/bin/mvn-entrypoint.sh"] +CMD ["mvn"] \ No newline at end of file diff --git a/test/src/main/docker/mvn-entrypoint.sh b/test/src/main/docker/mvn-entrypoint.sh new file mode 100644 index 0000000..9f87dfa --- /dev/null +++ b/test/src/main/docker/mvn-entrypoint.sh @@ -0,0 +1,50 @@ +#! /bin/sh -eu + +# Copy files from /usr/share/maven/ref into ${MAVEN_CONFIG} +# So the initial ~/.m2 is set with expected content. +# Don't override, as this is just a reference setup + +copy_reference_files() { + local log="$MAVEN_CONFIG/copy_reference_file.log" + local ref="/usr/share/maven/ref" + + if mkdir -p "${MAVEN_CONFIG}/repository" && touch "${log}" > /dev/null 2>&1 ; then + cd "${ref}" + local reflink="" + if cp --help 2>&1 | grep -q reflink ; then + reflink="--reflink=auto" + fi + if [ -n "$(find "${MAVEN_CONFIG}/repository" -maxdepth 0 -type d -empty 2>/dev/null)" ] ; then + # destination is empty... + echo "--- Copying all files to ${MAVEN_CONFIG} at $(date)" >> "${log}" + cp -rv ${reflink} . "${MAVEN_CONFIG}" >> "${log}" + else + # destination is non-empty, copy file-by-file + echo "--- Copying individual files to ${MAVEN_CONFIG} at $(date)" >> "${log}" + find . -type f -exec sh -eu -c ' + log="${1}" + shift + reflink="${1}" + shift + for f in "$@" ; do + if [ ! -e "${MAVEN_CONFIG}/${f}" ] || [ -e "${f}.override" ] ; then + mkdir -p "${MAVEN_CONFIG}/$(dirname "${f}")" + cp -rv ${reflink} "${f}" "${MAVEN_CONFIG}/${f}" >> "${log}" + fi + done + ' _ "${log}" "${reflink}" {} + + fi + echo >> "${log}" + else + echo "Can not write to ${log}. Wrong volume permissions? Carrying on ..." + fi +} + +owd="$(pwd)" +copy_reference_files +unset MAVEN_CONFIG + +cd "${owd}" +unset owd + +exec "$@" diff --git a/test/src/main/docker/settings-docker.xml b/test/src/main/docker/settings-docker.xml new file mode 100644 index 0000000..0cb2f78 --- /dev/null +++ b/test/src/main/docker/settings-docker.xml @@ -0,0 +1,51 @@ + + /usr/share/maven/ref/repository + + + + + sonatype + + true + + + + + + + sonatype-repo + https://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + + + + + + + + + sonatype-repo + https://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + + + + + + + + + \ No newline at end of file diff --git a/test/src/main/docker/toolchains.xml b/test/src/main/docker/toolchains.xml new file mode 100644 index 0000000..dd3635c --- /dev/null +++ b/test/src/main/docker/toolchains.xml @@ -0,0 +1,13 @@ + + + jdk + + 1.9 + open + openjdk9 + + + /opt/java/openjdk + + + \ No newline at end of file diff --git a/test/src/main/java/org/bsc/maven/plugin/processor/test/TESTWikiProcessor.java b/test/src/main/java/org/bsc/maven/plugin/processor/test/TESTWikiProcessor.java index 8d6bb26..feb4fe0 100644 --- a/test/src/main/java/org/bsc/maven/plugin/processor/test/TESTWikiProcessor.java +++ b/test/src/main/java/org/bsc/maven/plugin/processor/test/TESTWikiProcessor.java @@ -5,6 +5,8 @@ package org.bsc.maven.plugin.processor.test; +import org.bsc.processor.BaseAbstractProcessor; + import java.io.IOException; import java.util.Set; @@ -23,37 +25,11 @@ * * */ -@SupportedSourceVersion(SourceVersion.RELEASE_7) +@SupportedSourceVersion(SourceVersion.RELEASE_9) @SupportedAnnotationTypes( "*" ) //@SupportedOptions( {"subfolder", "filepath", "templateUri"}) //@SupportedAnnotationTypes( {"javax.ws.rs.GET", "javax.ws.rs.PUT", "javax.ws.rs.POST", "javax.ws.rs.DELETE"}) -public class TESTWikiProcessor extends AbstractProcessor { - - protected void info( String msg ) { - processingEnv.getMessager().printMessage(Kind.NOTE, msg ); - } - - protected void warn( String msg ) { - //logger.warning(msg); - processingEnv.getMessager().printMessage(Kind.WARNING, msg ); - } - - protected void warn( String msg, Throwable t ) { - //logger.log(Level.WARNING, msg, t ); - processingEnv.getMessager().printMessage(Kind.WARNING, msg ); - t.printStackTrace(System.err); - } - - protected void error( String msg ) { - //logger.severe(msg); - processingEnv.getMessager().printMessage(Kind.ERROR, msg ); - } - - protected void error( String msg, Throwable t ) { - //logger.log(Level.SEVERE, msg, t ); - processingEnv.getMessager().printMessage(Kind.ERROR, msg ); - t.printStackTrace(System.err); - } +public class TESTWikiProcessor extends BaseAbstractProcessor { /** * @@ -74,45 +50,7 @@ protected FileObject getResourceFormClassPath(Filer filer, final String resource return f; } - - - /** - * - * @param subfolder subfolder (e.g. confluence) - * @param filePath relative path (e.g. children/file.wiki) - * @return - * @throws IOException - */ - protected FileObject getOutputFile( Filer filer, String subfolder, String filePath ) throws IOException { - - Element e = null; - FileObject res = - filer.createResource(StandardLocation.SOURCE_OUTPUT, - subfolder, - filePath, - e); - - return res; - } - - /** - * - * @param e - * @return - * @throws ClassNotFoundException - */ - protected Class getClassFromElement( Element e ) throws ClassNotFoundException { - if( null==e ) throw new IllegalArgumentException("e is null!"); - if( ElementKind.CLASS!=e.getKind() ) throw new IllegalArgumentException( String.format("element [%s] is not a class!", e)); - - TypeElement te = (TypeElement) e; - - info( String.format("loading class [%s]", te.getQualifiedName().toString())); - - return Class.forName(te.getQualifiedName().toString()); - - } - + @Override public boolean process(Set annotations, RoundEnvironment roundEnv) { if (roundEnv.processingOver()) return false; diff --git a/utils/pom.xml b/utils/pom.xml index fa8f5c2..059f5bc 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -3,120 +3,57 @@ org.bsc.util processor-utils - 1.0.1-SNAPSHOT jar - - JAVA PROCESSOR UTILS - ${project.version} - - + JAVA PROCESSOR UTILS + Utilities for java annotation processor implementation JSR-269 + https://github.com/bsorrentino/maven-annotation-plugin/tree/master/utils + + 2013 + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + + + + + + bartolomeo.sorrentino@gmail.com + Bartolomeo Sorrentino + GMT+1 + + Owner + + + + + + org.bsc.maven + maven-processor-plugin-parent + 4.0-beta1 + + + UTF-8 - - scm:git:https://bartolomeo.sorrentino@code.google.com/p/maven-annotation-plugin.utils/ - scm:git:https://bartolomeo.sorrentino@code.google.com/p/maven-annotation-plugin.utils/ - https://bartolomeo.sorrentino@code.google.com/p/maven-annotation-plugin.utils/ - HEAD - - -2013 -Utilities for java annotation processor implementation JSR-269 -https://code.google.com/p/maven-annotation-plugin/ - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - - - - - - bartolomeo.sorrentino@gmail.com - Bartolomeo Sorrentino - GMT+1 - - Owner - - - - - - - junit - junit - 4.10 - test - + - - - + - + org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - - - - - - - ${release.repo.id} - ${release.repo.url} - - - ${snapshot.repo.id} - ${snapshot.repo.url} - false - - - - - - - sonatype - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.3 - - - - sign-artifacts - verify - - sign - - - - + - - - - - + diff --git a/utils/src/main/java/org/bsc/processor/BaseAbstractProcessor.java b/utils/src/main/java/org/bsc/processor/BaseAbstractProcessor.java index 1084906..dc07fa4 100644 --- a/utils/src/main/java/org/bsc/processor/BaseAbstractProcessor.java +++ b/utils/src/main/java/org/bsc/processor/BaseAbstractProcessor.java @@ -5,25 +5,20 @@ package org.bsc.processor; -import java.io.FileNotFoundException; -import java.io.IOException; - import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Filer; -import javax.lang.model.element.Element; -import javax.lang.model.element.ElementKind; -import javax.lang.model.element.TypeElement; +import javax.annotation.processing.RoundEnvironment; +import javax.lang.model.element.*; import javax.tools.Diagnostic.Kind; import javax.tools.FileObject; import javax.tools.StandardLocation; - - +import java.io.IOException; +import java.nio.file.Path; import java.util.Collections; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.annotation.processing.RoundEnvironment; -import javax.tools.JavaFileManager; - +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Stream; /** * @@ -31,168 +26,95 @@ * * */ -//@SupportedSourceVersion(SourceVersion.RELEASE_6) public abstract class BaseAbstractProcessor extends AbstractProcessor { - protected void info( String msg ) { - processingEnv.getMessager().printMessage(Kind.NOTE, msg ); + protected void info(String fmt, Object... args) { + final String msg = java.lang.String.format(fmt, (Object[]) args); + processingEnv.getMessager().printMessage(Kind.NOTE, msg); } - protected void warn( String msg ) { - //logger.warning(msg); - processingEnv.getMessager().printMessage(Kind.WARNING, msg ); + protected void warn(String fmt, Object... args) { + final String msg = java.lang.String.format(fmt, (Object[]) args); + processingEnv.getMessager().printMessage(Kind.WARNING, msg); } - protected void warn( String msg, Throwable t ) { - //logger.log(Level.WARNING, msg, t ); - processingEnv.getMessager().printMessage(Kind.WARNING, msg ); + protected void warn(String msg, Throwable t) { + processingEnv.getMessager().printMessage(Kind.WARNING, msg); t.printStackTrace(System.err); } - protected void error( String msg ) { - //logger.severe(msg); - processingEnv.getMessager().printMessage(Kind.ERROR, msg ); + protected void error(String fmt, Object... args) { + final String msg = java.lang.String.format(fmt, (Object[]) args); + processingEnv.getMessager().printMessage(Kind.ERROR, msg); } - protected void error( String msg, Throwable t ) { - //logger.log(Level.SEVERE, msg, t ); - processingEnv.getMessager().printMessage(Kind.ERROR, msg ); + protected void error(String msg, Throwable t) { + processingEnv.getMessager().printMessage(Kind.ERROR, msg); t.printStackTrace(System.err); } - - final Pattern p = Pattern.compile("(.*)[\\.]((?:\\w+)\\.gwt\\.xml)"); + /** * - * @param fqn * @return */ - protected java.net.URL getResourceFromClassPath( String fqn ) - { - return getResourceFromClassPath(fqn, getClass().getClassLoader()); + protected java.util.Map getOptions() { + return Optional.ofNullable(processingEnv.getOptions()) + .orElseGet( () -> Collections.emptyMap() ); } - - /** - * - * @param fqn - * @param cl - * @return - */ - protected java.net.URL getResourceFromClassPath( String fqn, ClassLoader cl ) - { - if( fqn == null ) { - throw new IllegalArgumentException( "fqn is null!"); - } - if( cl == null ) { - throw new IllegalArgumentException( "class loader is null!"); - } - - Matcher m = p.matcher(fqn); - - if( !m.matches() ) { - throw new IllegalArgumentException(String.format("parameter '%s' doesn't contain a valid fqn", fqn)); - } - - final String packageName = m.group(1); - final String resource = m.group(2); - - info( String.format("packageName=[%s]\nresource=[%s]\n", packageName, resource)); - - final String res; - if( packageName==null || packageName.isEmpty() ) { - res = resource; - } - else { - res = packageName.replace('.', '/').concat("/").concat(resource); - } - - final java.net.URL url = cl.getResource( res ); - - return url; - - } - /** * + * @param filter + * @return */ - public static interface Predicate { - - /** - * - * @param source - * @param elements - * @return - */ - boolean execute( TypeElement source, java.util.Set elements ); - } - - - protected void getElementsAnnotatedWith( - java.util.Set annotations, - RoundEnvironment roundEnv, - Predicate p ) + public Stream elementStreamFromAnnotations( + java.util.Set annotations, + RoundEnvironment roundEnv, + Predicate filter ) { if( annotations == null ) { - throw new IllegalArgumentException( "parameter annotations is null!"); + throw new IllegalArgumentException( "annotations is null!"); } if( roundEnv == null ) { - throw new IllegalArgumentException( "parameter RoundEnvironment is null!"); - } - if( p == null ) { - throw new IllegalArgumentException( "paraemeter Predicate is null!"); + throw new IllegalArgumentException( "roundEnv is null!"); } - - for( TypeElement te : annotations ) { - - final java.util.Set elems = - roundEnv.getElementsAnnotatedWith(te); - - if( !p.execute(te, elems) ) { - break; - } + if( filter == null ) { + throw new IllegalArgumentException( "filter is null!"); } + + return annotations.stream() + .filter( filter ) + .flatMap((e) -> roundEnv.getElementsAnnotatedWith(e).stream() ); + } + /** * - * @param location - * @return + * @param am + * @param supplier + * @return */ - protected FileObject getResourceFormLocation( - final JavaFileManager.Location location, - final String packageName, - final String resource ) throws FileNotFoundException,IOException - { - if( location == null ) { - throw new IllegalArgumentException( "location is null!"); - } - if( packageName == null ) { - throw new IllegalArgumentException( "packageName loader is null!"); - } - if( resource == null ) { - throw new IllegalArgumentException( "resource loader is null!"); - } - - final Filer filer = processingEnv.getFiler(); - - FileObject f = filer.getResource( - location, - packageName, - resource); + protected > R toMapObject( AnnotationMirror am, java.util.function.Supplier supplier ) { + + final Collector, R, R> c = + Collector.of( + supplier, + ( map, entry ) -> + map.put( entry.getKey().getSimpleName().toString(), entry.getValue().getValue()), + ( v1, v2 ) -> v1 + ); + + final R result = am.getElementValues() + .entrySet() + .stream() + .collect( c ); + + return result; + + } - java.io.InputStream is = f.openInputStream(); - if( is==null ) { - warn( String.format("resource [%s] not found!", resource) ); - return null; - } - - is.close(); - - return f; - } - - /** * * @param subfolder subfolder @@ -201,21 +123,22 @@ protected FileObject getResourceFormLocation( * @throws IOException */ protected FileObject createSourceOutputFile( - String subfolder, - String filePath ) throws IOException + Path subfolder, + Path filePath ) throws IOException { final Filer filer = processingEnv.getFiler(); - Element e = null; + final Element e = null; FileObject res = filer.createResource( StandardLocation.SOURCE_OUTPUT, - subfolder, - filePath, + subfolder.toString(), + filePath.toString(), e); return res; } + /** * * @param e @@ -224,45 +147,20 @@ protected FileObject createSourceOutputFile( */ protected Class getClassFromElement( Element e ) throws ClassNotFoundException { - if( null==e ) throw new IllegalArgumentException("e is null!"); + if( null==e ) throw new IllegalArgumentException("e is null!"); + if( ElementKind.CLASS!=e.getKind() ) { throw new IllegalArgumentException( String.format("element [%s] is not a class!", e)); } TypeElement te = (TypeElement) e; - info( String.format("loading class [%s]", te.getQualifiedName().toString())); + info( "loading class [%s]", te.getQualifiedName().toString()); return Class.forName(te.getQualifiedName().toString()); } - /** - * - * @return com.sun.source.util.Trees - */ - /* - protected com.sun.source.util.Trees newTreesInstance() { - - return com.sun.source.util.Trees.instance(processingEnv); - - }; - */ - - /** - * - * @return - */ - protected java.util.Map getOptions() - { - java.util.Map optionMap = processingEnv.getOptions(); - - if(optionMap==null) { - optionMap = Collections.emptyMap(); - } - return optionMap ; - } - /** * * @param typeElement