├── .editorconfig ├── .github ├── CODEOWNERS └── ISSUE_TEMPLATE │ ├── 01-template-for-feature.md │ ├── 02-template-for-bug.md │ ├── 03-template-for-task.md │ └── config.yml ├── .gitignore ├── LICENSE ├── pom.xml ├── readme.adoc └── src ├── it ├── analyze │ └── exclude-constraint │ │ ├── .jqassistant.yml │ │ ├── jqassistant │ │ └── it.xml │ │ ├── pom.xml │ │ └── verify.groovy ├── cli │ └── project-without-plugin │ │ ├── invoker.properties │ │ ├── jqassistant │ │ └── default.xml │ │ ├── module1 │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── A.java │ │ ├── module2 │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── B.java │ │ ├── pom.xml │ │ └── verify.groovy ├── configuration │ ├── effective-configuration │ │ ├── invoker.properties │ │ ├── pom.xml │ │ └── verify.groovy │ ├── embedded │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── external │ │ ├── .jqassistant-custom.yml │ │ ├── .jqassistant.yml │ │ ├── .jqassistant │ │ │ └── analyze.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── overrides │ │ ├── .jqassistant.yml │ │ ├── README.md │ │ ├── jqassistant │ │ │ └── it.xml │ │ ├── module │ │ │ ├── .jqassistant.yml │ │ │ ├── README-module.md │ │ │ └── pom.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── profile │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── pom.xml │ │ └── verify.groovy │ └── store │ │ ├── invoker.properties │ │ ├── pom.xml │ │ └── verify.groovy ├── list-plugins │ ├── invoker.properties │ ├── pom.xml │ └── verify.groovy ├── multimodule │ ├── multiparent │ │ ├── singlestore │ │ │ ├── invoker.properties │ │ │ ├── jqassistant │ │ │ │ └── default.xml │ │ │ ├── module1 │ │ │ │ └── pom.xml │ │ │ ├── module2 │ │ │ │ └── pom.xml │ │ │ ├── pom.xml │ │ │ └── verify.groovy │ │ └── site │ │ │ ├── invoker.properties │ │ │ ├── module1 │ │ │ ├── jqassistant │ │ │ │ └── default.xml │ │ │ └── pom.xml │ │ │ ├── module2 │ │ │ ├── jqassistant │ │ │ │ └── default.xml │ │ │ └── pom.xml │ │ │ ├── pom.xml │ │ │ └── verify.groovy │ └── singleparent │ │ ├── analyze-lastmodule │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── module1 │ │ │ └── pom.xml │ │ ├── module2 │ │ │ └── pom.xml │ │ ├── module3 │ │ │ └── pom.xml │ │ ├── module4 │ │ │ └── pom.xml │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── artifact-dependencies │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── module1 │ │ │ └── pom.xml │ │ ├── module2 │ │ │ └── pom.xml │ │ ├── module3 │ │ │ └── pom.xml │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── attach-report-archive │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── module1 │ │ │ └── pom.xml │ │ ├── module2 │ │ │ └── pom.xml │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── cliwithoutplugin │ │ └── module1 │ │ │ └── pom.xml │ │ ├── customruledir │ │ ├── .jqassistant.yml │ │ ├── build-config │ │ │ └── jqa-rules │ │ │ │ └── default.xml │ │ ├── invoker.properties │ │ ├── module1 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── A.java │ │ ├── module2 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── B.java │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── dependency-tree │ │ ├── .jqassistant.yml │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── module1 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── maven │ │ │ │ └── it │ │ │ │ └── dependency_tree │ │ │ │ └── module1 │ │ │ │ └── service │ │ │ │ └── Service1.java │ │ ├── module2 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── maven │ │ │ │ └── it │ │ │ │ └── dependency_tree │ │ │ │ └── module2 │ │ │ │ └── service │ │ │ │ └── Service2.java │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── dependency │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── module1 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── buschmais │ │ │ │ │ └── jqassistant │ │ │ │ │ └── maven │ │ │ │ │ └── module1 │ │ │ │ │ └── A.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── maven │ │ │ │ └── module1 │ │ │ │ └── ATest.java │ │ ├── module2 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── buschmais │ │ │ │ │ └── jqassistant │ │ │ │ │ └── maven │ │ │ │ │ └── module2 │ │ │ │ │ └── B.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── maven │ │ │ │ └── module2 │ │ │ │ └── BTest.java │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── execrootasprojectroot │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── index.xml │ │ ├── module-a │ │ │ ├── api │ │ │ │ └── pom.xml │ │ │ ├── impl │ │ │ │ └── pom.xml │ │ │ └── pom.xml │ │ ├── module-b │ │ │ ├── api │ │ │ │ └── pom.xml │ │ │ ├── impl │ │ │ │ └── pom.xml │ │ │ └── pom.xml │ │ ├── module-c │ │ │ └── pom.xml │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── parentasmodule │ │ ├── invoker.properties │ │ ├── module1 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── module1 │ │ │ │ └── App.java │ │ ├── module2 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── module2 │ │ │ │ └── App.java │ │ ├── parent │ │ │ ├── jqassistant │ │ │ │ └── default.xml │ │ │ └── pom.xml │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── project-artifacts │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── main-and-test │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── buschmais │ │ │ │ │ └── jqassistant │ │ │ │ │ └── maven │ │ │ │ │ └── main_and_test │ │ │ │ │ └── B.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── maven │ │ │ │ └── main_and_test │ │ │ │ └── BTest.java │ │ ├── main-only │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── maven │ │ │ │ └── main_only │ │ │ │ └── A.java │ │ ├── pom.xml │ │ └── test-only │ │ │ ├── pom.xml │ │ │ └── src │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── buschmais │ │ │ └── jqassistant │ │ │ └── maven │ │ │ └── test_only │ │ │ └── ATest.java │ │ ├── scan-reset │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── module1 │ │ │ └── pom.xml │ │ ├── module2 │ │ │ └── pom.xml │ │ ├── module3 │ │ │ └── pom.xml │ │ ├── pom.xml │ │ └── verify.groovy │ │ ├── site │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── module1 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── A.java │ │ ├── module2 │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── B.java │ │ ├── pom.xml │ │ └── verify.groovy │ │ └── skip │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ └── default.xml │ │ ├── module1 │ │ └── pom.xml │ │ ├── module2 │ │ └── pom.xml │ │ ├── pom.xml │ │ └── verify.groovy ├── neo4j-plugin │ ├── .jqassistant.yml │ ├── invoker.properties │ ├── jqassistant │ │ └── default.xml │ ├── pom.xml │ └── verify.groovy ├── plugin │ ├── customplugin │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── scm │ │ │ │ └── maven │ │ │ │ └── integration │ │ │ │ └── plugin │ │ │ │ ├── CustomDescriptor.java │ │ │ │ ├── CustomReportPlugin.java │ │ │ │ └── CustomScannerPlugin.java │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── jqassistant-plugin.xml │ ├── invoker.properties │ ├── pom.xml │ ├── site │ │ ├── .jqassistant.yml │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── buschmais │ │ │ └── jqassistant │ │ │ └── scm │ │ │ └── maven │ │ │ └── Foo.java │ └── verify.groovy ├── pom.xml ├── settings.xml ├── singlemodule │ ├── defaultseverity │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── deprecated-rules │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── it.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── export-rules │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── failonseverity │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ └── pom.xml │ ├── junit-report │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── maven │ │ │ │ └── it │ │ │ │ └── Service.java │ │ └── verify.groovy │ ├── model │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── buschmais │ │ │ │ │ └── jqassistant │ │ │ │ │ └── maven │ │ │ │ │ └── it │ │ │ │ │ └── Service.java │ │ │ └── src │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── buschmais │ │ │ │ └── jqassistant │ │ │ │ └── maven │ │ │ │ └── it │ │ │ │ └── ServiceTest.java │ │ └── verify.groovy │ ├── ruleparameter │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── scanincludes │ │ ├── .jqassistant.yml │ │ ├── config │ │ │ └── test.properties │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── severity │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── shade │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ ├── site │ │ ├── invoker.properties │ │ ├── jqassistant │ │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy │ └── skip │ │ ├── .jqassistant.yml │ │ ├── invoker.properties │ │ ├── jqassistant │ │ └── default.xml │ │ ├── pom.xml │ │ └── verify.groovy └── yaml │ ├── one-concept │ ├── .jqassistant.yml │ ├── invoker.properties │ ├── jqassistant │ │ └── default.yaml │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── buschmais │ │ │ └── jqassistant │ │ │ └── maven │ │ │ └── it │ │ │ └── yaml │ │ │ └── oneconcept │ │ │ └── Service.java │ └── verify.groovy │ └── violated-constraint │ ├── .jqassistant.yml │ ├── invoker.properties │ ├── jqassistant │ └── default.yaml │ ├── pom.xml │ ├── src │ └── main │ │ └── java │ │ └── com │ │ └── buschmais │ │ └── jqassistant │ │ └── maven │ │ └── it │ │ └── yaml │ │ └── violatedconstraint │ │ ├── AClass.java │ │ └── AnInterface.java │ └── verify.groovy └── main ├── asciidoc ├── readme.adoc └── release-notes.adoc ├── java └── com │ └── buschmais │ └── jqassistant │ └── scm │ └── maven │ ├── AbstractModuleMojo.java │ ├── AbstractMojo.java │ ├── AbstractProjectMojo.java │ ├── AbstractRuleMojo.java │ ├── AnalyzeMojo.java │ ├── AvailableRulesMojo.java │ ├── AvailableScopesMojo.java │ ├── EffectiveConfigurationMojo.java │ ├── EffectiveRulesMojo.java │ ├── ExportRulesMojo.java │ ├── ListPluginsMojo.java │ ├── MojoExecutionContext.java │ ├── ReportMojo.java │ ├── ResetMojo.java │ ├── ScanMojo.java │ ├── ServerMojo.java │ ├── configuration │ ├── Maven.java │ ├── MavenConfiguration.java │ ├── Module.java │ └── source │ │ ├── AbstractObjectValueConfigSource.java │ │ ├── EmptyConfigSource.java │ │ ├── MavenProjectConfigSource.java │ │ ├── MavenPropertiesConfigSource.java │ │ └── SettingsConfigSource.java │ └── provider │ ├── CachingStoreProvider.java │ └── PluginRepositoryProvider.java └── resources └── META-INF ├── m2e └── lifecycle-mapping-metadata.xml └── maven └── extension.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | insert_final_newline = true 8 | indent_style = space 9 | 10 | [*.{java,xml}] 11 | indent_size = 4 12 | trim_trailing_whitespace = true 13 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @obfischer @DirkMahler @StephanPirnbaum 2 | 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/01-template-for-feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request Template 3 | about: Request a feature for this particular subproject. 4 | title: New Feature 5 | labels: status:teamdiscussion 6 | assignees: '' 7 | 8 | --- 9 | _This hint can be removed_ 10 | **We are happy, what you are going to send us your feature request. Please try to fillout as many sections as good as you can. If you can't provide us any information for a particular section, that is not problem. It is more important to us, to know more about our users and their needs. Even if this template looks very formal, we aren't.** 11 | 12 | ### Feature Description 13 | _Remove this hint: Provide here a short description of the feature you would like to see. Try to use the form of a user story. See https://en.wikipedia.org/wiki/User_story._ 14 | 15 | I, as... 16 | would like... 17 | to that... 18 | 19 | ### Additional information on the requested Feature 20 | _Remove this hint: Feel free to let us know what ever you wan't :wink:_ 21 | 22 | ### How to Test 23 | _Remove this hint: How can we test if the feature works as you expect it to work?_ 24 | 25 | To test this feature... 26 | 27 | ### Available Test data 28 | _Remove this hint: To test new features, we need some examples or test data sets. Please let us know if you can provide them for us or there we can find them. 29 | 30 | ### Definition of Done for the Implementers 31 | _Remove this hint: these checkboxes can be checked like this: [x]_ 32 | - [ ] We got a final feedback from the reporting user (_if applicable_) 33 | - [ ] Unittests have been written (_if applicable_) 34 | - [ ] Integration tests have been written (_if applicable_) 35 | - [ ] Test coverage is the same or even better then before (_if applicable_) 36 | - [ ] Documentation has been written (_if applicable_) 37 | - [ ] Added a note on the new feature to the release notes (_if applicable_) 38 | 39 | 40 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/02-template-for-bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report Template 3 | about: Report a bug using this template. 4 | title: Bug Report 5 | labels: type:bug 6 | assignees: '' 7 | --- 8 | 9 | _Remove this hint:_ 10 | **We are happy, to know about the problems you have while using jQAssistant. Sometimes we learn 11 | more about us and our projects from the bugs you find. Please try to fillout as many sections as good as you can. 12 | If you can't provide us any information for a particular section, that is not problem. 13 | Even if this template looks very formal, we aren't.** 14 | 15 | ### Bug Description 16 | 17 | 18 | ### Expected Behaviour 19 | _Remove this hint: What did you actual expect from jQAssistant?_ 20 | 21 | ### Your Environment 22 | _Remove this hint: Some bugs are releated to the environment jQAssitant is running in. Please help us 23 | to find out, if the problem is only related to the crappy code we have written or to the environment._ 24 | 25 | - *JDK:* 26 | - *OS:* 27 | - *XYZ:* 28 | 29 | ### How can we reproduce the bug? 30 | _Remove this hint: Pick one of these options. Use the Preview feature of this editor to get a sense which option we like best_ 31 | 32 | #### Awesome :star::star::star::star::star: 33 | Provide a (link to a) minimal demo app showing the faulty behaviour. 34 | 35 | #### Sweet :star::star::star::star: 36 | Provide some concise code examples or some data you use. 37 | 38 | #### Good :star::star::star: 39 | Provide your own project and instructions how to reproduce the problem. 40 | 41 | #### Meh :star::star: 42 | Provide a code sample with a bunch of magic parameters which we need to interpolate by guessing to reconstruct the actual problem. 43 | 44 | #### Worst :poop: 45 | The source code or the data can't be disclosed and refuse to provide any of the above. Expect this issue to be closed by a bunch of angry aliens :alien::alien::alien::alien::alien: that will hunt you down and :fire: your :computer:. You've been warned. :fire_engine: 46 | 47 | ### How could we have prevented this Bug? 48 | _Remove this hint: Is there anything we could have done to prevent this problem?_ 49 | 50 | ### Definition of Done for the Implementers 51 | _Remove this hint: these checkboxes can be checked like this: [x]_ 52 | - [ ] We got a final feedback from the reporting user (_if applicable_) 53 | - [ ] Unittests have been written (_if applicable_) 54 | - [ ] Integration tests have been written (_if applicable_) 55 | - [ ] Test coverage is the same or even better then before (_if applicable_) 56 | - [ ] Documentation has been written (_if applicable_) 57 | - [ ] Added a note on the new feature to the release notes (_if applicable_) 58 | 59 | 60 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/03-template-for-task.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Task Template 3 | about: Used mainly by the team behind jQAssistant for issues which aren't a feature nor a bug, but must be done and should'nt be forgotten. 4 | title: Please fullfil this task 5 | labels: type:task 6 | assignees: '' 7 | --- 8 | 9 | ### Task Description 10 | 11 | ### Definition of Done for the Implementers 12 | _Remove this hint: these checkboxes can be checked like this: [x]_ 13 | - [ ] We got a final feedback from the reporting user (_if applicable_) 14 | - [ ] Unittests have been written (_if applicable_) 15 | - [ ] Integration tests have been written (_if applicable_) 16 | - [ ] Test coverage is the same or even better then before (_if applicable_) 17 | - [ ] Documentation has been written (_if applicable_) 18 | - [ ] Added a note on the new feature to the release notes (_if applicable_) 19 | 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | 3 | contact_links: 4 | - name: Use Stackoverflow for your question on jQAssistant 5 | url: https://stackoverflow.com/questions/tagged/jqassistant 6 | about: Please use stackoverflow for supporting issues. Using stackoverflow will help us to have all questions in a plublic space and you have the chance to get help from the whole jQAssistant community. 7 | - name: Use our Idea Hub for new Ideas and Suggestions 8 | url: https://github.com/jQAssistant/jQA-Idea-Hub 9 | about: Some features might be not releated to any particular subproject or will affect all of them. To report such issues, please use this project. 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | *.iml 3 | *.ipr 4 | *~ 5 | *.log 6 | .DS_Store 7 | pom.xml.versionsBackup 8 | .java-version 9 | *.backup 10 | 11 | # Files generated by the release tooling of jQAssistant 12 | pom.xml.updatetorelease 13 | pom.xml.updatetonextdevversion 14 | 15 | # Ignore temporary shell scripts used to script small tasks 16 | *.ignore.sh 17 | 18 | # Maven related files and directories 19 | target 20 | /.mvn 21 | -------------------------------------------------------------------------------- /readme.adoc: -------------------------------------------------------------------------------- 1 | = jQAssistant Plugin for Maven 2 | 3 | This is the https://jqassistant.org[jQAssistant^] Plugin for Maven. 4 | It allows to execute jQAssistant during a Maven build. 5 | 6 | For more information on jQAssistant see https://jqassistant.org[^]. 7 | -------------------------------------------------------------------------------- /src/it/analyze/exclude-constraint/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | groups: 4 | - it 5 | exclude-constraints: 6 | - it:ExcludedConstraint 7 | -------------------------------------------------------------------------------- /src/it/analyze/exclude-constraint/jqassistant/it.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A constraint which shall be executed. 10 | 11 | RETURN 1 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | A constraint which shall be excluded. 20 | 21 | RETURN 1 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/it/analyze/exclude-constraint/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.analyze.exlude-constraint 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/it/analyze/exclude-constraint/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def itGroup = jqassistantReport.group.find { it.@id = 'it' } 5 | 6 | assert itGroup.constraint.find { it.@id == 'it:ExcludedConstraint' } == "" 7 | 8 | def constraint = itGroup.constraint.find { it.@id == 'it:Constraint' } 9 | assert constraint.status == 'warning' 10 | assert constraint.severity == 'minor' 11 | 12 | -------------------------------------------------------------------------------- /src/it/cli/project-without-plugin/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install 2 | invoker.goals.2 = com.buschmais.jqassistant:jqassistant-maven-plugin:${project.version}:scan 3 | invoker.goals.3 = com.buschmais.jqassistant:jqassistant-maven-plugin:${project.version}:analyze 4 | -------------------------------------------------------------------------------- /src/it/cli/project-without-plugin/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/it/cli/project-without-plugin/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.cli.project-without-plugin 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.cli.project-without-plugin.module1 9 | -------------------------------------------------------------------------------- /src/it/cli/project-without-plugin/module1/src/main/java/A.java: -------------------------------------------------------------------------------- 1 | public class A { 2 | } -------------------------------------------------------------------------------- /src/it/cli/project-without-plugin/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.cli.project-without-plugin 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.cli.project-without-plugin.module2 9 | -------------------------------------------------------------------------------- /src/it/cli/project-without-plugin/module2/src/main/java/B.java: -------------------------------------------------------------------------------- 1 | public class B { 2 | } -------------------------------------------------------------------------------- /src/it/cli/project-without-plugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.cli.project-without-plugin 6 | @project.version@ 7 | pom 8 | 9 | 10 | 3.10.1 11 | 12 | 13 | 14 | 15 | 16 | 17 | org.apache.maven.plugins 18 | maven-compiler-plugin 19 | ${maven-compiler-plugin.version} 20 | 21 | 22 | 23 | 24 | 25 | 26 | module1 27 | module2 28 | 29 | -------------------------------------------------------------------------------- /src/it/cli/project-without-plugin/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find{ it.@id = 'default' } 5 | assert defaultGroup.concept.find { it.@id == 'java:TypeAssignableFrom' }.status == "success" 6 | -------------------------------------------------------------------------------- /src/it/configuration/effective-configuration/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = jqassistant:effective-configuration -Djqassistant.scan.continue-on-error=true 2 | -------------------------------------------------------------------------------- /src/it/configuration/effective-configuration/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.configuration.embedded 6 | @project.version@ 7 | 8 | 9 | 10 | 11 | @project.groupId@ 12 | @project.artifactId@ 13 | @project.version@ 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/it/configuration/effective-configuration/verify.groovy: -------------------------------------------------------------------------------- 1 | def buildLog = new File(basedir, 'build.log') 2 | assert buildLog.exists() 3 | assert buildLog.getText().contains(""" continue-on-error: true""") 4 | -------------------------------------------------------------------------------- /src/it/configuration/embedded/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | groups: 4 | - plugin-execution-configuration 5 | - project-configuration 6 | -------------------------------------------------------------------------------- /src/it/configuration/embedded/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = verify 2 | -------------------------------------------------------------------------------- /src/it/configuration/embedded/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/it/configuration/embedded/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.configuration.embedded 6 | @project.version@ 7 | 8 | 9 | 10 | 11 | @project.groupId@ 12 | @project.artifactId@ 13 | @project.version@ 14 | 15 | 16 | 17 | scan 18 | analyze 19 | 20 | 21 | 22 | 23 | 24 | jqassistant: 25 | store: 26 | # used 27 | uri: file:target/custom-store 28 | analyze: 29 | # overwritten by .jqassistant.yml 30 | groups: 31 | - plugin-execution-configuration 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/it/configuration/embedded/verify.groovy: -------------------------------------------------------------------------------- 1 | assert !new File(basedir, "target/jqassistant/store").exists() 2 | // config from plugin execution configuration (embedded YAML) 3 | assert new File(basedir, "target/custom-store").exists() 4 | 5 | // config from project configuration (.jqassistant.yml) 6 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 7 | assert reportFile.exists() 8 | def jqassistantReport = new XmlSlurper().parse(reportFile) 9 | assert jqassistantReport.group.size() == 2 10 | -------------------------------------------------------------------------------- /src/it/configuration/external/.jqassistant-custom.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | concepts: 4 | - custom-concept 5 | report: 6 | properties: 7 | # verify interpolation of properties provided by Maven 8 | xml.report.file: ${project.build.directory}/custom-jqassistant-report.xml 9 | -------------------------------------------------------------------------------- /src/it/configuration/external/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | concepts: 4 | - concept 5 | -------------------------------------------------------------------------------- /src/it/configuration/external/.jqassistant/analyze.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | constraints: 4 | - constraint 5 | -------------------------------------------------------------------------------- /src/it/configuration/external/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = verify 2 | invoker.goals.2 = verify -Djqassistant.configuration.locations=.jqassistant-custom.yml 3 | -------------------------------------------------------------------------------- /src/it/configuration/external/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A concept. 5 | 6 | RETURN 1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | A concept. 15 | 16 | RETURN 0 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | A custom concept. 25 | 26 | RETURN 1 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/it/configuration/external/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.configuration.external 6 | @project.version@ 7 | 8 | 9 | 10 | 11 | @project.groupId@ 12 | @project.artifactId@ 13 | @project.version@ 14 | 15 | 16 | 17 | scan 18 | analyze 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/it/configuration/external/verify.groovy: -------------------------------------------------------------------------------- 1 | def buildLog = new File(basedir, 'build.log') 2 | assert buildLog.exists() 3 | 4 | assert buildLog.getText().contains("Applying concept 'concept' with severity: 'MINOR'.") 5 | assert buildLog.getText().contains("Validating constraint 'constraint' with severity: 'MAJOR'.") 6 | assert buildLog.getText().contains("Applying concept 'custom-concept' with severity: 'MINOR'.") 7 | 8 | assert new File(basedir, "target/custom-jqassistant-report.xml").exists() 9 | -------------------------------------------------------------------------------- /src/it/configuration/overrides/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | scan: 3 | include: 4 | files: 5 | - ${project.basedir}/README.md 6 | analyze: 7 | groups: 8 | - it 9 | -------------------------------------------------------------------------------- /src/it/configuration/overrides/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jqassistant-archive/jqa-maven-plugin/bb52bfe62cf1fba467f09aacc0eb2e2f792fdcf8/src/it/configuration/overrides/README.md -------------------------------------------------------------------------------- /src/it/configuration/overrides/jqassistant/it.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | WITH 10 | [ "README.md", "README-module.md"] as expectedFileNames 11 | UNWIND 12 | expectedFileNames as expectedFileName 13 | MATCH 14 | (m:Maven:Project)-[:CONTAINS]->(file:File) 15 | WHERE 16 | file.fileName ends with expectedFileName 17 | RETURN 18 | count(file) 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/it/configuration/overrides/module/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | scan: 3 | include: 4 | files: 5 | - ${project.basedir}/README-module.md 6 | -------------------------------------------------------------------------------- /src/it/configuration/overrides/module/README-module.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jqassistant-archive/jqa-maven-plugin/bb52bfe62cf1fba467f09aacc0eb2e2f792fdcf8/src/it/configuration/overrides/module/README-module.md -------------------------------------------------------------------------------- /src/it/configuration/overrides/module/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | @project.groupId@ 7 | @project.artifactId@.integration.configuration.overrides 8 | @project.version@ 9 | 10 | 11 | @project.artifactId@.integration.configuration.overrides.module 12 | pom 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/it/configuration/overrides/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | @project.groupId@ 6 | @project.artifactId@.integration.configuration.overrides 7 | @project.version@ 8 | pom 9 | 10 | 11 | 12 | 13 | @project.groupId@ 14 | @project.artifactId@ 15 | @project.version@ 16 | 17 | 18 | effective-configuration 19 | 20 | effective-configuration 21 | 22 | 23 | 24 | default-cli 25 | 26 | scan 27 | analyze 28 | 29 | 30 | 31 | 32 | 33 | jqassistant: 34 | analyze: 35 | groups: 36 | - undefined 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | module 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/it/configuration/overrides/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def itGroup = jqassistantReport.group.find { it.@id = 'it' } 5 | assert itGroup.concept.find { it.@id == 'it:ExpectedFiles' }.status == "success" 6 | 7 | -------------------------------------------------------------------------------- /src/it/configuration/profile/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | "%test-store": 2 | jqassistant: 3 | store: 4 | uri: "file://${project.build.directory}/test-store" 5 | -------------------------------------------------------------------------------- /src/it/configuration/profile/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = jqassistant:scan -Ptest-store -e 2 | -------------------------------------------------------------------------------- /src/it/configuration/profile/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.configuration.embedded 6 | @project.version@ 7 | 8 | 9 | 10 | 11 | @project.groupId@ 12 | @project.artifactId@ 13 | @project.version@ 14 | 15 | 16 | 17 | 18 | 19 | 20 | test-store 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/it/configuration/profile/verify.groovy: -------------------------------------------------------------------------------- 1 | assert new File(basedir, "target/test-store").exists() 2 | -------------------------------------------------------------------------------- /src/it/configuration/store/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -Pstore1 2 | invoker.goals.2 = install -Pstore2 3 | invoker.goals.3 = install -Djqassistant.store.uri=file:target/store3 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/it/configuration/store/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.configuration.store 10 | 11 | 12 | 13 | store1 14 | 15 | file:target/store1 16 | 17 | 18 | 19 | store2 20 | 21 | 22 | 23 | @project.groupId@ 24 | @project.artifactId@ 25 | @project.version@ 26 | 27 | 28 | jqassistant: 29 | store: 30 | uri: file:target/store2 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/it/configuration/store/verify.groovy: -------------------------------------------------------------------------------- 1 | assert !new File(basedir, 'target/jqassistant/store').exists() 2 | assert new File(basedir, 'target/store1').exists() 3 | assert new File(basedir, 'target/store2').exists() 4 | assert new File(basedir, 'target/store3').exists() 5 | -------------------------------------------------------------------------------- /src/it/list-plugins/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = ${project.groupId}:${project.artifactId}:${project.version}:list-plugins 2 | invoker.goals.2 = -q ${project.groupId}:${project.artifactId}:${project.version}:list-plugins 3 | -------------------------------------------------------------------------------- /src/it/list-plugins/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration 5 | @project.version@ 6 | pom 7 | 8 | 9 | 10 | 11 | 12 | @project.groupId@ 13 | @project.artifactId@ 14 | @project.version@ 15 | 16 | 17 | 18 | list-plugins 19 | analyze 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/it/list-plugins/verify.groovy: -------------------------------------------------------------------------------- 1 | def buildLog = new File(basedir, 'build.log') 2 | assert buildLog.exists() 3 | 4 | def text = buildLog.getText(); 5 | 6 | verify(text, "jQAssistant Common Plugin", "jqa.plugin.common") 7 | verify(text, "jQAssistant Core Analysis Plugin", "jqa.core.analysis.plugin") 8 | verify(text, "jQAssistant Core Report Plugin", "jqa.core.report.plugin") 9 | verify(text, "jQAssistant Java Plugin", "jqa.plugin.java") 10 | verify(text, "jQAssistant JSON Plugin", "jqa.plugin.json") 11 | verify(text, "jQAssistant JUnit Plugin", "jqa.plugin.junit") 12 | verify(text, "jQAssistant Maven 3 Plugin", "jqa.plugin.maven3") 13 | verify(text, "jQAssistant XML Plugin", "jqa.plugin.xml") 14 | verify(text, "jQAssistant YAML 2 Plugin", "jqa.plugin.yaml2") 15 | 16 | def verify(text, expectedName, expectedId) { 17 | assert text.contains(expectedName); 18 | assert text.contains("[" + expectedId + "]"); 19 | } 20 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/singlestore/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install \ 2 | -Djqassistant.store.directory=${project.build.directory}/it/multimodule/multiparent/singlestore/target/jqassistant/store \ 3 | -Djqassistant.store.reset=false \ 4 | -T2 \ 5 | -e 6 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/singlestore/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/singlestore/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration.multimodule.multiparent.singlestore.module1 5 | @project.version@ 6 | 7 | 8 | 9 | 10 | @project.groupId@ 11 | @project.artifactId@ 12 | @project.version@ 13 | 14 | 15 | scan 16 | 17 | scan 18 | 19 | 20 | 21 | analyze 22 | 23 | analyze 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | @project.groupId@ 35 | @project.artifactId@ 36 | @project.version@ 37 | 38 | 39 | 40 | report 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/singlestore/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration.multimodule.multiparent.singlestore.module2 5 | @project.version@ 6 | 7 | 8 | 9 | 10 | @project.groupId@ 11 | @project.artifactId@ 12 | @project.version@ 13 | 14 | 15 | scan 16 | 17 | scan 18 | 19 | 20 | 21 | analyze 22 | 23 | analyze 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | @project.groupId@ 35 | @project.artifactId@ 36 | @project.version@ 37 | 38 | 39 | 40 | report 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/singlestore/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration.multimodule.multiparent.singlestore 5 | @project.version@ 6 | pom 7 | 8 | 9 | module1 10 | module2 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/singlestore/verify.groovy: -------------------------------------------------------------------------------- 1 | assert new File(basedir, 'target/jqassistant').exists() 2 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/site/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -Djqassistant.maven.use-execution-root-as-project-root=false -T2 -e 2 | invoker.goals.2 = site -T2 -e 3 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/site/module1/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/site/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration.multimodule.multiparent.site.module1 5 | @project.version@ 6 | 7 | 8 | 9 | 10 | 11 | org.apache.maven.plugins 12 | maven-site-plugin 13 | 3.7.1 14 | 15 | 16 | 17 | 18 | 19 | @project.groupId@ 20 | @project.artifactId@ 21 | @project.version@ 22 | 23 | 24 | scan 25 | 26 | scan 27 | analyze 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | org.apache.maven.plugins 39 | maven-project-info-reports-plugin 40 | 3.0.0 41 | 42 | 43 | @project.groupId@ 44 | @project.artifactId@ 45 | @project.version@ 46 | 47 | 48 | 49 | report 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/site/module2/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/site/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration.multimodule.multiparent.site.module2 5 | @project.version@ 6 | 7 | 8 | 9 | 10 | 11 | org.apache.maven.plugins 12 | maven-site-plugin 13 | 3.7.1 14 | 15 | 16 | 17 | 18 | 19 | @project.groupId@ 20 | @project.artifactId@ 21 | @project.version@ 22 | 23 | 24 | scan 25 | 26 | scan 27 | analyze 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | org.apache.maven.plugins 39 | maven-project-info-reports-plugin 40 | 3.0.0 41 | 42 | 43 | @project.groupId@ 44 | @project.artifactId@ 45 | @project.version@ 46 | 47 | 48 | 49 | report 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/site/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration.multimodule.multiparent.site 5 | @project.version@ 6 | pom 7 | 8 | 9 | module1 10 | module2 11 | 12 | 13 | 14 | 15 | 16 | 17 | org.apache.maven.plugins 18 | maven-site-plugin 19 | 3.7.1 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | org.apache.maven.plugins 29 | maven-project-info-reports-plugin 30 | 3.0.0 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/it/multimodule/multiparent/site/verify.groovy: -------------------------------------------------------------------------------- 1 | assert new File(basedir, 'module1/target/jqassistant/jqassistant-report.xml').exists() 2 | assert new File(basedir, 'module2/target/jqassistant/jqassistant-report.xml').exists() 3 | assert new File(basedir, 'module1/target/site/jqassistant.html').exists() 4 | assert new File(basedir, 'module2/target/site/jqassistant.html').exists() -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | maven: 3 | module: 4 | skip: ${jqa.skip:false} 5 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install 2 | invoker.buildResult.1 = failure 3 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | A constraint that always fails. 9 | 10 | RETURN 1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule.module1 9 | 10 | 11 | true 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule.module2 9 | 10 | 11 | true 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/module3/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule.module3 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/module4/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule.module4 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.singleparent.analyze-lastmodule 10 | pom 11 | 12 | 13 | module1 14 | module2 15 | module3 16 | module4 17 | 18 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/analyze-lastmodule/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'build.log') 2 | boolean foundModule1Violation = false 3 | boolean foundModule2Violation = false 4 | boolean foundModule3Violation = false 5 | boolean foundModule4Violation = false 6 | reportFile.eachLine { 7 | if (!foundModule1Violation) { 8 | foundModule1Violation = isViolationLogLineForModule('module1', it) 9 | } 10 | if (!foundModule2Violation) { 11 | foundModule2Violation = isViolationLogLineForModule('module2', it) 12 | } 13 | if (!foundModule3Violation) { 14 | foundModule3Violation = isViolationLogLineForModule('module3', it) 15 | } 16 | if (!foundModule4Violation) { 17 | foundModule4Violation = isViolationLogLineForModule('module4', it) 18 | } 19 | } 20 | assert !foundModule1Violation // Skipped - should not analyze yet 21 | assert !foundModule2Violation // Skipped - should not analyze yet 22 | assert !foundModule3Violation // Not the last module - should not analyze yet 23 | assert foundModule4Violation // Should finally analyze and find the violation 24 | 25 | static boolean isViolationLogLineForModule(String moduleName, String line) { 26 | line ==~ /^\[ERROR\] Failed to execute goal com.buschmais.jqassistant:jqassistant-maven-plugin:.* on project jqassistant-maven-plugin.integration.multimodule.singleparent.analyze-lastmodule.$moduleName: Failed rules detected:.*$/ 27 | } 28 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/artifact-dependencies/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = install 2 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/artifact-dependencies/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Defines the expected artifact dependencies 9 | 10 | (module1:Main:Artifact), 13 | (:Maven:Project)-[:CREATES]->(module2:Main:Artifact), 14 | (:Maven:Project)-[:CREATES]->(module3:Main:Artifact) 15 | WHERE 16 | module1.name ends with "module1" 17 | and module2.name ends with "module2" 18 | and module3.name ends with "module3" 19 | MERGE 20 | (module2)-[:DEFINES_DEPENDENCY]->(module1) 21 | MERGE 22 | (module3)-[:DEFINES_DEPENDENCY]->(module1) 23 | MERGE 24 | (module3)-[:DEFINES_DEPENDENCY]->(module2) 25 | RETURN 26 | * 27 | ]]> 28 | 29 | 30 | 31 | 32 | Verifies unexpected artifact dependencies 33 | 34 | (module1:Main:Artifact), 37 | (:Maven:Project)-[:CREATES]->(module2:Main:Artifact), 38 | (module1)-[:DEPENDS_ON]->(module2) 39 | WHERE 40 | not (module1)-[:DEFINES_DEPENDENCY]->(module2) 41 | RETURN 42 | module1 as Artifact, module2 as UndefinedDependency 43 | ]]> 44 | 45 | 46 | 47 | Verifies unexpected artifact dependencies 48 | 49 | (module1:Main:Artifact), 52 | (:Maven:Project)-[:CREATES]->(module2:Main:Artifact), 53 | (module1)-[d:DEPENDS_ON]->(module2) 54 | WITH 55 | module1, module2, count(d) as dependencies 56 | WHERE 57 | dependencies > 1 58 | RETURN 59 | module1, module2, dependencies 60 | ]]> 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/artifact-dependencies/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies.module1 9 | 10 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/artifact-dependencies/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies.module2 9 | 10 | 11 | 12 | @project.groupId@ 13 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies.module1 14 | @project.version@ 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/artifact-dependencies/module3/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies.module3 9 | 10 | 11 | 12 | @project.groupId@ 13 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies.module1 14 | @project.version@ 15 | 16 | 17 | @project.groupId@ 18 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies.module2 19 | @project.version@ 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/artifact-dependencies/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.singleparent.artifact-dependencies 10 | pom 11 | 12 | 13 | module1 14 | module2 15 | module3 16 | 17 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/artifact-dependencies/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find { it.@id = 'default' } 5 | assert defaultGroup.constraint.find { it.@id == 'test:UndefinedDependency' }.status == "success" 6 | assert defaultGroup.constraint.find { it.@id == 'test:RedundantDependency' }.status == "success" 7 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/attach-report-archive/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | report: 4 | create-archive: true 5 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/attach-report-archive/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = install 2 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/attach-report-archive/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | A constraint that never fails. 9 | 10 | RETURN 0 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/attach-report-archive/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.attach-report-archive 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.attach-report-archive.module1 9 | 10 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/attach-report-archive/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.attach-report-archive 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.attach-report-archive.module2 9 | 10 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/attach-report-archive/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.singleparent.attach-report-archive 10 | pom 11 | 12 | 13 | 14 | 15 | org.apache.maven.plugins 16 | maven-install-plugin 17 | 2.5.2 18 | 19 | 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | module1 28 | module2 29 | 30 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/attach-report-archive/verify.groovy: -------------------------------------------------------------------------------- 1 | assert new File(basedir, "target/jqassistant/jqassistant-report.zip").exists() 2 | def buildLog = new File(basedir, 'build.log') 3 | def foundInstallingReport = false 4 | buildLog.eachLine { 5 | foundInstallingReport = foundInstallingReport || verifyInstallingReport(it) 6 | } 7 | assert foundInstallingReport 8 | 9 | static boolean verifyInstallingReport(String line) { 10 | line ==~ /^\[INFO] Installing .*-jqassistant-report.zip$/ 11 | } 12 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/cliwithoutplugin/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.cliwithoutplugin 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.cliwithoutplugin.module1 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | rule: 4 | directory: build-config/jqa-rules 5 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/build-config/jqa-rules/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = install 2 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.customruledir 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.customruledir.module1 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/module1/src/main/java/A.java: -------------------------------------------------------------------------------- 1 | public class A { 2 | } -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.customruledir 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.customruledir.module2 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/module2/src/main/java/B.java: -------------------------------------------------------------------------------- 1 | public class B { 2 | } -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.singleparent.customruledir 10 | pom 11 | 12 | 13 | module1 14 | module2 15 | 16 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/customruledir/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find { it.@id = 'default' } 5 | assert defaultGroup != null 6 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency-tree/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | scan: 3 | properties: 4 | maven3.dependencies.scan: true 5 | maven3.dependencies.includes: org.springframework*:*:*:* 6 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency-tree/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Returns all Spring components using meta-annotations. 9 | 10 | (component:Type), 13 | (component)-[:ANNOTATED_BY|OF_TYPE*]->(:Type{fqn:"org.springframework.stereotype.Component"}) 14 | RETURN 15 | component 16 | ]]> 17 | 18 | 19 | 20 | Returns the Dependency Tree filtered by Spring artifacts. 21 | 22 | (artifact:Artifact), 25 | shortestPath((artifact)-[:DEPENDS_ON*]->(dependency:Jar:Artifact)) // verify the dependency is actually scanned and visible as Jar 26 | WHERE 27 | dependency.name = "spring-core" // indirect dependency 28 | RETURN 29 | artifact.fqn, collect(dependency.fqn) 30 | ]]> 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency-tree/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.dependency-tree 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.dependency-tree.module1 9 | 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-web 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency-tree/module1/src/main/java/com/buschmais/jqassistant/maven/it/dependency_tree/module1/service/Service1.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.it.dependency_tree.module1.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class Service1 { 7 | } 8 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency-tree/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.dependency-tree 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.dependency-tree.module2 9 | 10 | 11 | 12 | @project.groupId@ 13 | @project.artifactId@.integration.multimodule.singleparent.dependency-tree.module1 14 | @project.version@ 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-web 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency-tree/module2/src/main/java/com/buschmais/jqassistant/maven/it/dependency_tree/module2/service/Service2.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.it.dependency_tree.module2.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class Service2 { 7 | } 8 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency-tree/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.singleparent.dependency-tree 10 | pom 11 | 12 | 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-web 17 | 2.2.2.RELEASE 18 | 19 | 20 | org.springframework 21 | spring-core 22 | 5.2.2.RELEASE 23 | 24 | 25 | 26 | 27 | 28 | module1 29 | module2 30 | 31 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency-tree/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find { it.@id = 'default' } 5 | assert defaultGroup.concept.find { it.@id == 'test:SpringComponentByMetaAnnotation' }.status == "success" 6 | assert defaultGroup.concept.find { it.@id == 'test:MavenArtifactDependsOnSpringArtifacts' }.status == "success" 7 | 8 | def buildLog = new File(basedir, 'build.log') 9 | assert buildLog.exists() 10 | def log = buildLog.getText(); 11 | assert log.findAll(".*Entering .*/springframework/spring-core/").size() == 1 12 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Verifies that there's a direct dependency between main artifacts of different modules. 9 | (a1:Main:Artifact), 12 | (module2:Maven:Project)-[:CREATES]->(a2:Main:Artifact), 13 | (a1)-[:DEPENDS_ON]->(a2) 14 | RETURN 15 | count(*) as count 16 | ]]> 17 | 18 | 19 | 20 | 21 | 22 | 23 | Verifies that there's a direct dependency between test artifacts of different modules. 24 | (a1:Test:Artifact), 27 | (module2:Maven:Project)-[:CREATES]->(a2:Test:Artifact), 28 | (a1)-[:DEPENDS_ON]->(a2) 29 | RETURN 30 | count(*) as count 31 | ]]> 32 | 33 | 34 | 35 | 36 | 37 | 38 | Verifies that there's a direct dependency between classes in two different modules. 39 | 40 | (:Artifact)-[:CONTAINS]->(a:Type{name:"A"}), 43 | (module2:Maven:Project)-[:CREATES]->(:Artifact)-[:CONTAINS]->(b:Type{name:"B"}), 44 | (b)-[:DEPENDS_ON]->(a) 45 | RETURN 46 | count(*) as count 47 | ]]> 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.dependency 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.dependency.module1 9 | 10 | 11 | 12 | 13 | org.apache.maven.plugins 14 | maven-jar-plugin 15 | 16 | 17 | 18 | test-jar 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/module1/src/main/java/com/buschmais/jqassistant/maven/module1/A.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.module1; 2 | 3 | /** 4 | * Created by dmahler on 3/6/17. 5 | */ 6 | public class A { 7 | } 8 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/module1/src/test/java/com/buschmais/jqassistant/maven/module1/ATest.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.module1; 2 | 3 | public class ATest { 4 | } 5 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.dependency 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.dependency.module2 9 | 10 | 11 | 12 | @project.groupId@ 13 | @project.artifactId@.integration.multimodule.singleparent.dependency.module1 14 | @project.version@ 15 | 16 | 17 | @project.groupId@ 18 | @project.artifactId@.integration.multimodule.singleparent.dependency.module1 19 | @project.version@ 20 | test-jar 21 | test 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/module2/src/main/java/com/buschmais/jqassistant/maven/module2/B.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven; 2 | 3 | import com.buschmais.jqassistant.maven.module1.A; 4 | 5 | /** 6 | * Created by dmahler on 3/6/17. 7 | */ 8 | public class B { 9 | 10 | private A a; 11 | 12 | public B(A a) { 13 | this.a = a; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/module2/src/test/java/com/buschmais/jqassistant/maven/module2/BTest.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.module2; 2 | 3 | import com.buschmais.jqassistant.maven.module1.ATest; 4 | 5 | public class BTest { 6 | 7 | private ATest aTest; 8 | 9 | public BTest(ATest aTest) { 10 | this.aTest = aTest; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.singleparent.dependency 10 | pom 11 | 12 | 13 | module1 14 | module2 15 | 16 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/dependency/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find { it.@id = 'default' } 5 | 6 | verifyCount(defaultGroup, 'test:MainArtifactDependency') 7 | verifyCount(defaultGroup, 'test:TestArtifactDependency') 8 | verifyCount(defaultGroup, 'test:TypeDependency') 9 | 10 | private void verifyCount(defaultGroup, String conceptId) { 11 | def row = defaultGroup.concept.find { it.@id == conceptId }.result.rows.row[0] 12 | assert row.column.find { it.@name == 'count' }.value == 1 13 | } 14 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = install -e 2 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/jqassistant/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Returns all Spring components using meta-annotations. 9 | 10 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/module-a/api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-a 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-a.api 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/module-a/impl/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-a 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-a.impl 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/module-a/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-a 10 | pom 11 | 12 | 13 | api 14 | impl 15 | 16 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/module-b/api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-b 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-b.api 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/module-b/impl/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-b 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-b.impl 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/module-b/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-b 10 | pom 11 | 12 | 13 | api 14 | impl 15 | 16 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/module-c/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.version@ 5 | @project.artifactId@.integration.multimodule.execrootasprojectroot.module-c 6 | pom 7 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.execrootasprojectroot.reactor 10 | pom 11 | 12 | 13 | module-a 14 | module-b 15 | module-c 16 | 17 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/execrootasprojectroot/verify.groovy: -------------------------------------------------------------------------------- 1 | assert new File(basedir, 'target/jqassistant').exists() 2 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 3 | assert reportFile.exists() 4 | def jqassistantReport = new XmlSlurper().parse(reportFile) 5 | def defaultGroup = jqassistantReport.group.find{ it.@id = 'default' } 6 | assert defaultGroup.concept.find { it.@id == 'MavenProject' }.result.rows.@count == 9 7 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -Djqassistant.maven.use-execution-root-as-project-root=false 2 | invoker.goals.2 = site 3 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.parentasmodule.parent 6 | @project.version@ 7 | ../parent/pom.xml 8 | 9 | @project.artifactId@.integration.parentasmodule.parent.module1 10 | module1 11 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/module1/src/main/java/module1/App.java: -------------------------------------------------------------------------------- 1 | package module1; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.parentasmodule.parent 6 | @project.version@ 7 | ../parent/pom.xml 8 | 9 | @project.artifactId@.integration.parentasmodule.parent.module2 10 | module2 11 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/module2/src/main/java/module2/App.java: -------------------------------------------------------------------------------- 1 | package module2; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/parent/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Check that classes with specific names exist. 6 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/parent/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration.parentasmodule.parent 5 | @project.version@ 6 | pom 7 | parent 8 | 9 | 10 | UTF-8 11 | 3.10.1 12 | 3.7.1 13 | 14 | 15 | 16 | 17 | 18 | 19 | org.apache.maven.plugins 20 | maven-compiler-plugin 21 | ${maven-compiler-plugin.version} 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-site-plugin 26 | ${maven-site-plugin.version} 27 | 28 | 29 | 30 | 31 | 32 | com.buschmais.jqassistant 33 | jqassistant-maven-plugin 34 | @project.version@ 35 | 36 | 37 | 38 | scan 39 | analyze 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-project-info-reports-plugin 52 | 3.0.0 53 | 54 | 55 | @project.groupId@ 56 | @project.artifactId@ 57 | @project.version@ 58 | 59 | 60 | 61 | report 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.parentasmodule.parent 6 | @project.version@ 7 | parent/pom.xml 8 | 9 | parentasmodule 10 | pom 11 | parentasmodule 12 | 13 | parent 14 | module1 15 | module2 16 | 17 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/parentasmodule/verify.groovy: -------------------------------------------------------------------------------- 1 | assert new File(basedir, 'parent/target/jqassistant').exists() 2 | def reportFile = new File(basedir, 'parent/target/jqassistant/jqassistant-report.xml') 3 | assert reportFile.exists() 4 | def jqassistantReport = new XmlSlurper().parse(reportFile) 5 | def defaultGroup = jqassistantReport.group.find{ it.@id = 'default' } 6 | assert defaultGroup.concept.find { it.@id == 'integrationtest:TestClassName' }.result.rows.@count == 2 7 | def htmlReportFile = new File(basedir, 'parent/target/site/jqassistant.html') 8 | assert htmlReportFile.exists() 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Verifies expected artifact dependencies. 11 | (a1:Artifact), 14 | (:Maven:Project)-[:CREATES]->(a2:Artifact), 15 | (a1)-[:DEPENDS_ON]->(a2) 16 | RETURN 17 | count(*) as count 18 | ]]> 19 | 20 | 21 | 22 | 23 | 24 | 25 | Verifies expected artifact dependencies. 26 | (a1:Artifact), 56 | (:Maven:Project)-[:CREATES]->(a2:Artifact), 57 | (a1)-[:DEPENDS_ON]->(a2) 58 | WHERE 59 | a1.name ends with expectedDependency.from.name and a1.type=expectedDependency.from.type 60 | and a2.name ends with to.name and a2.type=to.type 61 | RETURN 62 | count(*) as count 63 | ]]> 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/main-and-test/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | @project.groupId@ 6 | @project.artifactId@.integration.project-artifacts 7 | @project.version@ 8 | 9 | @project.artifactId@.integration.project-artifacts.main-and-test 10 | 11 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/main-and-test/src/main/java/com/buschmais/jqassistant/maven/main_and_test/B.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.main_and_test; 2 | 3 | /** 4 | * Created by dmahler on 3/6/17. 5 | */ 6 | public class B { 7 | } 8 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/main-and-test/src/test/java/com/buschmais/jqassistant/maven/main_and_test/BTest.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.main_and_test; 2 | 3 | import com.buschmais.jqassistant.maven.main_and_test.B; 4 | 5 | /** 6 | * Created by dmahler on 3/6/17. 7 | */ 8 | public class BTest { 9 | 10 | private B b; 11 | 12 | public BTest(B b) { 13 | this.b = b; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/main-only/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | @project.groupId@ 6 | @project.artifactId@.integration.project-artifacts 7 | @project.version@ 8 | 9 | @project.artifactId@.integration.project-artifacts.main-only 10 | 11 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/main-only/src/main/java/com/buschmais/jqassistant/maven/main_only/A.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.main_only; 2 | 3 | /** 4 | * Created by dmahler on 3/6/17. 5 | */ 6 | public class A { 7 | } 8 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.project-artifacts 10 | pom 11 | 12 | 13 | main-only 14 | test-only 15 | main-and-test 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/test-only/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | @project.groupId@ 6 | @project.artifactId@.integration.project-artifacts 7 | @project.version@ 8 | 9 | @project.artifactId@.integration.project-artifacts.test-only 10 | 11 | 12 | 13 | @project.groupId@ 14 | @project.artifactId@.integration.project-artifacts.main-only 15 | @project.version@ 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/project-artifacts/test-only/src/test/java/com/buschmais/jqassistant/maven/test_only/ATest.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.test_only; 2 | 3 | import com.buschmais.jqassistant.maven.main_only.A; 4 | 5 | /** 6 | * Created by dmahler on 3/6/17. 7 | */ 8 | public class ATest { 9 | 10 | private A a; 11 | 12 | public ATest(A a) { 13 | this.a = a; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/scan-reset/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = jqassistant:scan -Pmodule1 2 | invoker.goals.2 = jqassistant:scan -Pmodule2 3 | invoker.goals.3 = jqassistant:scan jqassistant:analyze -Pmodule3 -Djqassistant.scan.reset=false 4 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/scan-reset/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Verifies that modules 2 and 3 are available in the database after scanning 9 | 10 | (:Artifact{type:"jar"}) 13 | WHERE 14 | module.artifactId in ["module2", "module3"] 15 | RETURN 16 | count(module) as modules 17 | ]]> 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/scan-reset/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@.integration 5 | parent 6 | @project.version@ 7 | 8 | module1 9 | 10 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/scan-reset/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@.integration 5 | parent 6 | @project.version@ 7 | 8 | module2 9 | 10 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/scan-reset/module3/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@.integration 5 | parent 6 | @project.version@ 7 | 8 | module3 9 | 10 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/scan-reset/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.groupId@.integration 10 | parent 11 | pom 12 | 13 | 14 | 15 | module1 16 | 17 | module1 18 | 19 | 20 | 21 | module2 22 | 23 | module2 24 | 25 | 26 | 27 | module3 28 | 29 | module3 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/scan-reset/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find { it.@id = 'default' } 5 | assert defaultGroup.constraint.find { it.@id == 'it:VerifyModules' }.status == "success" 6 | 7 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/site/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install 2 | invoker.goals.2 = site -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/site/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/site/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.site 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.site.module1 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/site/module1/src/main/java/A.java: -------------------------------------------------------------------------------- 1 | public class A { 2 | } -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/site/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.site 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.site.module2 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/site/module2/src/main/java/B.java: -------------------------------------------------------------------------------- 1 | public class B { 2 | } -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/site/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.singleparent.site 10 | pom 11 | 12 | 13 | module1 14 | module2 15 | 16 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/site/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find{ it.@id = 'default' } 5 | assert defaultGroup.concept.find { it.@id == 'java:TypeAssignableFrom' }.status == "success" 6 | assert new File(basedir, 'target/site/jqassistant.html').exists() 7 | assert !new File(basedir, 'module1/target/site/jqassistant.html').exists() 8 | assert !new File(basedir, 'module2/target/site/jqassistant.html').exists() 9 | 10 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/skip/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | maven: 3 | module: 4 | skip: ${jqa.module.skip:false} 5 | analyze: 6 | groups: 7 | - it 8 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/skip/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = install 2 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/skip/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Return all Maven projects, including parents and modules. 9 | 10 | MATCH 11 | (project:Maven:Project:Directory:File) 12 | RETURN 13 | count(project) 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Return all Maven projects that have been scanned, i.e. that contain an effective model. 22 | 23 | MATCH 24 | (project:Maven:Project:Directory:File)-[:HAS_EFFECTIVE_MODEL]->(:Maven:Pom) 25 | WHERE NOT 26 | project.name in [ 27 | "jqassistant-maven-plugin.integration.multimodule.singleparent.skip", 28 | "jqassistant-maven-plugin.integration.multimodule.singleparent.skip.module1" 29 | ] 30 | RETURN 31 | project 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/skip/module1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.skip 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.skip.module1 9 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/skip/module2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.multimodule.singleparent.skip 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.multimodule.singleparent.skip.module2 9 | 10 | 11 | true 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/skip/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../../pom.xml 8 | 9 | @project.artifactId@.integration.multimodule.singleparent.skip 10 | pom 11 | 12 | 13 | module1 14 | module2 15 | 16 | -------------------------------------------------------------------------------- /src/it/multimodule/singleparent/skip/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def report = new XmlSlurper().parse(reportFile) 4 | assert report.group.constraint.find { it.@id == "it:MavenModules" } != null 5 | assert report.group.constraint.find { it.@id == "it:MavenModulesWithModel" } != null 6 | -------------------------------------------------------------------------------- /src/it/neo4j-plugin/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | store: 3 | embedded: 4 | neo4j-plugins: 5 | - group-id: org.neo4j.procedure 6 | artifact-id: apoc-core 7 | classifier: core 8 | version: ${apoc.version} 9 | analyze: 10 | groups: 11 | - it 12 | -------------------------------------------------------------------------------- /src/it/neo4j-plugin/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = verify -e 2 | invoker.goals.2 = verify -e -Djqassistant.store.embedded.neo4j-plugin-directory=target/jqassistant/plugins 3 | -------------------------------------------------------------------------------- /src/it/neo4j-plugin/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Calls APOC Help 9 | 10 | call apoc.help('apoc') 11 | 12 | 13 | 14 | 15 | Calls APOC Metadata (restricted procedure, requires according setting for embedded server) 16 | 17 | call apoc.meta.data() 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/it/neo4j-plugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../pom.xml 8 | 9 | @project.artifactId@.integration.neo4j-plugin 10 | 11 | 12 | @neo4j_5x_apoc.version@ 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/it/neo4j-plugin/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile1 = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile1.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile1) 4 | def itGroup = jqassistantReport.group.find { it.@id = 'it' } 5 | def concept = itGroup.concept.find { it.@id == 'it:APOCHelp' } 6 | assert concept.status == 'success' 7 | 8 | def pluginDir = new File(basedir, 'target/jqassistant/plugins') 9 | assert pluginDir.exists(); 10 | assert pluginDir.isDirectory(); 11 | -------------------------------------------------------------------------------- /src/it/plugin/customplugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.plugin 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.plugin.customplugin 9 | 10 | 11 | 12 | com.buschmais.jqassistant.plugin 13 | common 14 | @it.jqa.plugin-common.version@ 15 | provided 16 | 17 | 18 | com.buschmais.jqassistant.plugin 19 | java 20 | @it.jqa.java-plugin.version@ 21 | provided 22 | 23 | 24 | com.buschmais.jqassistant.core 25 | scanner 26 | @it.jqa.core.version@ 27 | provided 28 | 29 | 30 | com.buschmais.jqassistant.core 31 | report 32 | @it.jqa.core.version@ 33 | provided 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/it/plugin/customplugin/src/main/java/com/buschmais/jqassistant/scm/maven/integration/plugin/CustomDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.integration.plugin; 2 | 3 | import com.buschmais.jqassistant.plugin.java.api.model.ClassFileDescriptor; 4 | import com.buschmais.xo.neo4j.api.annotation.Label; 5 | 6 | @Label("Custom") 7 | public interface CustomDescriptor extends ClassFileDescriptor { 8 | 9 | String getValue(); 10 | 11 | void setValue(String value); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/it/plugin/customplugin/src/main/java/com/buschmais/jqassistant/scm/maven/integration/plugin/CustomReportPlugin.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.integration.plugin; 2 | 3 | import java.io.FileWriter; 4 | import java.io.IOException; 5 | import java.io.PrintWriter; 6 | import java.util.Map; 7 | import java.util.Properties; 8 | 9 | import com.buschmais.jqassistant.core.report.api.ReportContext; 10 | import com.buschmais.jqassistant.core.report.api.ReportException; 11 | import com.buschmais.jqassistant.core.report.api.ReportPlugin; 12 | import com.buschmais.jqassistant.core.report.api.model.Result; 13 | import com.buschmais.jqassistant.core.rule.api.model.ExecutableRule; 14 | 15 | public class CustomReportPlugin implements ReportPlugin { 16 | private static final String PROPERTY_FILENAME = "customReport.fileName"; 17 | 18 | private String fileName; 19 | 20 | @Override 21 | public void configure(ReportContext reportContext, Map properties) throws ReportException { 22 | this.fileName = (String) properties.get(PROPERTY_FILENAME); 23 | if (this.fileName == null) { 24 | throw new ReportException("Property " + PROPERTY_FILENAME + " is not specified."); 25 | } 26 | } 27 | 28 | @Override 29 | public void setResult(Result result) throws ReportException { 30 | Properties properties = result.getRule().getReport().getProperties(); 31 | String suffix = properties.getProperty("suffix"); 32 | try { 33 | PrintWriter writer = new PrintWriter(new FileWriter(suffix != null ? fileName + "." + suffix : fileName, true)); 34 | writer.print(result.getRule().getId()); 35 | writer.print(":"); 36 | writer.print(result.getStatus().name()); 37 | writer.println(); 38 | writer.close(); 39 | } catch (IOException e) { 40 | throw new ReportException("Cannot write custom report.", e); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/it/plugin/customplugin/src/main/java/com/buschmais/jqassistant/scm/maven/integration/plugin/CustomScannerPlugin.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.integration.plugin; 2 | 3 | import java.io.IOException; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import com.buschmais.jqassistant.core.scanner.api.Scanner; 9 | import com.buschmais.jqassistant.core.scanner.api.ScannerPlugin.Requires; 10 | import com.buschmais.jqassistant.core.scanner.api.Scope; 11 | import com.buschmais.jqassistant.plugin.common.api.scanner.filesystem.FileResource; 12 | import com.buschmais.jqassistant.plugin.common.api.scanner.AbstractScannerPlugin; 13 | import com.buschmais.jqassistant.plugin.java.api.model.ClassFileDescriptor; 14 | import com.buschmais.jqassistant.plugin.java.impl.scanner.ClassFileScannerPlugin; 15 | 16 | @Requires(ClassFileDescriptor.class) 17 | public class CustomScannerPlugin extends AbstractScannerPlugin { 18 | 19 | private static final String PROPERTY_VALUE = "custom.scan.value"; 20 | 21 | private static final Logger LOGGER = LoggerFactory.getLogger(CustomScannerPlugin.class); 22 | 23 | @Override 24 | public boolean accepts(FileResource item, String path, Scope scope) throws IOException { 25 | return path.endsWith(".class"); 26 | } 27 | 28 | @Override 29 | public CustomDescriptor scan(FileResource item, String path, Scope scope, Scanner scanner) throws IOException { 30 | ClassFileDescriptor descriptor = scanner.getContext().peek(ClassFileDescriptor.class); 31 | String value = (String) getProperties().get(PROPERTY_VALUE); 32 | LOGGER.info("Using custom plugin to scan " + path + ", setting value to " + value); 33 | CustomDescriptor customDescriptor = scanner.getContext().getStore().addDescriptorType(descriptor, CustomDescriptor.class); 34 | customDescriptor.setValue(value); 35 | return customDescriptor; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/it/plugin/customplugin/src/main/resources/META-INF/jqassistant-plugin.xml: -------------------------------------------------------------------------------- 1 | 7 | Custom plugins. 8 | 9 | com.buschmais.jqassistant.scm.maven.integration.plugin.CustomDescriptor 10 | 11 | 12 | com.buschmais.jqassistant.scm.maven.integration.plugin.CustomScannerPlugin 13 | 14 | 15 | com.buschmais.jqassistant.scm.maven.integration.plugin.CustomReportPlugin 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/it/plugin/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = verify -Djqassistant.maven.use-execution-root-as-project-root=false -e 2 | -------------------------------------------------------------------------------- /src/it/plugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration.plugin 5 | @project.version@ 6 | pom 7 | 8 | 9 | 3.10.1 10 | 11 | 12 | 13 | 14 | 15 | 16 | org.apache.maven.plugins 17 | maven-compiler-plugin 18 | ${maven-compiler-plugin.version} 19 | 20 | 21 | 22 | 23 | 24 | 25 | customplugin 26 | site 27 | 28 | -------------------------------------------------------------------------------- /src/it/plugin/site/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | plugins: 3 | - group-id: com.buschmais.jqassistant 4 | artifact-id: jqassistant-maven-plugin.integration.plugin.customplugin 5 | version: ${project.version} 6 | scan: 7 | include: 8 | urls: 9 | - jqassistant-plugin:META-INF/jqassistant-plugin.xml 10 | properties: 11 | custom.scan.value: testValue 12 | analyze: 13 | groups: 14 | - default 15 | report: 16 | properties: 17 | customReport.fileName: ${project.build.directory}/customReport.txt 18 | -------------------------------------------------------------------------------- /src/it/plugin/site/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Return all Custom labeled nodes with a value "testValue". 11 | 19 | 20 | 1 21 | 22 | 23 | 24 | 25 | Return all Custom labeled nodes with a value "testValue". 26 | 34 | 35 | 2 36 | 37 | 38 | 39 | 40 | Return the scanned plugin URI. 41 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/it/plugin/site/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration.plugin 6 | @project.version@ 7 | 8 | @project.artifactId@.integration.plugin.site 9 | 10 | 11 | 12 | 13 | @project.groupId@ 14 | @project.artifactId@ 15 | @project.version@ 16 | 17 | 18 | default-cli 19 | 20 | scan 21 | analyze 22 | 23 | 24 | 25 | 26 | ${project.basedir}/.jqassistant.yml 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/it/plugin/site/src/main/java/com/buschmais/jqassistant/scm/maven/Foo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | public class Foo { 4 | } -------------------------------------------------------------------------------- /src/it/plugin/verify.groovy: -------------------------------------------------------------------------------- 1 | assert !new File(basedir, 'site/target/customReport.txt.1').exists() 2 | assert new File(basedir, 'site/target/customReport.txt.2').exists() 3 | 4 | 5 | // XML report 6 | def reportFile = new File(basedir, 'site/target/jqassistant/jqassistant-report.xml') 7 | assert reportFile.exists() 8 | def report = new XmlSlurper().parse(reportFile) 9 | assert report.group.concept.find { it.@id == 'customPlugin:PluginURI' }.status == "success" 10 | verifyValueConcept(report.group.concept.find { it.@id == "customPlugin:testValue1" }) 11 | verifyValueConcept(report.group.concept.find { it.@id == "customPlugin:testValue2" }) 12 | 13 | 14 | private void verifyValueConcept(testValueConcept) { 15 | assert testValueConcept != null 16 | assert testValueConcept.result.rows['@count'] == "1"; 17 | assert testValueConcept.result.rows.row[0].column[0].value == "testValue"; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/it/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | @project.groupId@ 4 | @project.artifactId@.integration 5 | @project.version@ 6 | 7 | 3.10.1 8 | 3.7.1 9 | 3.0.0 10 | 11 | pom 12 | 13 | 14 | 15 | 16 | 17 | org.apache.maven.plugins 18 | maven-compiler-plugin 19 | ${maven-compiler-plugin.version} 20 | 21 | 22 | org.apache.maven.plugins 23 | maven-site-plugin 24 | ${maven-site-plugin.version} 25 | 26 | 27 | 28 | 29 | 30 | 31 | @project.groupId@ 32 | @project.artifactId@ 33 | @project.version@ 34 | 35 | 36 | 37 | scan 38 | analyze 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-project-info-reports-plugin 51 | ${maven-project-info-reports-plugin.version} 52 | 53 | 54 | @project.groupId@ 55 | @project.artifactId@ 56 | @project.version@ 57 | 58 | 59 | 60 | report 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/it/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @project.groupId@ 5 | 6 | 7 | 8 | it-repo 9 | 10 | true 11 | 12 | 13 | 14 | local.central 15 | file://@localRepository@ 16 | 17 | true 18 | 19 | 20 | true 21 | always 22 | 23 | 24 | 25 | 26 | 27 | local.central 28 | file://@localRepository@ 29 | 30 | true 31 | 32 | 33 | true 34 | always 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/it/singlemodule/defaultseverity/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | rule: 4 | default-group-severity: INFO 5 | report: 6 | properties: 7 | xml.report.file: ${jqa.xmlReportFile} 8 | -------------------------------------------------------------------------------- /src/it/singlemodule/defaultseverity/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -P1 -e 2 | invoker.goals.2 = install -P2 -e 3 | invoker.buildResult.2 = failure 4 | invoker.goals.3 = install -P3 -e 5 | invoker.goals.4 = install -P4 -e 6 | invoker.buildResult.4 = failure 7 | invoker.goals.5 = install -P5 -e 8 | -------------------------------------------------------------------------------- /src/it/singlemodule/defaultseverity/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | A constraint with severity blocker. 9 | 10 | RETURN 1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | A concept with default severity. 19 | 20 | RETURN 0 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | A constraint with default severity. 29 | 30 | RETURN 1 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/it/singlemodule/defaultseverity/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.defaultseverity 10 | 11 | 12 | 13 | 1 14 | 15 | default 16 | target/jqassistant/jqassistant-report.1.xml 17 | 18 | 19 | 20 | 2 21 | 22 | severity:ConceptWithDefaultSeverity 23 | MINOR 24 | target/jqassistant/jqassistant-report.2.xml 25 | 26 | 27 | 28 | 3 29 | 30 | severity:ConceptWithDefaultSeverity 31 | MAJOR 32 | target/jqassistant/jqassistant-report.3.xml 33 | 34 | 35 | 36 | 4 37 | 38 | severity:ConstraintWithDefaultSeverity 39 | MAJOR 40 | target/jqassistant/jqassistant-report.4.xml 41 | 42 | 43 | 44 | 5 45 | 46 | severity:ConstraintWithDefaultSeverity 47 | CRITICAL 48 | target/jqassistant/jqassistant-report.5.xml 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/it/singlemodule/defaultseverity/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile1 = new File(basedir, 'target/jqassistant/jqassistant-report.1.xml') 2 | assert reportFile1.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile1) 4 | def defaultGroup = jqassistantReport.group.find { it.@id = 'default' } 5 | def constraint = defaultGroup.constraint.find { it.@id == 'severity:Blocker' } 6 | assert constraint.status == 'success' 7 | assert constraint.severity == 'info' 8 | -------------------------------------------------------------------------------- /src/it/singlemodule/deprecated-rules/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | groups: 4 | - it 5 | -------------------------------------------------------------------------------- /src/it/singlemodule/deprecated-rules/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = verify -e 2 | -------------------------------------------------------------------------------- /src/it/singlemodule/deprecated-rules/jqassistant/it.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | This is a deprecated constraint 10 | 11 | 12 | 13 | This is a deprecated concept 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/it/singlemodule/deprecated-rules/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.deprecated-rules 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/it/singlemodule/deprecated-rules/verify.groovy: -------------------------------------------------------------------------------- 1 | def buildLog = new File(basedir, 'build.log') 2 | assert buildLog.exists() 3 | 4 | assert buildLog.getText().contains('[WARNING] Rule \'it:DeprecatedConcept\' is deprecated: This is a deprecated concept') 5 | assert buildLog.getText().contains('[WARNING] Rule \'it:DeprecatedConstraint\' is deprecated: This is a deprecated constraint') 6 | -------------------------------------------------------------------------------- /src/it/singlemodule/export-rules/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = com.buschmais.jqassistant:jqassistant-maven-plugin::export-rules -e 2 | -------------------------------------------------------------------------------- /src/it/singlemodule/export-rules/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/it/singlemodule/export-rules/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.export-rules 10 | -------------------------------------------------------------------------------- /src/it/singlemodule/export-rules/verify.groovy: -------------------------------------------------------------------------------- 1 | def rulesFile = new File(basedir, 'target/jqassistant/jqassistant-rules.xml') 2 | assert rulesFile.exists() 3 | def rulesNode = new XmlSlurper().parse(rulesFile) 4 | def exportDefault = rulesNode.group.find { it.@id = 'export-default' } 5 | assert exportDefault != null 6 | assert exportDefault.includeConstraint.find { it.@refId == 'java:AvoidCyclicPackageDependencies' } != null 7 | assert exportDefault.includeConstraint.find { it.@refId == 'java:AvoidCyclicArtifactDependencies' } != null 8 | -------------------------------------------------------------------------------- /src/it/singlemodule/failonseverity/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | report: 4 | fail-on-severity: ${prop.failOnSeverity:INVALID_VALUE} 5 | -------------------------------------------------------------------------------- /src/it/singlemodule/failonseverity/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = -Dprop.failOnSeverity=BLOCKER -e install 2 | 3 | invoker.goals.2 = -Dprop.failOnSeverity=MAJOR -e install 4 | invoker.buildResult.2 = failure 5 | 6 | invoker.goals.3 = -Dprop.failOnSeverity=MINOR -e install 7 | invoker.buildResult.3 = failure 8 | 9 | invoker.goals.4 = -Dprop.failOnSeverity=MINOR -Djqassistant.analyze.report.continue-on-failure=true -e install 10 | 11 | invoker.goals.5 = -Dprop.failOnSeverity=never -e install 12 | -------------------------------------------------------------------------------- /src/it/singlemodule/failonseverity/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | A constraint with severity major. 9 | 10 | RETURN 1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/it/singlemodule/failonseverity/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | 10 | @project.artifactId@.integration.singlemodule.failonseverity 11 | 12 | -------------------------------------------------------------------------------- /src/it/singlemodule/junit-report/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install 2 | 3 | -------------------------------------------------------------------------------- /src/it/singlemodule/junit-report/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Test constraint. 15 | 16 | MATCH 17 | (:Artifact)-[:CONTAINS]->(t:Type)-[:DECLARES]->(m:Member) 18 | RETURN 19 | t, collect(m) 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/it/singlemodule/junit-report/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.junit-report 10 | -------------------------------------------------------------------------------- /src/it/singlemodule/junit-report/src/main/java/com/buschmais/jqassistant/maven/it/Service.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.it; 2 | 3 | public class Service { 4 | 5 | public void doSomething() { 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/it/singlemodule/junit-report/verify.groovy: -------------------------------------------------------------------------------- 1 | def junitReportFile = new File(basedir, 'target/jqassistant/report/junit/TEST-jqassistant.Group_nestedGroup.xml') 2 | assert junitReportFile.exists() 3 | def testsuiteNode = new XmlSlurper().parse(junitReportFile) 4 | assert testsuiteNode.testcase.size() >= 3 5 | def memberByType = testsuiteNode.testcase.find { it.@id= 'Constraint_test_MemberByType'} 6 | assert memberByType.failure.message != null 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/it/singlemodule/model/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | report: 4 | fail-on-severity: MINOR 5 | -------------------------------------------------------------------------------- /src/it/singlemodule/model/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = install -e 2 | -------------------------------------------------------------------------------- /src/it/singlemodule/model/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Return all POM models 11 | 12 | MATCH 13 | (:Maven:Project)-[:HAS_MODEL]->(pom:Maven:Pom:File) 14 | RETURN 15 | pom 16 | 17 | 18 | 19 | 20 | Return all POM models 21 | 22 | MATCH 23 | (:Maven:Project)-[:HAS_EFFECTIVE_MODEL]->(pom:Maven:Pom:Effective) 24 | RETURN 25 | pom 26 | 27 | 28 | 29 | 30 | Verifies that the :Test artifact depends on the :Main artifact 31 | 32 | MATCH 33 | (project:Maven:Project), 34 | (project)-[:CREATES]->(main:Main:Artifact), 35 | (project)-[:CREATES]->(test:Test:Artifact), 36 | (test)-[:DEPENDS_ON]->(main) 37 | RETURN 38 | main, test 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/it/singlemodule/model/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.model 10 | 11 | -------------------------------------------------------------------------------- /src/it/singlemodule/model/src/main/java/com/buschmais/jqassistant/maven/it/Service.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.it; 2 | 3 | public class Service { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/it/singlemodule/model/src/src/test/java/com/buschmais/jqassistant/maven/it/ServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.it; 2 | 3 | public class ServiceTest { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/it/singlemodule/model/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def report = new XmlSlurper().parse(reportFile) 4 | 5 | verifyConcept(report, "test:ProjectHasModel", 1) 6 | verifyConcept(report, "test:ProjectHasEffectiveModel", 1) 7 | verifyConcept(report, "test:TestArtifactDependsOnMainArtifact", 1) 8 | 9 | def verifyConcept(report, conceptId, expectedRowCount) { 10 | def conceptResult = report.group.concept.find { it.@id == conceptId } 11 | assert conceptResult != null 12 | assert conceptResult.result.rows['@count'] == Integer.toString(expectedRowCount); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/it/singlemodule/ruleparameter/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | rule-parameters: 4 | testArtifactId: ${project.artifactId} 5 | -------------------------------------------------------------------------------- /src/it/singlemodule/ruleparameter/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -e 2 | -------------------------------------------------------------------------------- /src/it/singlemodule/ruleparameter/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Test concept for verifying rule parameters. 10 | 11 | MATCH 12 | (project:Maven:Project) 13 | WHERE 14 | project.artifactId=$testArtifactId 15 | RETURN 16 | project 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/it/singlemodule/ruleparameter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.ruleparameter 10 | 11 | -------------------------------------------------------------------------------- /src/it/singlemodule/ruleparameter/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find{ it.@id = 'default' } 5 | assert defaultGroup.concept.find { it.@id == 'test:RuleParameter' }.result.rows.@count == 1 6 | -------------------------------------------------------------------------------- /src/it/singlemodule/scanincludes/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | scan: 3 | include: 4 | files: 5 | - ${project.basedir}/config 6 | urls: 7 | - file:config/test.properties 8 | 9 | -------------------------------------------------------------------------------- /src/it/singlemodule/scanincludes/config/test.properties: -------------------------------------------------------------------------------- 1 | testKey=testValue -------------------------------------------------------------------------------- /src/it/singlemodule/scanincludes/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -e 2 | -------------------------------------------------------------------------------- /src/it/singlemodule/scanincludes/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Verifies presence of the test properties file. 9 | (config:File)-[:CONTAINS]->(f:File:Properties) 12 | where 13 | config.fileName ends with "/config" 14 | and f.fileName = "/test.properties" 15 | return 16 | f 17 | ]]> 18 | 19 | 20 | 21 | Verifies presence of the test properties file identified by its URL. 22 | (f:File:Properties) 25 | where 26 | f.fileName = "file:config/test.properties" 27 | return 28 | f 29 | ]]> 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/it/singlemodule/scanincludes/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.scanincludes 10 | 11 | -------------------------------------------------------------------------------- /src/it/singlemodule/scanincludes/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find { it.@id = 'default' } 5 | assert defaultGroup.concept.find { it.@id == 'scanInclude:PropertiesFile' }.status == "success" 6 | assert defaultGroup.concept.find { it.@id == 'scanInclude:PropertiesUrl' }.status == "success" 7 | -------------------------------------------------------------------------------- /src/it/singlemodule/severity/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | report: 4 | warn-on-severity: ${jqa.warnOnSeverity} 5 | fail-on-severity: ${jqa.failOnSeverity} 6 | continue-on-failure: ${jqa.continueOnFailure:false} 7 | properties: 8 | xml.report.file: ${jqa.xmlReportFile} 9 | -------------------------------------------------------------------------------- /src/it/singlemodule/severity/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -PfailOnSeverity -e 2 | invoker.goals.2 = install -PfailOnSeverityWithLowerCaseLetters -e 3 | invoker.goals.3 = install -PcontinueOnFailureDisabled -e 4 | invoker.buildResult.3 = failure 5 | invoker.goals.4 = install -PcontinueOnFailureEnabled -e 6 | -------------------------------------------------------------------------------- /src/it/singlemodule/severity/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A concept with severity major. 10 | 11 | RETURN 0 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | A constraint with severity blocker. 20 | 21 | RETURN 1 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/it/singlemodule/severity/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.severity 10 | 11 | 12 | 13 | failOnSeverity 14 | 15 | MINOR 16 | MINOR 17 | target/jqassistant/jqassistant-report.1.xml 18 | 19 | 20 | 21 | failOnSeverityWithLowerCaseLetters 22 | 23 | minor 24 | major 25 | target/jqassistant/jqassistant-report.2.xml 26 | 27 | 28 | 29 | continueOnFailureDisabled 30 | 31 | info 32 | info 33 | target/jqassistant/jqassistant-report.3.xml 34 | 35 | 36 | 37 | continueOnFailureEnabled 38 | 39 | info 40 | info 41 | true 42 | target/jqassistant/jqassistant-report.4.xml 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/it/singlemodule/severity/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.4.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find { it.@id = 'default' } 5 | assert defaultGroup.concept.find { it.@id == 'severity:Major' }.status == 'failure' 6 | assert defaultGroup.constraint.find { it.@id == 'severity:Blocker' }.status == 'failure' 7 | -------------------------------------------------------------------------------- /src/it/singlemodule/shade/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | rule: 4 | directory: ${jqa.ruleDir} 5 | report: 6 | fail-on-severity: minor 7 | -------------------------------------------------------------------------------- /src/it/singlemodule/shade/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -e 2 | -------------------------------------------------------------------------------- /src/it/singlemodule/shade/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Return all POM models 9 | 10 | MATCH 11 | (:Maven:Project)-[:HAS_MODEL]->(pom:Maven:Pom:File) 12 | RETURN 13 | pom 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/it/singlemodule/shade/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.shade 10 | 11 | 12 | ${project.basedir}/jqassistant 13 | 14 | 15 | 16 | 17 | 18 | org.apache.maven.plugins 19 | maven-shade-plugin 20 | 2.4.1 21 | 22 | 23 | 24 | shade 25 | 26 | 27 | 28 | 29 | false 30 | ${project.build.directory}/dependency-reduced-pom.xml 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | commons-collections 41 | commons-collections 42 | 3.2.2 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/it/singlemodule/shade/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def report = new XmlSlurper().parse(reportFile) 4 | def testConcept = report.group.concept.find { it.@id == "test:ProjectHasModel" } 5 | assert testConcept != null 6 | assert testConcept.result.rows['@count'] == "1"; 7 | -------------------------------------------------------------------------------- /src/it/singlemodule/site/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -e 2 | invoker.goals.2 = jqassistant:report 3 | invoker.goals.3 = site -Pcustom-site 4 | -------------------------------------------------------------------------------- /src/it/singlemodule/site/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | This description contains german umlauts: ÄÖÜß 12 | 13 | RETURN 'ÄÖÜß' as umlauts 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/it/singlemodule/site/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.site 10 | 11 | 12 | 13 | custom-site 14 | 15 | target/custom-site 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.maven.plugins 24 | maven-project-info-reports-plugin 25 | 3.0.0 26 | 27 | 28 | @project.groupId@ 29 | @project.artifactId@ 30 | @project.version@ 31 | 32 | 33 | 34 | report 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/it/singlemodule/site/verify.groovy: -------------------------------------------------------------------------------- 1 | def reportFile = new File(basedir, 'target/jqassistant/jqassistant-report.xml') 2 | assert reportFile.exists() 3 | def jqassistantReport = new XmlSlurper().parse(reportFile) 4 | def defaultGroup = jqassistantReport.group.find { it.@id == 'default' } 5 | def encodingConcept = defaultGroup.concept.find { it.@id == 'encoding' } 6 | def rows = encodingConcept.result.rows 7 | assert rows.@count == 1 8 | def value = rows.row[0].column.find{it.@name='umlauts'}.value 9 | assert value == 'ÄÖÜß' 10 | assert new File(basedir, 'target/site/jqassistant.html').exists() 11 | assert new File(basedir, 'target/custom-site/jqassistant.html').exists() 12 | assert !new File(basedir, 'target/surefire-reports/TEST-default.xml').exists() 13 | -------------------------------------------------------------------------------- /src/it/singlemodule/skip/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | skip: ${jqa.skip} 3 | -------------------------------------------------------------------------------- /src/it/singlemodule/skip/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -e 2 | -------------------------------------------------------------------------------- /src/it/singlemodule/skip/jqassistant/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/it/singlemodule/skip/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.singlemodule.skip 10 | 11 | 12 | true 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/it/singlemodule/skip/verify.groovy: -------------------------------------------------------------------------------- 1 | assert !new File(basedir, 'target/jqassistant/store').exists() 2 | assert !new File(basedir, 'target/jqassistant/jqassistant-report.xml').exists() 3 | -------------------------------------------------------------------------------- /src/it/yaml/one-concept/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | report: 4 | fail-on-severity: MINOR 5 | -------------------------------------------------------------------------------- /src/it/yaml/one-concept/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = -e install 2 | -------------------------------------------------------------------------------- /src/it/yaml/one-concept/jqassistant/default.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - id: default 3 | includedConcepts: 4 | - refId: oneConcept 5 | 6 | concepts: 7 | - id: oneConcept 8 | description: > 9 | A concept. A concept. A concept. A concept. A concept. A concept. 10 | A concept. A concept. A concept. A concept. A concept. A concept. 11 | A concept. A concept. A concept. A concept. A concept. A concept. 12 | language: cypher 13 | source: | 14 | MATCH (c:Type:Class)-[:DECLARES]->(m:Method) 15 | SET c:XYZ 16 | RETURN c 17 | -------------------------------------------------------------------------------- /src/it/yaml/one-concept/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.yaml.oneconcept 10 | 1.0.0-SNAPSHOT 11 | 12 | 13 | 14 | 15 | @project.groupId@ 16 | @project.artifactId@ 17 | @project.version@ 18 | 19 | 20 | scan 21 | 22 | 23 | analyze 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/it/yaml/one-concept/src/main/java/com/buschmais/jqassistant/maven/it/yaml/oneconcept/Service.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.it.yaml.oneconcept; 2 | 3 | public class Service { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/it/yaml/one-concept/verify.groovy: -------------------------------------------------------------------------------- 1 | def buildLog = new File(basedir, 'build.log') 2 | assert buildLog.exists() 3 | 4 | assert buildLog.getText().contains('[INFO] Applying concept \'oneConcept\' with severity: \'MINOR\'.') 5 | 6 | -------------------------------------------------------------------------------- /src/it/yaml/violated-constraint/.jqassistant.yml: -------------------------------------------------------------------------------- 1 | jqassistant: 2 | analyze: 3 | report: 4 | fail-on-severity: MINOR 5 | -------------------------------------------------------------------------------- /src/it/yaml/violated-constraint/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals.1 = install -e --fail-never 2 | -------------------------------------------------------------------------------- /src/it/yaml/violated-constraint/jqassistant/default.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - id: default 3 | includedConstraints: 4 | - refId: violatedConcept 5 | 6 | constraints: 7 | - id: violatedConcept 8 | severity: major 9 | description: foobar 10 | source: | 11 | MATCH (c:Type:Class), (i:Type:Interface {name: 'AnInterface'}) 12 | WHERE NOT (c)-[:IMPLEMENTS]->(i) 13 | RETURN c 14 | -------------------------------------------------------------------------------- /src/it/yaml/violated-constraint/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | @project.groupId@ 5 | @project.artifactId@.integration 6 | @project.version@ 7 | ../../pom.xml 8 | 9 | @project.artifactId@.integration.yaml.violatedconstraint 10 | 1.0.0-SNAPSHOT 11 | 12 | 13 | 14 | 15 | @project.groupId@ 16 | @project.artifactId@ 17 | @project.version@ 18 | 19 | 20 | scan 21 | 22 | 23 | analyze 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/it/yaml/violated-constraint/src/main/java/com/buschmais/jqassistant/maven/it/yaml/violatedconstraint/AClass.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.it.yaml.violatedconstraint; 2 | 3 | public class AClass { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/it/yaml/violated-constraint/src/main/java/com/buschmais/jqassistant/maven/it/yaml/violatedconstraint/AnInterface.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.maven.it.yaml.violatedconstraint; 2 | 3 | public interface AnInterface { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/it/yaml/violated-constraint/verify.groovy: -------------------------------------------------------------------------------- 1 | def buildLog = new File(basedir, 'build.log') 2 | assert buildLog.exists() 3 | 4 | // The constraint must be validated 5 | assert buildLog.getText().contains('[INFO] Validating constraint \'violatedConcept\' with severity: \'MAJOR\'.') 6 | 7 | // As the code does not fulfill the constraint the build should fail. 8 | assert buildLog.getText().contains('[INFO] BUILD FAILURE') 9 | 10 | // The following lines should have been issued by jQA because of the 11 | // violated constraint. 12 | assert buildLog.getText().contains('[ERROR] --[ Constraint Violation ]-----------------------------------------') 13 | assert buildLog.getText().contains('[ERROR] Constraint: violatedConcept') 14 | assert buildLog.getText().contains('[ERROR] Severity: MAJOR') 15 | assert buildLog.getText().contains('[ERROR] Number of rows: 1') 16 | assert buildLog.getText().contains('[ERROR] foobar') 17 | assert buildLog.getText().contains('[ERROR] c=com.buschmais.jqassistant.maven.it.yaml.violatedconstraint.AClass') 18 | 19 | // Only one constraint should have been violated 20 | assert buildLog.getText().contains('Failed rules detected: 0 concepts, 1 constraints') 21 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/AbstractModuleMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import java.util.Set; 4 | 5 | import org.apache.maven.plugin.MojoExecutionException; 6 | import org.apache.maven.plugin.MojoFailureException; 7 | import org.apache.maven.project.MavenProject; 8 | 9 | /** 10 | * Abstract base class for mojos which are executed per module. 11 | */ 12 | public abstract class AbstractModuleMojo extends AbstractMojo { 13 | 14 | @Override 15 | public final void execute(MojoExecutionContext mojoExecutionContext, Set executedModules) throws MojoExecutionException, MojoFailureException { 16 | if (mojoExecutionContext.getConfiguration() 17 | .maven() 18 | .module() 19 | .skip()) { 20 | getLog().info("Skipping module."); 21 | } else { 22 | execute(mojoExecutionContext); 23 | } 24 | } 25 | 26 | protected abstract void execute(MojoExecutionContext mojoExecutionContext) 27 | throws MojoExecutionException, MojoFailureException; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/AvailableRulesMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import com.buschmais.jqassistant.core.rule.api.RuleHelper; 4 | import com.buschmais.jqassistant.core.rule.api.model.RuleException; 5 | import com.buschmais.jqassistant.core.rule.api.model.RuleSet; 6 | 7 | import org.apache.maven.plugin.MojoExecutionException; 8 | import org.apache.maven.plugin.MojoFailureException; 9 | import org.apache.maven.plugins.annotations.LifecyclePhase; 10 | import org.apache.maven.plugins.annotations.Mojo; 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | 14 | /** 15 | * Lists all available rules. 16 | */ 17 | @Mojo(name = "available-rules", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true) 18 | public class AvailableRulesMojo extends AbstractRuleMojo { 19 | private static final Logger LOGGER = LoggerFactory.getLogger(AvailableRulesMojo.class); 20 | 21 | @Override 22 | public void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException, MojoFailureException { 23 | getLog().info("Available rules for '" + mojoExecutionContext.getRootModule() 24 | .getName() + "'."); 25 | RuleSet ruleSet = readRules(mojoExecutionContext); 26 | RuleHelper ruleHelper = new RuleHelper(LOGGER); 27 | try { 28 | ruleHelper.printRuleSet(ruleSet, mojoExecutionContext.getConfiguration() 29 | .analyze() 30 | .rule()); 31 | } catch (RuleException e) { 32 | throw new MojoExecutionException("Cannot print available rules.", e); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/AvailableScopesMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import com.buschmais.jqassistant.core.scanner.api.ScopeHelper; 4 | import com.buschmais.jqassistant.core.scanner.spi.ScannerPluginRepository; 5 | 6 | import org.apache.maven.plugin.MojoExecutionException; 7 | import org.apache.maven.plugins.annotations.LifecyclePhase; 8 | import org.apache.maven.plugins.annotations.Mojo; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | 12 | /** 13 | * Lists all available scopes. 14 | */ 15 | @Mojo(name = "available-scopes", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true) 16 | public class AvailableScopesMojo extends AbstractProjectMojo { 17 | 18 | private Logger logger = LoggerFactory.getLogger(AvailableScopesMojo.class); 19 | 20 | @Override 21 | public void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException { 22 | getLog().info("Available scopes for '" + mojoExecutionContext.getRootModule() 23 | .getName() + "'."); 24 | ScopeHelper scopeHelper = new ScopeHelper(logger); 25 | ScannerPluginRepository scannerPluginRepository = mojoExecutionContext.getPluginRepository() 26 | .getScannerPluginRepository(); 27 | scopeHelper.printScopes(scannerPluginRepository.getScopes()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/EffectiveConfigurationMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import com.buschmais.jqassistant.core.runtime.api.configuration.ConfigurationSerializer; 4 | import com.buschmais.jqassistant.scm.maven.configuration.MavenConfiguration; 5 | 6 | import org.apache.maven.plugin.MojoExecutionException; 7 | import org.apache.maven.plugin.MojoFailureException; 8 | import org.apache.maven.plugins.annotations.LifecyclePhase; 9 | import org.apache.maven.plugins.annotations.Mojo; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | 13 | /** 14 | * Lists all effective rules. 15 | */ 16 | @Mojo(name = "effective-configuration", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true) 17 | public class EffectiveConfigurationMojo extends AbstractRuleMojo { 18 | 19 | private static final Logger LOGGER = LoggerFactory.getLogger(EffectiveConfigurationMojo.class); 20 | 21 | private final ConfigurationSerializer configurationSerializer = new ConfigurationSerializer<>(); 22 | 23 | @Override 24 | public void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException, MojoFailureException { 25 | getLog().info("Effective configuration for '" + mojoExecutionContext.getRootModule() 26 | .getName() + "'\n" + configurationSerializer.toYaml(mojoExecutionContext.getConfiguration())); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/EffectiveRulesMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import com.buschmais.jqassistant.core.analysis.api.configuration.Analyze; 4 | import com.buschmais.jqassistant.core.rule.api.RuleHelper; 5 | import com.buschmais.jqassistant.core.rule.api.model.RuleException; 6 | import com.buschmais.jqassistant.core.rule.api.model.RuleSelection; 7 | import com.buschmais.jqassistant.core.rule.api.model.RuleSet; 8 | 9 | import org.apache.maven.plugin.MojoExecutionException; 10 | import org.apache.maven.plugin.MojoFailureException; 11 | import org.apache.maven.plugins.annotations.LifecyclePhase; 12 | import org.apache.maven.plugins.annotations.Mojo; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | /** 17 | * Lists all effective rules. 18 | */ 19 | @Mojo(name = "effective-rules", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true) 20 | public class EffectiveRulesMojo extends AbstractRuleMojo { 21 | 22 | private static final Logger LOGGER = LoggerFactory.getLogger(EffectiveRulesMojo.class); 23 | 24 | @Override 25 | public void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException, MojoFailureException { 26 | getLog().info("Effective rules for '" + mojoExecutionContext.getRootModule() 27 | .getName() + "'."); 28 | Analyze analyze = mojoExecutionContext.getConfiguration() 29 | .analyze(); 30 | RuleSet ruleSet = readRules(mojoExecutionContext); 31 | RuleSelection ruleSelection = RuleSelection.select(ruleSet, analyze.groups(), analyze.constraints(), analyze.excludeConstraints(), analyze.concepts()); 32 | RuleHelper ruleHelper = new RuleHelper(LOGGER); 33 | try { 34 | ruleHelper.printRuleSet(ruleSet, ruleSelection, analyze.rule()); 35 | } catch (RuleException e) { 36 | throw new MojoExecutionException("Cannot print effective rules.", e); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/ExportRulesMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import java.io.*; 4 | 5 | import com.buschmais.jqassistant.core.rule.api.model.RuleException; 6 | import com.buschmais.jqassistant.core.rule.api.model.RuleSet; 7 | import com.buschmais.jqassistant.core.rule.api.writer.RuleSetWriter; 8 | import com.buschmais.jqassistant.core.rule.impl.writer.XmlRuleSetWriter; 9 | 10 | import org.apache.maven.plugin.MojoExecutionException; 11 | import org.apache.maven.plugins.annotations.Mojo; 12 | import org.apache.maven.project.MavenProject; 13 | 14 | /** 15 | * Exports the all rules to an XML file. 16 | */ 17 | @Mojo(name = "export-rules", threadSafe = true) 18 | public class ExportRulesMojo extends AbstractRuleMojo { 19 | 20 | @Override 21 | protected void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException { 22 | MavenProject rootModule = mojoExecutionContext.getRootModule(); 23 | getLog().info("Exporting rules for '" + rootModule.getName() + "'."); 24 | final RuleSet ruleSet = readRules(mojoExecutionContext); 25 | RuleSetWriter ruleSetWriter = new XmlRuleSetWriter(mojoExecutionContext.getConfiguration() 26 | .analyze() 27 | .rule()); 28 | File outputFile = mojoExecutionContext.getOutputFile(null, "jqassistant-rules.xml"); 29 | Writer writer; 30 | try { 31 | writer = new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"); 32 | } catch (IOException e) { 33 | throw new MojoExecutionException("Cannot create writer for rule export.", e); 34 | } 35 | try { 36 | ruleSetWriter.write(ruleSet, writer); 37 | } catch (RuleException e) { 38 | throw new MojoExecutionException("Cannot write rules.", e); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/ListPluginsMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import org.apache.maven.plugin.MojoExecutionException; 4 | import org.apache.maven.plugins.annotations.Mojo; 5 | 6 | /** 7 | * Lists all plugins known based on the current configuration 8 | * to jQAssistant. 9 | */ 10 | @Mojo(name = "list-plugins", threadSafe = true) 11 | public class ListPluginsMojo extends AbstractProjectMojo { 12 | 13 | @Override 14 | protected void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException { 15 | // Nothing to do here, plugins are listed on startup 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/ResetMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import org.apache.maven.plugin.MojoExecutionException; 4 | import org.apache.maven.plugin.MojoFailureException; 5 | import org.apache.maven.plugins.annotations.Mojo; 6 | 7 | /** 8 | * Resets the store. 9 | */ 10 | @Mojo(name = "reset", aggregator = true, requiresProject = false, threadSafe = true) 11 | public class ResetMojo extends AbstractProjectMojo { 12 | 13 | @Override 14 | protected void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException, MojoFailureException { 15 | withStore(store -> store.reset(), mojoExecutionContext); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/ServerMojo.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven; 2 | 3 | import java.io.IOException; 4 | 5 | import com.buschmais.jqassistant.core.store.impl.EmbeddedGraphStore; 6 | import com.buschmais.jqassistant.neo4j.embedded.EmbeddedNeo4jServer; 7 | 8 | import org.apache.maven.plugin.MojoExecutionException; 9 | import org.apache.maven.plugin.MojoFailureException; 10 | import org.apache.maven.plugins.annotations.Mojo; 11 | import org.apache.maven.project.MavenProject; 12 | 13 | /** 14 | * Starts an embedded Neo4j server. 15 | */ 16 | @Mojo(name = "server", threadSafe = true) 17 | public class ServerMojo extends AbstractProjectMojo { 18 | 19 | @Override 20 | protected boolean isConnectorRequired() { 21 | return true; 22 | } 23 | 24 | @Override 25 | protected void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException, MojoFailureException { 26 | withStore(store -> server(mojoExecutionContext, (EmbeddedGraphStore) store), mojoExecutionContext); 27 | } 28 | 29 | private void server(MojoExecutionContext mojoExecutionContext, EmbeddedGraphStore store) throws MojoExecutionException { 30 | MavenProject rootModule = mojoExecutionContext.getRootModule(); 31 | EmbeddedGraphStore embeddedGraphStore = store; 32 | EmbeddedNeo4jServer server = embeddedGraphStore.getServer(); 33 | server.start(); 34 | getLog().info("Running server for module " + rootModule.getGroupId() + ":" + rootModule.getArtifactId() + ":" + rootModule.getVersion()); 35 | if (!mojoExecutionContext.getConfiguration().server().daemon()) { 36 | getLog().info("Press to finish."); 37 | try { 38 | System.in.read(); 39 | } catch (IOException e) { 40 | throw new MojoExecutionException("Cannot read from System.in.", e); 41 | } finally { 42 | server.stop(); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/configuration/Maven.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.configuration; 2 | 3 | import com.buschmais.jqassistant.core.shared.annotation.Description; 4 | 5 | import io.smallrye.config.ConfigMapping; 6 | import io.smallrye.config.WithDefault; 7 | 8 | /** 9 | * The Maven configuration. 10 | */ 11 | @ConfigMapping(prefix = "jqassistant.maven") 12 | public interface Maven { 13 | 14 | /** 15 | * The per-{@link Module} configuration. 16 | * 17 | * @return The {@link Module} configuration. 18 | */ 19 | Module module(); 20 | 21 | String USE_EXECUTION_ROOT_AS_PROJECT_ROOT = "use-execution-root-as-project-root"; 22 | 23 | @Description("Force the module where 'mvn' is being executed to be used as root module. The database will be created in this module and contain all information of the reactor. Rules will be read from the rules of this module.") 24 | @WithDefault("true") 25 | boolean useExecutionRootAsProjectRoot(); 26 | 27 | String REUSE_STORE = "reuse-store"; 28 | 29 | @WithDefault("true") 30 | @Description("Re-use store instances across all modules of the Maven reactor. Can be set to false for mitigating problems in specific setups, the jQAssistant Maven plugin will display an according hint when this is required.") 31 | boolean reuseStore(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/configuration/MavenConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.configuration; 2 | 3 | import com.buschmais.jqassistant.core.runtime.api.configuration.Configuration; 4 | import com.buschmais.jqassistant.core.shared.annotation.Description; 5 | 6 | import io.smallrye.config.ConfigMapping; 7 | 8 | @ConfigMapping(prefix = Configuration.PREFIX) 9 | public interface MavenConfiguration extends Configuration { 10 | 11 | @Description("The Maven configuration.") 12 | Maven maven(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/configuration/Module.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.configuration; 2 | 3 | import com.buschmais.jqassistant.core.shared.annotation.Description; 4 | 5 | import io.smallrye.config.ConfigMapping; 6 | import io.smallrye.config.WithDefault; 7 | 8 | /** 9 | * Per-Module configuration, applies to module-based goals. 10 | */ 11 | @ConfigMapping(prefix = "jqassistant.maven.module") 12 | public interface Module { 13 | 14 | String SKIP = "skip"; 15 | 16 | @WithDefault("false") 17 | @Description("Skip execution of jQAssistant goals for a module.") 18 | boolean skip(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/configuration/source/AbstractObjectValueConfigSource.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.configuration.source; 2 | 3 | import java.util.*; 4 | 5 | import io.smallrye.config.common.AbstractConfigSource; 6 | import org.codehaus.plexus.interpolation.PrefixedObjectValueSource; 7 | 8 | /** 9 | * Abstract config source wrapping a Maven object providing properties values which are extracted using a {@link PrefixedObjectValueSource}. 10 | * 11 | * @param 12 | * The type of the Maven object. 13 | */ 14 | class AbstractObjectValueConfigSource extends AbstractConfigSource { 15 | 16 | private final PrefixedObjectValueSource valueSource; 17 | private final Set propertyNames; 18 | 19 | private final Map properties = new HashMap<>(); 20 | 21 | AbstractObjectValueConfigSource(String name, T valueObject, String prefix, Collection propertyNames) { 22 | super(name, DEFAULT_ORDINAL); 23 | this.valueSource = new PrefixedObjectValueSource(prefix, valueObject); 24 | this.propertyNames = new HashSet<>(propertyNames); 25 | } 26 | 27 | @Override 28 | public final Set getPropertyNames() { 29 | return propertyNames; 30 | } 31 | 32 | @Override 33 | public String getValue(String property) { 34 | return properties.computeIfAbsent(property, key -> { 35 | Object value = valueSource.getValue(key); 36 | return value != null ? 37 | value.toString() 38 | .replace("\\", "\\\\") : 39 | null; 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/configuration/source/EmptyConfigSource.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.configuration.source; 2 | 3 | import java.util.Set; 4 | 5 | import lombok.NoArgsConstructor; 6 | import org.eclipse.microprofile.config.spi.ConfigSource; 7 | 8 | import static java.util.Collections.emptySet; 9 | import static lombok.AccessLevel.PRIVATE; 10 | 11 | /** 12 | * Empty config source which provides no properties. 13 | */ 14 | @NoArgsConstructor(access = PRIVATE) 15 | public final class EmptyConfigSource implements ConfigSource { 16 | 17 | public static final EmptyConfigSource INSTANCE = new EmptyConfigSource(); 18 | 19 | @Override 20 | public Set getPropertyNames() { 21 | return emptySet(); 22 | } 23 | 24 | @Override 25 | public String getValue(String s) { 26 | return null; 27 | } 28 | 29 | @Override 30 | public String getName() { 31 | return "Empty"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/configuration/source/MavenProjectConfigSource.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.configuration.source; 2 | 3 | import org.apache.maven.project.MavenProject; 4 | 5 | import static java.util.Arrays.asList; 6 | 7 | /** 8 | * Config source for a {@link MavenProject}. 9 | */ 10 | public class MavenProjectConfigSource extends AbstractObjectValueConfigSource { 11 | 12 | public MavenProjectConfigSource(MavenProject mavenProject) { 13 | super("Maven Project", mavenProject, "project", 14 | asList("project.name", "project.description", "project.groupId", "project.artifactId", "project.version", "project.packaging", "project.basedir", 15 | "project.build.sourceDirectory", "project.build.scriptSourceDirectory", "project.build.testSourceDirectory", "project.build.directory", 16 | "project.build.outputDirectory", "project.build.testOutputDirectory", "project.build.sourceEncoding", "project.build.finalName", 17 | "project.reporting.outputEncoding")); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/configuration/source/MavenPropertiesConfigSource.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.configuration.source; 2 | 3 | import java.util.Properties; 4 | import java.util.Set; 5 | 6 | import io.smallrye.config.common.AbstractConfigSource; 7 | 8 | /** 9 | * Config source for properties provided by Maven. 10 | */ 11 | public class MavenPropertiesConfigSource extends AbstractConfigSource { 12 | 13 | public static final int CONFIGURATION_ORDINAL_MAVEN_PROPERTIES = 90; 14 | 15 | private Properties properties; 16 | 17 | public MavenPropertiesConfigSource(Properties properties, String name) { 18 | super(name, CONFIGURATION_ORDINAL_MAVEN_PROPERTIES); 19 | this.properties = properties; 20 | } 21 | 22 | @Override 23 | public Set getPropertyNames() { 24 | return properties.stringPropertyNames(); 25 | } 26 | 27 | @Override 28 | public String getValue(String key) { 29 | return properties.getProperty(key); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/configuration/source/SettingsConfigSource.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.configuration.source; 2 | 3 | import org.apache.maven.settings.Settings; 4 | 5 | import static java.util.Arrays.asList; 6 | 7 | /** 8 | * Config source for Maven {@link Settings}. 9 | */ 10 | public class SettingsConfigSource extends AbstractObjectValueConfigSource { 11 | 12 | public SettingsConfigSource(Settings settings) { 13 | super("Maven Settings", settings, "settings", asList("settings.localRepository")); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/buschmais/jqassistant/scm/maven/provider/PluginRepositoryProvider.java: -------------------------------------------------------------------------------- 1 | package com.buschmais.jqassistant.scm.maven.provider; 2 | 3 | import com.buschmais.jqassistant.core.runtime.api.plugin.PluginClassLoader; 4 | import com.buschmais.jqassistant.core.runtime.api.plugin.PluginConfigurationReader; 5 | import com.buschmais.jqassistant.core.runtime.api.plugin.PluginRepository; 6 | import com.buschmais.jqassistant.core.runtime.api.plugin.PluginResolver; 7 | import com.buschmais.jqassistant.core.runtime.impl.plugin.PluginConfigurationReaderImpl; 8 | import com.buschmais.jqassistant.core.runtime.impl.plugin.PluginRepositoryImpl; 9 | import com.buschmais.jqassistant.core.runtime.impl.plugin.PluginResolverImpl; 10 | import com.buschmais.jqassistant.core.shared.artifact.ArtifactProvider; 11 | import com.buschmais.jqassistant.scm.maven.configuration.MavenConfiguration; 12 | 13 | import org.codehaus.plexus.component.annotations.Component; 14 | import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; 15 | 16 | @Component(role = PluginRepositoryProvider.class, instantiationStrategy = "singleton") 17 | public class PluginRepositoryProvider implements Disposable { 18 | 19 | private PluginRepository pluginRepository; 20 | 21 | @Override 22 | public void dispose() { 23 | if (this.pluginRepository != null) { 24 | this.pluginRepository.destroy(); 25 | } 26 | } 27 | 28 | public PluginRepository getPluginRepository(MavenConfiguration configuration, ArtifactProvider artifactProvider) { 29 | if (pluginRepository == null) { 30 | PluginResolver pluginResolver = new PluginResolverImpl(artifactProvider); 31 | PluginClassLoader pluginClassLoader = pluginResolver.createClassLoader(Thread.currentThread().getContextClassLoader(), configuration); 32 | 33 | // do a lazy init of the plugin repo to speed-up if the plugin execution shall be skipped 34 | PluginConfigurationReader pluginConfigurationReader = new PluginConfigurationReaderImpl(pluginClassLoader); 35 | this.pluginRepository = new PluginRepositoryImpl(pluginConfigurationReader); 36 | this.pluginRepository.initialize(); 37 | } 38 | return pluginRepository; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | scan 9 | analyze 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/maven/extension.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.buschmais.jqassistant 5 | com.buschmais.xo 6 | org.neo4j 7 | com.sun.jersey 8 | org.eclipse.jetty 9 | 10 | 11 | --------------------------------------------------------------------------------