From e5eb6afc720d4abae211f9ff4354387106a9ef40 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Date: Thu, 11 Jun 2015 20:46:25 -0400 Subject: [PATCH] Forking to a new project to add some features. --- .editorconfig | 14 + .gitreview | 5 + .travis.yml | 1 - CHANGELOG.md | 55 +-- CONTRIBUTORS.md | 1 + LICENSE | 387 +++++++++--------- NOTICE | 28 +- README.md | 8 +- pom.xml | 170 +++++--- .../joelittlejohn/embedmongo/PortUtils.java | 37 -- .../embedmongo/log/NoopStreamProcessor.java | 30 -- .../maven/plugins/mongodb/PortUtils.java | 38 ++ .../plugins/mongodb/StartMongoMojo.java} | 95 ++--- .../maven/plugins/mongodb/StopMongoMojo.java} | 31 +- .../log/FileOutputStreamProcessor.java | 25 +- .../maven/plugins/mongodb}/log/Loggers.java | 25 +- .../mongodb/log/NoopStreamProcessor.java | 31 ++ .../maven/plugins/mongodb}/PortUtilsTest.java | 27 +- src/test/resources/example1/pom.xml | 37 +- src/test/resources/example2/pom.xml | 39 +- src/test/resources/example3/pom.xml | 37 +- src/test/resources/pom.xml | 65 ++- src/test/resources/randomport/pom.xml | 47 ++- .../joelittlejohn/embedmongo/MongoIT.java | 38 -- .../maven/plugins/mongodb/MongoIT.java | 39 ++ 25 files changed, 723 insertions(+), 587 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitreview delete mode 100644 .travis.yml delete mode 100644 src/main/java/com/github/joelittlejohn/embedmongo/PortUtils.java delete mode 100644 src/main/java/com/github/joelittlejohn/embedmongo/log/NoopStreamProcessor.java create mode 100644 src/main/java/com/syncleus/maven/plugins/mongodb/PortUtils.java rename src/main/java/com/{github/joelittlejohn/embedmongo/StartEmbeddedMongoMojo.java => syncleus/maven/plugins/mongodb/StartMongoMojo.java} (82%) rename src/main/java/com/{github/joelittlejohn/embedmongo/StopEmbeddedMongoMojo.java => syncleus/maven/plugins/mongodb/StopMongoMojo.java} (51%) rename src/main/java/com/{github/joelittlejohn/embedmongo => syncleus/maven/plugins/mongodb}/log/FileOutputStreamProcessor.java (66%) rename src/main/java/com/{github/joelittlejohn/embedmongo => syncleus/maven/plugins/mongodb}/log/Loggers.java (60%) create mode 100644 src/main/java/com/syncleus/maven/plugins/mongodb/log/NoopStreamProcessor.java rename src/test/java/com/{github/joelittlejohn/embedmongo => syncleus/maven/plugins/mongodb}/PortUtilsTest.java (71%) delete mode 100644 src/test/resources/randomport/src/test/java/com/github/joelittlejohn/embedmongo/MongoIT.java create mode 100644 src/test/resources/randomport/src/test/java/com/syncleus/maven/plugins/mongodb/MongoIT.java diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..27f6865 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# top-most EditorConfig file +root = true + +[*] +#unix style line ending +end_of_line = lf +#newline at end of file +insert_final_newline = true +#charset UTF-8 +charset = utf-8 +#indent using spaces +indent_style = space +#4 spaces per indent +indent_size = 4 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..ce6a734 --- /dev/null +++ b/.gitreview @@ -0,0 +1,5 @@ +[gerrit] +host=gerrit.syncleus.com +port=29418 +defaultbranch=master +project=maven-mongodb-plugin diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dff5f3a..0000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: java diff --git a/CHANGELOG.md b/CHANGELOG.md index d59fa0c..70c6c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,54 +1,5 @@ -# embedmongo-maven-plugin Changelog +# maven-mongodb-plugin Changelog -## 0.1.11 +## 1.0.0 -* Update to [embedmongo.flapdoodle.de](https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de) 1.46.0 for performance improvements and latest versions. - -## 0.1.10 - -* Update to [embedmongo.flapdoodle.de](https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de) 1.40 (thanks @cortiz) -* Add support for MongoDB authorization (thanks @chapmbk) -* Add `downloadPath` configuration option (thanks @dietrichatadobe) - -## 0.1.8, 0.1.9 - -* Add `randomPort` configuration option (thanks @jumarko) - -## 0.1.7 - -* Add `logFile`/`logFileEncoding` configuration options (thanks @matthewadams) -* Update to [embedmongo.flapdoodle.de](https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de) 1.31 - -## 0.1.6 - -* Add `proxyUser`/`proxyPassword` configuration options - -## 0.1.5 - -* Update default mongo version to latest stable (2.2.1) -* Update to [embedmongo.flapdoodle.de](https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de) 1.27 (mkdir -p for databaseDirectory) - -## 0.1.4 - -* Add `bindIp` configuration option (thanks @GTExcalibur) -* Update to [embedmongo.flapdoodle.de](https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de) 1.23 for explicit 2.0.7/2.2.0 support (thanks @davidmc24) - -## 0.1.3 - -* Add support for any/all MongoDB versions, including new releases -* Update default mongo version from 2.1.1 (unstable) to 2.0.6 (stable) -* Add `logging` configuration with support for `console`, `file` and `none` mode - -## 0.1.2 - -* Add `wait` configuration options to `start` goal to block immediately and wait until MongoDB is explicitly stopped (thanks @jeremynorris) -* Update to [embedmongo.flapdoodle.de](https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de) 1.16 - -## 0.1.1 - -* Add `proxyHost`/`proxyPort` configuration options for downloads via a proxy - -# 0.1.0 - -* Add `port`, `version` and `databaseDirectory` configuration options -* Add `start` and `stop` goals +* Forked from embedmongo-maven-plugin. diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2cd3aee..eabc004 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,5 @@ # Contributors +* Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> * Joe Littlejohn <joelittlejohn@gmail.com> * Paulo Pires <pjpires@gmail.com> * Jeremy Norris <jeremy.norris@service-now.com> diff --git a/LICENSE b/LICENSE index d645695..32377b5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,202 +1,187 @@ +Open Source Community License +Type C, Version 1.0 +(c) Syncleus, Inc., 2004 - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. + + +A. DEFINITIONS + +For the purpose of this license we will set forth certain definitions +for the ease of communications: + +"you" - Any person granted use of source code under this license by the +inclusion of this license in the source by the author and copyright holder. + +"program" - The Source code this license is bundled as well as any executables +and derivative work under copyright law. Any program this license is assigned +to, and means either the Program or any derivative work under copyright law. +Meaning any work containing the program or a portion of it, modified or +verbatim, and/or translated into other languages. + +"Authors' Recursive License" - A special license granted to certain +contributors of the program. See section F below. + +"this license" - The Open Source Public License - Type C Version 1.0 or any +later version at your option, as published by Syncleus, Inc. All +future versions will be in the same spirit but will correct any legal +oversights addressed by earlier versions. + +"source code" - The preferred form of the program for making modifications to +it that make up the program in part or in whole. For executables this means the +source code, plus any modules that are needed to compile it, including scripts +that control its compiling. This need not include components not normally +needed for compiling such as operating system libraries, or the kernel. + +"distribute" - The act of distributing, publishing, or otherwise making the +program available to one or more persons, in whole or in part. + +"entity" - Any one of the following: person, group of persons, company +or entity under law. + + + +B. SCOPE + +This license addresses copying, distribution, execution and modification of the +source code. Everything else is outside the scope of this license and no rights +are granted either written or implied outside its scope. + +You may not copy, distribute, execute, or sub-license except under the terms +and conditions of this license. Any attempt to do so outside of this license is +void and will immediately and automatically terminate any rights you have under +this license. This license is guaranteed not to be terminated so long as you +follow the rules and conditions of this license. + +You are not required to accept this license since you have not signed it. +However if you do not accept this license then all privileges and rights +granted herein is void. Unless specifically granted through another legal +license you shall not have the right to copy, distribute, execute or +sub-license this program in part or in whole. + +If for any reason you are not able to follow the conditions of this license +including, but not limited to, court order, agreement, or law, then you are not +excused from the conditions of this license. If for any reason you cannot +follow the terms and conditions of this license then you are not given the +privileges associated with them. For example, if you cannot provide the source +code to accompany the executable you cannot distribute the program. + + + +C. EXECUTION + +This License does not restrict execution of the program, including any uses of +its output so long as the terms and conditions of this license are upheld. The +right to execution is immediately revoked for any program under this license +found in violation of the terms. + + + +D. DISTRIBUTION + +You may copy and distribute the program according to the terms of this license +so long as you perform at least one of the following: + +1. Offer the source code to be distributed through the same medium by which +the program is distributed at no additional cost except for the cost of +offering and distributing the source code. + +2. Provide the program with a written offer for physical distribution good for +at least one year or until the distributing entity no longer exists, whichever +comes first. + +3. Provide the program bundled with the source code. If the program is offered +without the bundled source code then the source code must still be made +available through one of the two options above. + + + +E. LICENSE PROPAGATION + +You may copy and distribute the program verbatim, according to the terms and +conditions of this license, so long as all copyright and warranty disclaimers +remain unchanged and all references to this license remain. All copies of the +source code and its individual pages must appropriately and in plain sight +contain a notice of this license. The program must be distributed with a copy +of this license and all notices should point to the included copy. + +Propagation of this license, and the authors' recursive license below, is not +effected by mere aggregation of the program with other work on the same storage +medium. The propagation of these licenses only applies to work which were done +due to knowledge of the source code or output or were intended at some point in +its design to interact primarily with the program. This includes, but is not +limited to, libraries designed for the program, source code that is compiled +using the source code or portions of it, or programs designed specifically to +interact with this program closely invoking its execution with arguments or +inputs. + +Any time you distribute the program the recipient is automatically granted this +license from the original licensor. You may not impose any greater restrictions +to the recipient and it is not your responsibility to enforce this compliance +of this license by its recipients. + +You may copy and distribute, according to the terms and conditions of this +license, any modified version of the program or portion of it, creating a +derivative work, as long as all of the following conditions are met: + +1. You must record what files you have changed and when they were changed and +include that record in the source code. Any files part of the source code which +were changed must have clear and obvious notices of what was changed. You can +record your changes in an external file included with the source code so long as +the files which were changed contain a clear and obvious notice pointing to the +external file. + +2. You must allow any code you distribute that is derived from the program or +contains the program, in whole or in part, to be governed under this license. + +3. You must grant an Author's Recursive License, as described in the section +Authors' Recursive License to any copyright holder of any source code used in +the program that your modifications interact with. You also grant the same +Authors' Recursive License to anyone that copyright holder had to issue an +Authors' Recursive License to in order to publish modifications. Interactions +are included, but not limited to, calling of functions, calling or using parts +of a class, using variables provided by the interface, and any similar +interaction. + +4. If any notices are displayed in the output of the program making a notice of +warranty or license they must remain intact. If the nature of the program is +changed such that the output containing any such notices are no longer used an +equivalent notice must be placed elsewhere in the output in plain sight. The +only exception to this is if the program will no longer have any output at all, +or the output it produces is inappropriate to contain such a notice. + + + +F. AUTHORS' RECURSIVE LICENSE + +The Recursive Authors' License gives the following rights and privileges to the +individuals explained in section E subsection 3 above. The license is as +follows, ending at the end of this section: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistribution of source code must retain the any copyright notices, and a +copy of this license, and any references to this license in the source code. + +2. Redistribution in binary form must reproduce any copyright notices, and a +copy of this license. + +3. The names of its contributors and copyright holders may not be used to +endorse or promote products derived from this software without specific prior +written permission. + +4. The disclaimer in section G of this license is accepted. + + +G. DISCLAIMER + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/NOTICE b/NOTICE index 7e1be79..434e376 100644 --- a/NOTICE +++ b/NOTICE @@ -1,14 +1,14 @@ -Copyright © 2012 Joe Littlejohn - -Licensed 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. - +Copyright: (c) Syncleus, Inc. + +You may redistribute and modify this source code under the terms and +conditions of the Open Source Community License - Type C version 1.0 +or any later version as published by Syncleus, Inc. at www.syncleus.com. +There should be a copy of the license included with this file. If a copy +of the license is not included you are granted no right to distribute or +otherwise use this file except through a legal and valid license. You +should also contact Syncleus, Inc. at the information below if you cannot +find a license: + +Syncleus, Inc. +2604 South 12th Street +Philadelphia, PA 19148 diff --git a/README.md b/README.md index 9224da2..a8f1dbc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -embedmongo-maven-plugin [](https://travis-ci.org/joelittlejohn/embedmongo-maven-plugin) +maven-mongodb-plugin ======================= Maven plugin wrapper for the [flapdoodle.de embedded MongoDB API](http://github.com/flapdoodle-oss/embedmongo.flapdoodle.de). @@ -10,9 +10,9 @@ Usage ```xml <plugin> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin</artifactId> - <version>0.1.12</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> + <version>1.0.0</version> <executions> <execution> <id>start</id> diff --git a/pom.xml b/pom.xml index 299024b..8d9ee0c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,48 +1,121 @@ +<!-- + ******************************************************************************* + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + ******************************************************************************* +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.sonatype.oss</groupId> - <artifactId>oss-parent</artifactId> - <version>7</version> - </parent> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin</artifactId> - <version>0.1.13-SNAPSHOT</version> - + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> + <version>1.0.0-SNAPSHOT</version> <packaging>maven-plugin</packaging> - <name>embedmongo-maven-plugin</name> + <name>maven-mongodb-plugin</name> <description>Maven plugin wrapper for the flapdoodle.de embedded MongoDB API.</description> - <url>http://github.com/joelittlejohn/embedmongo-maven-plugin</url> + <url>http://wiki.syncleus.com/index.php/maven-mongodb-plugin</url> <inceptionYear>2012</inceptionYear> - <issueManagement> - <system>GitHub</system> - <url>https://github.com/joelittlejohn/embedmongo-maven-plugin/issues</url> - </issueManagement> - <licenses> <license> - <name>The Apache Software License, Version 2.0</name> - <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + <name>Open Source Community License - Type C version 1.0 or later</name> + <url>http://wiki.syncleus.com/images/3/3b/Oscl-c.txt</url> + <distribution>repo</distribution> </license> </licenses> + <organization> + <name>Syncleus</name> + <url>http://www.syncleus.com</url> + </organization> + <scm> - <url>http://github.com/joelittlejohn/embedmongo-maven-plugin/tree/master</url> - <connection>scm:git:git@github.com:joelittlejohn/embedmongo-maven-plugin.git</connection> - <developerConnection>scm:git:git@github.com:joelittlejohn/embedmongo-maven-plugin.git</developerConnection> - <tag>HEAD</tag> + <connection>scm:git:http://gerrit.syncleus.com/maven-mongodb-plugin</connection> + <developerConnection>scm:git:ssh://gerrit.syncleus.com:29418/maven-mongodb-plugin</developerConnection> + <url>http://gerrit.syncleus.com/maven-mongodb-plugin</url> </scm> + <ciManagement> + <system>jenkins</system> + <url>http://builds.syncleus.com/</url> + </ciManagement> + + <issueManagement> + <system>JIRA</system> + <url>http://bugs.syncleus.com/browse/MMP/</url> + </issueManagement> + + <mailingLists> + <mailingList> + <name>Syncleus Announcements</name> + <subscribe>syncleus-announce-list+subscribe@syncleus.com</subscribe> + <unsubscribe>syncleus-announce-list+unsubscribe@syncleus.com</unsubscribe> + <post>syncleus-announce-list@syncleus.com</post> + <archive>https://groups.google.com/a/syncleus.com/forum/#!forum/syncleus-announce-list</archive> + </mailingList> + <mailingList> + <name>Syncleus Development</name> + <subscribe>syncleus-dev-list+subscribe@syncleus.com</subscribe> + <unsubscribe>syncleus-dev-list+unsubscribe@syncleus.com</unsubscribe> + <post>syncleus-dev-list@syncleus.com</post> + <archive>https://groups.google.com/a/syncleus.com/forum/#!forum/syncleus-dev-list</archive> + </mailingList> + <mailingList> + <name>maven-mongodb-plugin</name> + <subscribe>maven-mongodb-plugin-list+subscribe@syncleus.com</subscribe> + <unsubscribe>maven-mongodb-plugin-list+unsubscribe@syncleus.com</unsubscribe> + <post>maven-mongodb-plugin-list@syncleus.com</post> + <archive>https://groups.google.com/a/syncleus.com/forum/#!forum/maven-mongodb-plugin-list</archive> + </mailingList> + </mailingLists> + + <developers> + <developer> + <id>JeffreyPhillipsFreeman</id> + <name>Jeffrey Phillips Freeman</name> + <email>Jeffrey.Freeman@Syncleus.com</email> + <url>http://JeffreyFreeman.me</url> + <organization>Syncleus</organization> + <organizationUrl>http://www.syncleus.com</organizationUrl> + <roles> + <role>Chief Technology Officer</role> + <role>Project Owner</role> + <role>Developer</role> + </roles> + <timezone>-5</timezone> + </developer> + </developers> + <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <tagNameFormat>@{project.version}</tagNameFormat> </properties> + <distributionManagement> + <repository> + <id>ossrh.releases</id> + <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> + </repository> + <snapshotRepository> + <id>ossrh.snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + </snapshotRepository> + </distributionManagement> + <build> <plugins> <plugin> @@ -82,10 +155,23 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <configuration> - <!-- http://jira.codehaus.org/browse/MGPG-9 --> <mavenExecutorId>forked-path</mavenExecutorId> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <version>1.6</version> + <executions> + <execution> + <id>sign-artifacts</id> + <phase>verify</phase> + <goals> + <goal>sign</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build> @@ -93,17 +179,17 @@ <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> - <version>2.0</version> + <version>3.3.3</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-project</artifactId> - <version>2.0</version> + <version>2.2.1</version> </dependency> <dependency> <groupId>de.flapdoodle.embed</groupId> <artifactId>de.flapdoodle.embed.mongo</artifactId> - <version>1.46.0</version> + <version>1.47.3</version> </dependency> <dependency> <groupId>junit</groupId> @@ -113,34 +199,4 @@ </dependency> </dependencies> - <profiles> - <profile> - <id>release-sign-artifacts</id> - <activation> - <property> - <name>performRelease</name> - <value>true</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-gpg-plugin</artifactId> - <version>1.1</version> - <executions> - <execution> - <id>sign-artifacts</id> - <phase>verify</phase> - <goals> - <goal>sign</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> - </project> diff --git a/src/main/java/com/github/joelittlejohn/embedmongo/PortUtils.java b/src/main/java/com/github/joelittlejohn/embedmongo/PortUtils.java deleted file mode 100644 index 3e94b25..0000000 --- a/src/main/java/com/github/joelittlejohn/embedmongo/PortUtils.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright © 2012 Joe Littlejohn - * - * Licensed 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. - */ -package com.github.joelittlejohn.embedmongo; - -import java.io.IOException; -import java.net.ServerSocket; - -public final class PortUtils { - - private PortUtils() { - } - - public static int allocateRandomPort() { - try { - ServerSocket server = new ServerSocket(0); - int port = server.getLocalPort(); - server.close(); - return port; - } catch (IOException e) { - throw new RuntimeException("Failed to acquire a random free port", e); - } - } - -} diff --git a/src/main/java/com/github/joelittlejohn/embedmongo/log/NoopStreamProcessor.java b/src/main/java/com/github/joelittlejohn/embedmongo/log/NoopStreamProcessor.java deleted file mode 100644 index a7de69d..0000000 --- a/src/main/java/com/github/joelittlejohn/embedmongo/log/NoopStreamProcessor.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright © 2012 Joe Littlejohn - * - * Licensed 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. - */ -package com.github.joelittlejohn.embedmongo.log; - -import de.flapdoodle.embed.process.io.IStreamProcessor; - -public class NoopStreamProcessor implements IStreamProcessor { - - @Override - public void process(String block) { - } - - @Override - public void onProcessed() { - } - -} diff --git a/src/main/java/com/syncleus/maven/plugins/mongodb/PortUtils.java b/src/main/java/com/syncleus/maven/plugins/mongodb/PortUtils.java new file mode 100644 index 0000000..17336b9 --- /dev/null +++ b/src/main/java/com/syncleus/maven/plugins/mongodb/PortUtils.java @@ -0,0 +1,38 @@ +/** + * Copyright: (c) Syncleus, Inc. + * + * You may redistribute and modify this source code under the terms and + * conditions of the Open Source Community License - Type C version 1.0 + * or any later version as published by Syncleus, Inc. at www.syncleus.com. + * There should be a copy of the license included with this file. If a copy + * of the license is not included you are granted no right to distribute or + * otherwise use this file except through a legal and valid license. You + * should also contact Syncleus, Inc. at the information below if you cannot + * find a license: + * + * Syncleus, Inc. + * 2604 South 12th Street + * Philadelphia, PA 19148 + */ +package com.syncleus.maven.plugins.mongodb; + +import java.io.IOException; +import java.net.ServerSocket; + +public final class PortUtils { + + private PortUtils() { + } + + public static int allocateRandomPort() { + try { + ServerSocket server = new ServerSocket(0); + int port = server.getLocalPort(); + server.close(); + return port; + } catch (IOException e) { + throw new RuntimeException("Failed to acquire a random free port", e); + } + } + +} diff --git a/src/main/java/com/github/joelittlejohn/embedmongo/StartEmbeddedMongoMojo.java b/src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java similarity index 82% rename from src/main/java/com/github/joelittlejohn/embedmongo/StartEmbeddedMongoMojo.java rename to src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java index d181248..c61ab8c 100644 --- a/src/main/java/com/github/joelittlejohn/embedmongo/StartEmbeddedMongoMojo.java +++ b/src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java @@ -1,19 +1,20 @@ /** - * Copyright © 2012 Joe Littlejohn + * Copyright: (c) Syncleus, Inc. * - * Licensed 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 + * You may redistribute and modify this source code under the terms and + * conditions of the Open Source Community License - Type C version 1.0 + * or any later version as published by Syncleus, Inc. at www.syncleus.com. + * There should be a copy of the license included with this file. If a copy + * of the license is not included you are granted no right to distribute or + * otherwise use this file except through a legal and valid license. You + * should also contact Syncleus, Inc. at the information below if you cannot + * find a license: * - * 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. + * Syncleus, Inc. + * 2604 South 12th Street + * Philadelphia, PA 19148 */ -package com.github.joelittlejohn.embedmongo; +package com.syncleus.maven.plugins.mongodb; import static java.util.Collections.*; @@ -35,8 +36,8 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.project.MavenProject; -import com.github.joelittlejohn.embedmongo.log.Loggers; -import com.github.joelittlejohn.embedmongo.log.Loggers.LoggingStyle; +import com.syncleus.maven.plugins.mongodb.log.Loggers; +import com.syncleus.maven.plugins.mongodb.log.Loggers.LoggingStyle; import de.flapdoodle.embed.mongo.Command; import de.flapdoodle.embed.mongo.MongodExecutable; @@ -64,23 +65,23 @@ import de.flapdoodle.embed.process.store.IArtifactStore; /** * When invoked, this goal starts an instance of mongo. The required binaries - * are downloaded if no mongo release is found in <code>~/.embedmongo</code>. + * are downloaded if no mongo release is found in <code>~/.mongodb</code>. * * @goal start * @phase pre-integration-test * @see <a * href="http://github.com/flapdoodle-oss/embedmongo.flapdoodle.de">http://github.com/flapdoodle-oss/embedmongo.flapdoodle.de</a> */ -public class StartEmbeddedMongoMojo extends AbstractMojo { +public class StartMongoMojo extends AbstractMojo { - private static final String PACKAGE_NAME = StartEmbeddedMongoMojo.class.getPackage().getName(); + private static final String PACKAGE_NAME = StartMongoMojo.class.getPackage().getName(); public static final String MONGOD_CONTEXT_PROPERTY_NAME = PACKAGE_NAME + ".mongod"; /** * The port MongoDB should run on. * - * @parameter expression="${embedmongo.port}" default-value="27017" - * @since 0.1.0 + * @parameter expression="${mongodb.port}" default-value="27017" + * @since 1.0.0 */ private int port; @@ -90,24 +91,24 @@ public class StartEmbeddedMongoMojo extends AbstractMojo { * random port chosen will be available in the Maven project property * {@code embedmongo.port}. * - * @parameter expression="${embedmongo.randomPort}" default-value="false" - * @since 0.1.8 + * @parameter expression="${mongodb.randomPort}" default-value="false" + * @since 1.0.0 */ private boolean randomPort; /** * The version of MongoDB to run e.g. 2.1.1, 1.6 v1.8.2, V2_0_4, * - * @parameter expression="${embedmongo.version}" default-value="2.2.1" - * @since 0.1.0 + * @parameter expression="${mongodb.version}" default-value="3.0.3" + * @since 1.0.0 */ private String version; /** * The location of a directory that will hold the MongoDB data files. * - * @parameter expression="${embedmongo.databaseDirectory}" - * @since 0.1.0 + * @parameter expression="${mongodb.databaseDirectory}" + * @since 1.0.0 */ private File databaseDirectory; @@ -115,24 +116,24 @@ public class StartEmbeddedMongoMojo extends AbstractMojo { * An IP address for the MongoDB instance to be bound to during its * execution. * - * @parameter expression="${embedmongo.bindIp}" - * @since 0.1.4 + * @parameter expression="${mongodb.bindIp}" + * @since 1.0.0 */ private String bindIp; /** * A proxy hostname to be used when downloading MongoDB distributions. * - * @parameter expression="${embedmongo.proxyHost}" - * @since 0.1.1 + * @parameter expression="${mongodb.proxyHost}" + * @since 1.0.0 */ private String proxyHost; /** * A proxy port to be used when downloading MongoDB distributions. * - * @parameter expression="${embedmongo.proxyPort}" default-value="80" - * @since 0.1.1 + * @parameter expression="${mongodb.proxyPort}" default-value="80" + * @since 1.0.0 */ private int proxyPort; @@ -141,60 +142,60 @@ public class StartEmbeddedMongoMojo extends AbstractMojo { * {@literal <ctrl-c>}). This option makes this goal similar in spirit to * something like jetty:run, useful for interactive debugging. * - * @parameter expression="${embedmongo.wait}" default-value="false" - * @since 0.1.2 + * @parameter expression="${mongodb.wait}" default-value="false" + * @since 1.0.0 */ private boolean wait; /** - * @parameter expression="${embedmongo.logging}" default-value="console" - * @since 0.1.3 + * @parameter expression="${mongodb.logging}" default-value="console" + * @since 1.0.0 */ private String logging; /** - * @parameter expression="${embedmongo.logFile}" + * @parameter expression="${mongodb.logFile}" * default-value="embedmongo.log" - * @since 0.1.7 + * @since 1.0.0 */ private String logFile; /** - * @parameter expression="${embedmongo.logFileEncoding}" + * @parameter expression="${mongodb.logFileEncoding}" * default-value="utf-8" - * @since 0.1.7 + * @since 1.0.0 */ private String logFileEncoding; /** * The base URL to be used when downloading MongoDB * - * @parameter expression="${embedmongo.downloadPath}" + * @parameter expression="${mongodb.downloadPath}" * default-value="http://fastdl.mongodb.org/" - * @since 0.1.10 + * @since 1.0.0 */ private String downloadPath; /** * The proxy user to be used when downloading MongoDB * - * @parameter expression="${embedmongo.proxyUser}" - * @since 0.1.6 + * @parameter expression="${mongodb.proxyUser}" + * @since 1.0.0 */ private String proxyUser; /** * The proxy password to be used when downloading MondoDB * - * @parameter expression="${embedmongo.proxyPassword}" - * @since 0.1.6 + * @parameter expression="${mongodb.proxyPassword}" + * @since 1.0.0 */ private String proxyPassword; /** * Should authorization be enabled for MongoDB * - * @parameter expression="${embedmongo.authEnabled}" default-value="false" + * @parameter expression="${mongodb.authEnabled}" default-value="false" */ private boolean authEnabled; @@ -207,7 +208,7 @@ public class StartEmbeddedMongoMojo extends AbstractMojo { private MavenProject project; /** - * @parameter expression="${embedmongo.skip}" default-value="false" + * @parameter expression="${mongodb.skip}" default-value="false" */ private boolean skip; diff --git a/src/main/java/com/github/joelittlejohn/embedmongo/StopEmbeddedMongoMojo.java b/src/main/java/com/syncleus/maven/plugins/mongodb/StopMongoMojo.java similarity index 51% rename from src/main/java/com/github/joelittlejohn/embedmongo/StopEmbeddedMongoMojo.java rename to src/main/java/com/syncleus/maven/plugins/mongodb/StopMongoMojo.java index aaf05cc..b0714a5 100644 --- a/src/main/java/com/github/joelittlejohn/embedmongo/StopEmbeddedMongoMojo.java +++ b/src/main/java/com/syncleus/maven/plugins/mongodb/StopMongoMojo.java @@ -1,19 +1,20 @@ /** - * Copyright © 2012 Joe Littlejohn + * Copyright: (c) Syncleus, Inc. * - * Licensed 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 + * You may redistribute and modify this source code under the terms and + * conditions of the Open Source Community License - Type C version 1.0 + * or any later version as published by Syncleus, Inc. at www.syncleus.com. + * There should be a copy of the license included with this file. If a copy + * of the license is not included you are granted no right to distribute or + * otherwise use this file except through a legal and valid license. You + * should also contact Syncleus, Inc. at the information below if you cannot + * find a license: * - * 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. + * Syncleus, Inc. + * 2604 South 12th Street + * Philadelphia, PA 19148 */ -package com.github.joelittlejohn.embedmongo; +package com.syncleus.maven.plugins.mongodb; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; @@ -28,10 +29,10 @@ import de.flapdoodle.embed.mongo.MongodProcess; * @goal stop * @phase post-integration-test */ -public class StopEmbeddedMongoMojo extends AbstractMojo { +public class StopMongoMojo extends AbstractMojo { /** - * @parameter expression="${embedmongo.skip}" default-value="false" + * @parameter expression="${mongodb.skip}" default-value="false" */ private boolean skip; @@ -41,7 +42,7 @@ public class StopEmbeddedMongoMojo extends AbstractMojo { return; } - MongodProcess mongod = (MongodProcess)getPluginContext().get(StartEmbeddedMongoMojo + MongodProcess mongod = (MongodProcess)getPluginContext().get(StartMongoMojo .MONGOD_CONTEXT_PROPERTY_NAME); if (mongod != null) { diff --git a/src/main/java/com/github/joelittlejohn/embedmongo/log/FileOutputStreamProcessor.java b/src/main/java/com/syncleus/maven/plugins/mongodb/log/FileOutputStreamProcessor.java similarity index 66% rename from src/main/java/com/github/joelittlejohn/embedmongo/log/FileOutputStreamProcessor.java rename to src/main/java/com/syncleus/maven/plugins/mongodb/log/FileOutputStreamProcessor.java index 3dee665..b20b8eb 100644 --- a/src/main/java/com/github/joelittlejohn/embedmongo/log/FileOutputStreamProcessor.java +++ b/src/main/java/com/syncleus/maven/plugins/mongodb/log/FileOutputStreamProcessor.java @@ -1,19 +1,20 @@ /** - * Copyright © 2012 Joe Littlejohn + * Copyright: (c) Syncleus, Inc. * - * Licensed 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 + * You may redistribute and modify this source code under the terms and + * conditions of the Open Source Community License - Type C version 1.0 + * or any later version as published by Syncleus, Inc. at www.syncleus.com. + * There should be a copy of the license included with this file. If a copy + * of the license is not included you are granted no right to distribute or + * otherwise use this file except through a legal and valid license. You + * should also contact Syncleus, Inc. at the information below if you cannot + * find a license: * - * 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. + * Syncleus, Inc. + * 2604 South 12th Street + * Philadelphia, PA 19148 */ -package com.github.joelittlejohn.embedmongo.log; +package com.syncleus.maven.plugins.mongodb.log; import java.io.FileOutputStream; import java.io.IOException; diff --git a/src/main/java/com/github/joelittlejohn/embedmongo/log/Loggers.java b/src/main/java/com/syncleus/maven/plugins/mongodb/log/Loggers.java similarity index 60% rename from src/main/java/com/github/joelittlejohn/embedmongo/log/Loggers.java rename to src/main/java/com/syncleus/maven/plugins/mongodb/log/Loggers.java index 99e1a5f..9a53ebb 100644 --- a/src/main/java/com/github/joelittlejohn/embedmongo/log/Loggers.java +++ b/src/main/java/com/syncleus/maven/plugins/mongodb/log/Loggers.java @@ -1,19 +1,20 @@ /** - * Copyright © 2012 Joe Littlejohn + * Copyright: (c) Syncleus, Inc. * - * Licensed 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 + * You may redistribute and modify this source code under the terms and + * conditions of the Open Source Community License - Type C version 1.0 + * or any later version as published by Syncleus, Inc. at www.syncleus.com. + * There should be a copy of the license included with this file. If a copy + * of the license is not included you are granted no right to distribute or + * otherwise use this file except through a legal and valid license. You + * should also contact Syncleus, Inc. at the information below if you cannot + * find a license: * - * 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. + * Syncleus, Inc. + * 2604 South 12th Street + * Philadelphia, PA 19148 */ -package com.github.joelittlejohn.embedmongo.log; +package com.syncleus.maven.plugins.mongodb.log; import de.flapdoodle.embed.mongo.Command; import de.flapdoodle.embed.mongo.config.MongodProcessOutputConfig; diff --git a/src/main/java/com/syncleus/maven/plugins/mongodb/log/NoopStreamProcessor.java b/src/main/java/com/syncleus/maven/plugins/mongodb/log/NoopStreamProcessor.java new file mode 100644 index 0000000..50c9735 --- /dev/null +++ b/src/main/java/com/syncleus/maven/plugins/mongodb/log/NoopStreamProcessor.java @@ -0,0 +1,31 @@ +/** + * Copyright: (c) Syncleus, Inc. + * + * You may redistribute and modify this source code under the terms and + * conditions of the Open Source Community License - Type C version 1.0 + * or any later version as published by Syncleus, Inc. at www.syncleus.com. + * There should be a copy of the license included with this file. If a copy + * of the license is not included you are granted no right to distribute or + * otherwise use this file except through a legal and valid license. You + * should also contact Syncleus, Inc. at the information below if you cannot + * find a license: + * + * Syncleus, Inc. + * 2604 South 12th Street + * Philadelphia, PA 19148 + */ +package com.syncleus.maven.plugins.mongodb.log; + +import de.flapdoodle.embed.process.io.IStreamProcessor; + +public class NoopStreamProcessor implements IStreamProcessor { + + @Override + public void process(String block) { + } + + @Override + public void onProcessed() { + } + +} diff --git a/src/test/java/com/github/joelittlejohn/embedmongo/PortUtilsTest.java b/src/test/java/com/syncleus/maven/plugins/mongodb/PortUtilsTest.java similarity index 71% rename from src/test/java/com/github/joelittlejohn/embedmongo/PortUtilsTest.java rename to src/test/java/com/syncleus/maven/plugins/mongodb/PortUtilsTest.java index fcb9198..e246e4f 100644 --- a/src/test/java/com/github/joelittlejohn/embedmongo/PortUtilsTest.java +++ b/src/test/java/com/syncleus/maven/plugins/mongodb/PortUtilsTest.java @@ -1,19 +1,20 @@ /** - * Copyright © 2012 Joe Littlejohn + * Copyright: (c) Syncleus, Inc. * - * Licensed 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 + * You may redistribute and modify this source code under the terms and + * conditions of the Open Source Community License - Type C version 1.0 + * or any later version as published by Syncleus, Inc. at www.syncleus.com. + * There should be a copy of the license included with this file. If a copy + * of the license is not included you are granted no right to distribute or + * otherwise use this file except through a legal and valid license. You + * should also contact Syncleus, Inc. at the information below if you cannot + * find a license: * - * 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. + * Syncleus, Inc. + * 2604 South 12th Street + * Philadelphia, PA 19148 */ -package com.github.joelittlejohn.embedmongo; +package com.syncleus.maven.plugins.mongodb; import java.io.IOException; import java.net.ServerSocket; @@ -37,7 +38,7 @@ public class PortUtilsTest { /** * This test executes method - * {@link com.github.joelittlejohn.embedmongo.PortUtils#allocateRandomPort()} + * {@link PortUtils#allocateRandomPort()} * many times concurrently to make sure that port allocation works correctly * under stress. */ diff --git a/src/test/resources/example1/pom.xml b/src/test/resources/example1/pom.xml index 8d418c6..2ac8bb4 100644 --- a/src/test/resources/example1/pom.xml +++ b/src/test/resources/example1/pom.xml @@ -1,34 +1,51 @@ +<!-- + ******************************************************************************* + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + ******************************************************************************* +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-test-parent</artifactId> - <version>0.1.0-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-test-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> </parent> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-test1</artifactId> - <version>0.1.0-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-test1</artifactId> + <version>1.0.0-SNAPSHOT</version> - <url>https://github.com/joelittlejohn/embedmongo-maven-plugin</url> + <url>http://wiki.syncleus.com/index.php/maven-mongodb-plugin</url> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>2.4</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin</artifactId> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> <executions> <execution> <id>start</id> diff --git a/src/test/resources/example2/pom.xml b/src/test/resources/example2/pom.xml index c2aa00e..1ed9a9c 100644 --- a/src/test/resources/example2/pom.xml +++ b/src/test/resources/example2/pom.xml @@ -1,34 +1,51 @@ +<!-- + ******************************************************************************* + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + ******************************************************************************* +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-test-parent</artifactId> - <version>0.1.0-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-test-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> </parent> - - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-test2</artifactId> - <version>0.1.0-SNAPSHOT</version> - <url>https://github.com/joelittlejohn/embedmongo-maven-plugin</url> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-test2</artifactId> + <version>1.0.0-SNAPSHOT</version> + + <url>http://wiki.syncleus.com/index.php/maven-mongodb-plugin</url> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>2.4</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin</artifactId> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> <executions> <execution> <id>start</id> diff --git a/src/test/resources/example3/pom.xml b/src/test/resources/example3/pom.xml index 1c9161a..e224016 100644 --- a/src/test/resources/example3/pom.xml +++ b/src/test/resources/example3/pom.xml @@ -1,34 +1,51 @@ +<!-- + ******************************************************************************* + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + ******************************************************************************* +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-test-parent</artifactId> - <version>0.1.0-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-test-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> </parent> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-test3</artifactId> - <version>0.1.0-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-test3</artifactId> + <version>1.0.0-SNAPSHOT</version> - <url>https://github.com/joelittlejohn/embedmongo-maven-plugin</url> + <url>http://wiki.syncleus.com/index.php/maven-mongodb-plugin</url> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>2.4</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin</artifactId> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> <executions> <execution> <id>start</id> diff --git a/src/test/resources/pom.xml b/src/test/resources/pom.xml index c74c496..bc5a4eb 100644 --- a/src/test/resources/pom.xml +++ b/src/test/resources/pom.xml @@ -1,14 +1,32 @@ +<!-- + ******************************************************************************* + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + ******************************************************************************* +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-test-parent</artifactId> - <version>0.1.0-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-test-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> <packaging>pom</packaging> - <url>https://github.com/joelittlejohn/embedmongo-maven-plugin</url> + <url>http://wiki.syncleus.com/index.php/maven-mongodb-plugin</url> <modules> <module>example1</module> @@ -17,15 +35,48 @@ <module>randomport</module> </modules> + <repositories> + <repository> + <id>ossrh.snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <build> <pluginManagement> <plugins> <plugin> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin</artifactId> - <version>0.1.11-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> + <version>1.0.0-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.12.4</version> </plugin> </plugins> </pluginManagement> </build> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> + <version>1.0.0-SNAPSHOT</version> + </dependency> + </dependencies> + </dependencyManagement> </project> diff --git a/src/test/resources/randomport/pom.xml b/src/test/resources/randomport/pom.xml index be6aa3f..c105923 100644 --- a/src/test/resources/randomport/pom.xml +++ b/src/test/resources/randomport/pom.xml @@ -1,35 +1,52 @@ +<!-- + ******************************************************************************* + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + ******************************************************************************* +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-test-parent</artifactId> - <version>0.1.0-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-test-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> </parent> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin-random-port-test</artifactId> - <version>0.1.0-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin-random-port-test</artifactId> + <version>1.0.0-SNAPSHOT</version> <packaging>jar</packaging> - <url>https://github.com/joelittlejohn/embedmongo-maven-plugin</url> + <url>http://wiki.syncleus.com/index.php/maven-mongodb-plugin</url> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>2.4</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin</artifactId> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> <executions> <execution> <id>start</id> @@ -56,7 +73,6 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> - <version>2.12.4</version> <executions> <execution> <goals> @@ -65,7 +81,7 @@ </goals> <configuration> <systemPropertyVariables> - <mongo.port>${embedmongo.port}</mongo.port> + <mongo.port>${mongodb.port}</mongo.port> </systemPropertyVariables> </configuration> </execution> @@ -78,13 +94,12 @@ <dependency> <groupId>junit</groupId> <artifactId>junit-dep</artifactId> - <version>4.10</version> + <version>4.12</version> <scope>test</scope> </dependency> <dependency> - <groupId>com.github.joelittlejohn.embedmongo</groupId> - <artifactId>embedmongo-maven-plugin</artifactId> - <version>0.1.11-SNAPSHOT</version> + <groupId>com.syncleus.maven.plugins</groupId> + <artifactId>maven-mongodb-plugin</artifactId> </dependency> </dependencies> diff --git a/src/test/resources/randomport/src/test/java/com/github/joelittlejohn/embedmongo/MongoIT.java b/src/test/resources/randomport/src/test/java/com/github/joelittlejohn/embedmongo/MongoIT.java deleted file mode 100644 index a1424d3..0000000 --- a/src/test/resources/randomport/src/test/java/com/github/joelittlejohn/embedmongo/MongoIT.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright © 2012 Joe Littlejohn - * - * Licensed 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. - */ -package com.github.joelittlejohn.embedmongo; - -import java.net.Socket; - -import org.junit.After; -import org.junit.Test; - -public class MongoIT { - - private Socket mongoSocket; - - @Test - public void testConnectMongo() throws Exception { - mongoSocket = new Socket("127.0.0.1", Integer.valueOf(System.getProperty("mongo.port"))); - } - - @After - public void tearDown() throws Exception { - if (mongoSocket != null) { - mongoSocket.close(); - } - } -} diff --git a/src/test/resources/randomport/src/test/java/com/syncleus/maven/plugins/mongodb/MongoIT.java b/src/test/resources/randomport/src/test/java/com/syncleus/maven/plugins/mongodb/MongoIT.java new file mode 100644 index 0000000..79128db --- /dev/null +++ b/src/test/resources/randomport/src/test/java/com/syncleus/maven/plugins/mongodb/MongoIT.java @@ -0,0 +1,39 @@ +/** + * Copyright: (c) Syncleus, Inc. + * + * You may redistribute and modify this source code under the terms and + * conditions of the Open Source Community License - Type C version 1.0 + * or any later version as published by Syncleus, Inc. at www.syncleus.com. + * There should be a copy of the license included with this file. If a copy + * of the license is not included you are granted no right to distribute or + * otherwise use this file except through a legal and valid license. You + * should also contact Syncleus, Inc. at the information below if you cannot + * find a license: + * + * Syncleus, Inc. + * 2604 South 12th Street + * Philadelphia, PA 19148 + */ +package com.syncleus.maven.plugins.mongodb; + +import java.net.Socket; + +import org.junit.After; +import org.junit.Test; + +public class MongoIT { + + private Socket mongoSocket; + + @Test + public void testConnectMongo() throws Exception { + mongoSocket = new Socket("127.0.0.1", Integer.valueOf(System.getProperty("mongo.port"))); + } + + @After + public void tearDown() throws Exception { + if (mongoSocket != null) { + mongoSocket.close(); + } + } +} -- GitLab