├── .github
└── workflows
│ └── ci.yaml
├── .gitignore
├── .mvn
└── wrapper
│ └── maven-wrapper.properties
├── LICENSE.txt
├── README.markdown
├── jira
├── README.markdown
├── gmavenplus.doc
├── gmavenplus.html
├── gmavenplus.xls
├── gmavenplus.xml
└── gmavenplus_files
│ ├── batch.css
│ ├── batch.js
│ ├── com.atlassian.auiplugin-aui-experimental-labels.css
│ ├── com.atlassian.jira.jira-tzdetect-plugin-tzdetect-lib.js
│ ├── jira.webresources-global-static.css
│ ├── smile.gif
│ └── zip.gif
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
├── it
├── advancedCompile
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ ├── SomeClass.groovy
│ │ │ └── SomeOtherClass.gvy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── advancedExecute
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ │ └── resources
│ │ │ │ └── groovyScripts
│ │ │ │ ├── helloWorld.groovy
│ │ │ │ └── helloWorld2.groovy
│ │ └── test
│ │ │ └── java
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── TheTest.java
│ └── test.properties
├── advancedGenerateStubs
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ ├── SomeClass.groovy
│ │ │ └── SomeOtherClass.gvy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── advancedGroovydoc
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ ├── groovy
│ │ │ └── org
│ │ │ │ └── codehaus
│ │ │ │ └── gmavenplus
│ │ │ │ ├── SomeClass.groovy
│ │ │ │ └── SomeOtherClass.gvy
│ │ └── resources
│ │ │ └── stylesheet.css
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── astCompile
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
├── basicCompile
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
├── basicExecute
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── HelloWorld.groovy
│ │ └── test
│ │ └── java
│ │ └── TheTest.java
├── basicGenerateStubs
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
├── basicGroovydoc
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
├── basicGroovydocJar
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
├── cleanClasspathCompile
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── groovy
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClass.groovy
├── cleanClasspathGenerateStubs
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── groovy
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClass.groovy
├── configScriptCompile
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── conf
│ │ └── config.groovy
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── groovy
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.groovy
├── mavenPlugin
│ ├── invoker.properties
│ ├── module
│ │ └── pom.xml
│ ├── mojo
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ └── groovy
│ │ │ │ └── org
│ │ │ │ └── codehaus
│ │ │ │ └── gmavenplus
│ │ │ │ └── HelloWorldMojo.groovy
│ │ │ └── test
│ │ │ └── java
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── HelloWorldMojoTest.java
│ └── pom.xml
├── mixedCompile
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ ├── groovy
│ │ │ └── org
│ │ │ │ └── codehaus
│ │ │ │ └── gmavenplus
│ │ │ │ └── groovy
│ │ │ │ ├── Grandchild.groovy
│ │ │ │ └── Parent.groovy
│ │ └── java
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── java
│ │ │ └── Child.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── mixedCompile2
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ ├── groovy
│ │ │ └── org
│ │ │ │ └── codehaus
│ │ │ │ └── gmavenplus
│ │ │ │ └── groovy
│ │ │ │ └── Child.groovy
│ │ └── java
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── java
│ │ │ ├── Grandchild.java
│ │ │ └── Parent.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── mixedCompileCircular
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ ├── groovy
│ │ │ └── org
│ │ │ │ └── codehaus
│ │ │ │ └── gmavenplus
│ │ │ │ └── groovy
│ │ │ │ ├── GClass.g
│ │ │ │ └── GObject.g
│ │ └── java
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── java
│ │ │ ├── JClass.java
│ │ │ └── JObject.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── mixedCompileMultiModule
│ ├── groovyModule
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── groovy
│ │ │ └── Parent.groovy
│ ├── invoker.properties
│ ├── javaModule
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── java
│ │ │ └── Child.java
│ ├── pom.xml
│ └── src
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── mixedCompileMultiModule2
│ ├── groovyModule
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── groovy
│ │ │ └── Child.groovy
│ ├── invoker.properties
│ ├── javaModule
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── java
│ │ │ └── Parent.java
│ ├── pom.xml
│ └── src
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── mixedGroovydoc
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ ├── groovy
│ │ │ └── org
│ │ │ │ └── codehaus
│ │ │ │ └── gmavenplus
│ │ │ │ └── groovy
│ │ │ │ ├── Grandchild.groovy
│ │ │ │ └── Parent.groovy
│ │ └── java
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── java
│ │ │ └── Child.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── mixedGroovydoc2
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ ├── groovy
│ │ │ └── org
│ │ │ │ └── codehaus
│ │ │ │ └── gmavenplus
│ │ │ │ └── groovy
│ │ │ │ └── Child.groovy
│ │ ├── java
│ │ │ └── org
│ │ │ │ └── codehaus
│ │ │ │ └── gmavenplus
│ │ │ │ └── java
│ │ │ │ └── Parent.java
│ │ └── java2
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── java
│ │ │ └── Grandchild.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── TheTest.java
├── multimodulePluginAndProjectClasspath
│ ├── a
│ │ └── pom.xml
│ ├── b
│ │ └── pom.xml
│ ├── invoker.properties
│ └── pom.xml
├── multimodulePluginAndProjectClasspath2
│ ├── a
│ │ └── pom.xml
│ ├── b
│ │ └── pom.xml
│ ├── invoker.properties
│ └── pom.xml
├── multimodulePluginClasspath
│ ├── a
│ │ └── pom.xml
│ ├── b
│ │ └── pom.xml
│ ├── invoker.properties
│ └── pom.xml
├── multimoduleProjectClasspath
│ ├── a
│ │ └── pom.xml
│ ├── b
│ │ └── pom.xml
│ ├── invoker.properties
│ └── pom.xml
├── parametersCompile
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
├── pluginAndProjectClasspath
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
├── pluginClasspath
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
├── pom.xml
├── settings.xml
└── shadedGroovy
│ ├── invoker.properties
│ ├── pom.xml
│ ├── testModule
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── groovy
│ │ │ └── org
│ │ │ └── codehaus
│ │ │ └── gmavenplus
│ │ │ └── SomeClass.groovy
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── codehaus
│ │ └── gmavenplus
│ │ └── SomeClassTest.java
│ └── uberModule
│ └── pom.xml
├── main
└── java
│ └── org
│ └── codehaus
│ └── gmavenplus
│ ├── groovyworkarounds
│ ├── DotGroovyFile.java
│ ├── GroovyDocTemplateInfo.java
│ └── package-info.java
│ ├── model
│ ├── IncludeClasspath.java
│ ├── Link.java
│ ├── Scopes.java
│ ├── internal
│ │ ├── Version.java
│ │ └── package-info.java
│ └── package-info.java
│ ├── mojo
│ ├── AbstractCompileMojo.java
│ ├── AbstractGenerateStubsMojo.java
│ ├── AbstractGroovyDocMojo.java
│ ├── AbstractGroovyMojo.java
│ ├── AbstractGroovySourcesMojo.java
│ ├── AbstractGroovyStubSourcesMojo.java
│ ├── AbstractToolsMojo.java
│ ├── AddSourcesMojo.java
│ ├── AddStubSourcesMojo.java
│ ├── AddTestSourcesMojo.java
│ ├── AddTestStubSourcesMojo.java
│ ├── CompileMojo.java
│ ├── CompileTestsMojo.java
│ ├── ConsoleMojo.java
│ ├── ExecuteMojo.java
│ ├── GenerateStubsMojo.java
│ ├── GenerateTestStubsMojo.java
│ ├── GroovyDocJarMojo.java
│ ├── GroovyDocMojo.java
│ ├── GroovyDocTestsJarMojo.java
│ ├── GroovyDocTestsMojo.java
│ ├── RemoveStubsMojo.java
│ ├── RemoveTestStubsMojo.java
│ ├── ShellMojo.java
│ └── package-info.java
│ └── util
│ ├── ClassWrangler.java
│ ├── FileUtils.java
│ ├── NoExitSecurityManager.java
│ ├── ReflectionUtils.java
│ └── package-info.java
├── site
├── apt
│ └── index.apt.vm
├── resources
│ └── images
│ │ └── logos
│ │ ├── GMavenPlusLogo.png
│ │ └── GMavenPlusLogo_sm.png
└── site.xml
└── test
├── java
└── org
│ └── codehaus
│ └── gmavenplus
│ ├── groovyworkarounds
│ ├── DotGroovyFileTest.java
│ └── GroovyDocTemplateInfoTest.java
│ ├── model
│ ├── LinkTest.java
│ ├── ScopesTest.java
│ └── internal
│ │ └── VersionTest.java
│ ├── mojo
│ ├── AbstractCompileMojoTest.java
│ ├── AbstractGenerateStubsMojoTest.java
│ ├── AbstractGroovyDocMojoTest.java
│ ├── AbstractGroovyMojoTest.java
│ ├── AbstractGroovySourcesMojoTest.java
│ ├── AbstractGroovyStubSourcesMojoTest.java
│ ├── AbstractToolsMojoTest.java
│ ├── AddSourcesMojoTest.java
│ ├── AddStubSourcesMojoTest.java
│ ├── AddTestSourcesMojoTest.java
│ ├── AddTestStubSourcesMojoTest.java
│ ├── CompileMojoTest.java
│ ├── CompileTestsMojoTest.java
│ ├── ExecuteMojoTest.java
│ ├── GenerateStubsMojoTest.java
│ ├── GenerateTestStubsMojoTest.java
│ ├── GroovyDocMojoTest.java
│ ├── GroovyDocTestsMojoTest.java
│ ├── RemoveStubsMojoTest.java
│ └── RemoveTestStubsMojoTest.java
│ └── util
│ ├── ClassWranglerTest.java
│ ├── FileUtilsTest.java
│ └── ReflectionUtilsTest.java
└── resources
└── testScript.groovy
/.github/workflows/ci.yaml:
--------------------------------------------------------------------------------
1 | name: GitHub CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | pull_request:
8 | branches:
9 | - master
10 |
11 | env:
12 | MAVEN_OPTS: '-Xms2048m -Xmx2048m'
13 | MAVEN_ARGS: >-
14 | --show-version
15 | --errors
16 | --batch-mode
17 | --no-transfer-progress
18 | -Dinvoker.streamLogsOnFailures=true
19 | -Dgpg.skip=true
20 |
21 | defaults:
22 | run:
23 | shell: 'bash -o errexit -o nounset -o pipefail {0}'
24 |
25 | jobs:
26 | ci:
27 | runs-on: ubuntu-latest
28 | strategy:
29 | matrix:
30 | groovy-version:
31 | - 2.5.23
32 | - 3.0.24
33 | - 4.0.26
34 | - 5.0.0-alpha-12
35 | env:
36 | MVN_GROOVY_GROUP_ID: ${{format('{0}{1}', '-DgroovyVersion=', matrix.groovy-version)}}
37 | MVN_GROOVY_VERSION: ${{(startsWith(matrix.groovy-version, '2') || startsWith(matrix.groovy-version, '3')) && '-DgroovyGroupId=org.codehaus.groovy' || '-DgroovyGroupId=org.apache.groovy'}}
38 | steps:
39 | - name: checkout
40 | uses: actions/checkout@v4
41 | - name: jdk setup
42 | uses: actions/setup-java@v3
43 | with:
44 | distribution: temurin
45 | java-version: 17
46 | - name: full test
47 | run: >-
48 | ./mvnw ${MAVEN_ARGS} ${MVN_GROOVY_GROUP_ID} ${MVN_GROOVY_VERSION}
49 | clean install invoker:install invoker:run
50 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Maven
2 | target
3 |
4 | # Eclipse
5 | .factorypath
6 | .settings
7 | *.classpath
8 | *.project
9 | bin
10 |
11 | # Jetbrains
12 | *.iml
13 | *.ipr
14 | *.iws
15 | .idea
16 | out
17 |
18 | # Sonar
19 | .sonar
20 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright 2011 Keegan Witt
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/README.markdown:
--------------------------------------------------------------------------------
1 | # GMavenPlus Plugin #
2 |
3 | ## Introduction ##
4 | GMavenPlus is a rewrite of [GMaven](https://github.com/groovy/gmaven), a [Maven](https://maven.apache.org/) plugin that allows you to integrate [Groovy](https://groovy-lang.org/) into your Maven projects.
5 |
6 | You should find everything you need to know about its use in the [wiki](https://github.com/groovy/GMavenPlus/wiki). For more information, check out the [Maven site](https://groovy.github.io/GMavenPlus/index.html).
7 |
8 | ---
9 | 
10 |
--------------------------------------------------------------------------------
/jira/README.markdown:
--------------------------------------------------------------------------------
1 | #Archived Jiras#
2 |
3 | This is a dump of the Codehaus [GMavenPlus Jiras](http://jira.codehaus.org/browse/GMAVENPLUS).
4 | These are here for reference since Codehaus shut down. New issues should be reported on GitHub.
5 |
--------------------------------------------------------------------------------
/jira/gmavenplus.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/groovy/GMavenPlus/70a5c84e5781fd3daad6d28cdb67f33be27cbdd3/jira/gmavenplus.html
--------------------------------------------------------------------------------
/jira/gmavenplus_files/smile.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/groovy/GMavenPlus/70a5c84e5781fd3daad6d28cdb67f33be27cbdd3/jira/gmavenplus_files/smile.gif
--------------------------------------------------------------------------------
/jira/gmavenplus_files/zip.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/groovy/GMavenPlus/70a5c84e5781fd3daad6d28cdb67f33be27cbdd3/jira/gmavenplus_files/zip.gif
--------------------------------------------------------------------------------
/src/it/advancedCompile/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/advancedCompile/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-advancedCompile
15 | GMavenPlus Plugin Advanced Compile Test
16 | The kitchen sink of compile use cases.
17 |
18 |
19 | 1.8
20 |
21 |
22 |
23 |
24 | junit
25 | junit
26 |
27 |
28 | @groovyGroupId@
29 | groovy
30 |
31 |
32 |
33 |
34 |
35 |
36 | org.codehaus.gmavenplus
37 | gmavenplus-plugin
38 |
39 |
40 |
41 | compile
42 |
43 |
44 |
45 |
46 |
47 |
48 | ${project.basedir}/src/main/groovy
49 |
50 | **/*.groovy
51 | **/*.gvy
52 |
53 |
54 |
55 | UTF-8
56 | true
57 | 0
58 | 0
59 |
60 |
61 |
62 | org.apache.maven.plugins
63 | maven-compiler-plugin
64 |
65 |
66 | org.apache.maven.plugins
67 | maven-surefire-plugin
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/src/it/advancedCompile/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeClass {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/advancedCompile/src/main/groovy/org/codehaus/gmavenplus/SomeOtherClass.gvy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeOtherClass {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/advancedCompile/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 |
23 | public class TheTest {
24 |
25 | @Test
26 | public void testSomeMethod() {
27 | SomeClass someClass = new SomeClass();
28 | Assert.assertEquals("Hello, world.", someClass.someMethod());
29 | }
30 |
31 | @Test
32 | public void testSomeMethod2() {
33 | SomeOtherClass someOtherClass = new SomeOtherClass();
34 | Assert.assertEquals("Hello, world.", someOtherClass.someMethod());
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/it/advancedExecute/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/advancedExecute/src/main/resources/groovyScripts/helloWorld.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | File targetDir = new File('target')
19 | if (!targetDir.exists())
20 | targetDir.mkdir()
21 | new File('target/helloWorld.txt').append('Hello world!')
22 |
--------------------------------------------------------------------------------
/src/it/advancedExecute/src/main/resources/groovyScripts/helloWorld2.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | File targetDir = new File('target')
19 | if (!targetDir.exists())
20 | targetDir.mkdir()
21 | new File('target/helloWorld2.txt').append('Hello world 2!')
22 |
--------------------------------------------------------------------------------
/src/it/advancedExecute/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void test1() {
29 | File fileFromScript = new File("target/helloWorld.txt");
30 | Assert.assertTrue(fileFromScript.exists());
31 | Assert.assertTrue(fileFromScript.length() > 0);
32 | }
33 |
34 | @Test
35 | public void test2() {
36 | File fileFromScript = new File("target/helloWorld2.txt");
37 | Assert.assertTrue(fileFromScript.exists());
38 | Assert.assertTrue(fileFromScript.length() > 0);
39 | }
40 |
41 | @Test
42 | public void test3() {
43 | File fileFromScript = new File("target/javaVersion.txt");
44 | Assert.assertTrue(fileFromScript.exists());
45 | Assert.assertTrue(fileFromScript.length() > 0);
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/it/advancedExecute/test.properties:
--------------------------------------------------------------------------------
1 | cliProp=someOtherValue
2 |
--------------------------------------------------------------------------------
/src/it/advancedGenerateStubs/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/advancedGenerateStubs/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-advancedGenerateStubs
15 | GMavenPlus Plugin Advanced Generate Stubs Test
16 | The kitchen sink of stub generation use cases. This will fail for all versions of Groovy before
17 | 1.8.2.
18 |
19 |
20 |
21 |
22 | junit
23 | junit
24 |
25 |
26 | @groovyGroupId@
27 | groovy
28 |
29 |
30 |
31 |
32 |
33 |
34 | org.codehaus.gmavenplus
35 | gmavenplus-plugin
36 |
37 |
38 |
39 | generateStubs
40 | removeStubs
41 |
42 |
43 |
44 |
45 |
46 |
47 | ${project.basedir}/src/main/groovy
48 |
49 | **/*.groovy
50 | **/*.gvy
51 |
52 |
53 |
54 |
55 |
56 |
57 | org.apache.maven.plugins
58 | maven-compiler-plugin
59 |
60 |
61 | org.apache.maven.plugins
62 | maven-surefire-plugin
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/src/it/advancedGenerateStubs/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeClass {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/advancedGenerateStubs/src/main/groovy/org/codehaus/gmavenplus/SomeOtherClass.gvy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeOtherClass {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/advancedGenerateStubs/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void testSomeClassExists() {
29 | File generatedStub = new File("target/generated-sources/groovy-stubs/main/org/codehaus/gmavenplus/SomeClass.java");
30 | Assert.assertTrue(generatedStub + " does not exist.", generatedStub.exists());
31 | Assert.assertTrue(generatedStub + " is empty.", generatedStub.length() > 0);
32 | }
33 |
34 | @Test
35 | public void testSomeOtherClassExists() {
36 | File generatedStub = new File("target/generated-sources/groovy-stubs/main/org/codehaus/gmavenplus/SomeOtherClass.java");
37 | Assert.assertTrue(generatedStub + " does not exist.", generatedStub.exists());
38 | Assert.assertTrue(generatedStub + " is empty.", generatedStub.length() > 0);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/it/advancedGroovydoc/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/advancedGroovydoc/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | /**
21 | * Some Example Cass
22 | *
23 | * @author Keegan Witt
24 | * @version super awesome
25 | */
26 | class SomeClass {
27 |
28 | /**
29 | * This method does absolutely nothing
30 | * @param unusedParam a useless parameter
31 | */
32 | void doNothing(String unusedParam) {}
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/it/advancedGroovydoc/src/main/groovy/org/codehaus/gmavenplus/SomeOtherClass.gvy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | /**
21 | * Some Other Example Cass
22 | *
23 | * @author Keegan Witt
24 | * @version super awesome
25 | */
26 | class SomeOtherClass {
27 |
28 | /**
29 | * A method that returns a string.
30 | *
31 | * @return a string
32 | */
33 | String someMethod() {
34 | return "Hello, world."
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/it/astCompile/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/astCompile/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-astCompile
15 | testing
16 | GMavenPlus Plugin AST Compile Test
17 | A test of an AST transformation. This will fail for all Groovy versions before 1.6-beta-2.
18 |
19 |
20 |
21 |
22 | junit
23 | junit
24 |
25 |
26 | @groovyGroupId@
27 | groovy
28 |
29 |
30 |
31 |
32 |
33 |
34 | org.codehaus.gmavenplus
35 | gmavenplus-plugin
36 |
37 |
38 |
39 | compile
40 |
41 |
42 |
43 |
44 |
45 | org.apache.maven.plugins
46 | maven-compiler-plugin
47 |
48 |
49 | org.apache.maven.plugins
50 | maven-surefire-plugin
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/it/astCompile/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeClass {
21 | @Lazy
22 | def list = ["dog", "cat"]
23 |
24 | def someMethod() {
25 | return list.toString()
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/astCompile/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 |
23 | public class SomeClassTest {
24 |
25 | @Test
26 | public void testSomeMethod() {
27 | SomeClass someClass = new SomeClass();
28 | Assert.assertEquals("[dog, cat]", someClass.someMethod().toString());
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/basicCompile/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/basicCompile/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-basicCompile
15 | testing
16 | GMavenPlus Plugin Basic Compile Test
17 | The simplest compile use case.
18 |
19 |
20 |
21 | junit
22 | junit
23 |
24 |
25 | @groovyGroupId@
26 | groovy
27 |
28 |
29 |
30 |
31 |
32 |
33 | org.codehaus.gmavenplus
34 | gmavenplus-plugin
35 |
36 |
37 |
38 | compile
39 |
40 |
41 |
42 |
43 |
44 | org.apache.maven.plugins
45 | maven-compiler-plugin
46 |
47 |
48 | org.apache.maven.plugins
49 | maven-surefire-plugin
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/it/basicCompile/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 | import groovy.transform.Canonical
20 | import groovy.transform.CompileStatic
21 |
22 |
23 | @Canonical
24 | @CompileStatic
25 | class SomeClass {
26 |
27 | String someMethod() {
28 | return "Hello, world."
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/basicCompile/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 |
23 | public class SomeClassTest {
24 |
25 | @Test
26 | public void testSomeMethod() {
27 | SomeClass someClass = new SomeClass();
28 | Assert.assertEquals("Hello, world.", someClass.someMethod());
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/basicExecute/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/basicExecute/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-basicExecute
15 | testing
16 | GMavenPlus Plugin Execute Test
17 |
18 |
19 |
20 | junit
21 | junit
22 |
23 |
24 |
25 |
26 |
27 |
28 | org.codehaus.gmavenplus
29 | gmavenplus-plugin
30 |
31 |
32 | generate-test-sources
33 |
34 | execute
35 |
36 |
37 |
38 |
39 |
40 |
48 |
49 |
50 |
51 |
52 | @groovyGroupId@
53 | groovy
54 | @groovyVersion@
55 |
56 |
57 | @groovyGroupId@
58 | groovy-ant
59 | @groovyVersion@
60 |
61 |
62 |
63 |
64 | org.apache.maven.plugins
65 | maven-compiler-plugin
66 |
67 |
68 | org.apache.maven.plugins
69 | maven-surefire-plugin
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/src/it/basicExecute/src/main/groovy/HelloWorld.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | File targetDir = new File('target')
19 | if (!targetDir.exists())
20 | targetDir.mkdir()
21 | new File('target/helloWorld.txt').append('Hello world!')
22 |
--------------------------------------------------------------------------------
/src/it/basicExecute/src/test/java/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void test() {
29 | File fileFromScript = new File("target/helloWorld.txt");
30 | Assert.assertTrue(fileFromScript.exists());
31 | Assert.assertTrue(fileFromScript.length() > 0);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/it/basicGenerateStubs/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/basicGenerateStubs/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-basicGenerateStubs
15 | testing
16 | GMavenPlus Plugin Basic Generate Stubs Test
17 | The simplest generate stubs use case. This will fail for all versions of Groovy before 1.8.2.
18 |
19 |
20 |
21 |
22 | junit
23 | junit
24 |
25 |
26 | @groovyGroupId@
27 | groovy
28 |
29 |
30 |
31 |
32 |
33 |
34 | org.codehaus.gmavenplus
35 | gmavenplus-plugin
36 |
37 |
38 |
39 | generateStubs
40 |
41 |
42 |
43 |
44 |
45 | org.apache.maven.plugins
46 | maven-compiler-plugin
47 |
48 |
49 | org.apache.maven.plugins
50 | maven-surefire-plugin
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/it/basicGenerateStubs/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeClass {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/basicGenerateStubs/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class SomeClassTest {
26 |
27 | @Test
28 | public void testSomeClassStubExists() {
29 | File generatedStub = new File("target/generated-sources/groovy-stubs/main/org/codehaus/gmavenplus/SomeClass.java");
30 | Assert.assertTrue(generatedStub + " does not exist.", generatedStub.exists());
31 | Assert.assertTrue(generatedStub + " is empty.", generatedStub.length() > 0);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/it/basicGroovydoc/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/basicGroovydoc/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-basicGroovyDoc
15 | testing
16 | GMavenPlus Plugin Basic GroovyDoc Test
17 | The simplest GroovyDoc use case. This will fail for Groovy 1.5.8 and 1.6-RC-1.
18 |
19 |
20 |
21 | junit
22 | junit
23 |
24 |
25 | @groovyGroupId@
26 | groovy
27 |
28 |
29 | @groovyGroupId@
30 | groovy-groovydoc
31 |
32 |
33 |
34 |
35 |
36 |
37 | org.codehaus.gmavenplus
38 | gmavenplus-plugin
39 |
40 |
41 | generate-test-sources
42 |
43 | groovydoc
44 |
45 |
46 |
47 |
48 |
49 | org.apache.maven.plugins
50 | maven-compiler-plugin
51 |
52 |
53 | org.apache.maven.plugins
54 | maven-surefire-plugin
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/src/it/basicGroovydoc/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | /**
21 | * Some Example Cass
22 | *
23 | * @author Keegan Witt
24 | * @version super awesome
25 | */
26 | class SomeClass {
27 |
28 | /**
29 | * This method does absolutely nothing
30 | * @param unusedParam a useless parameter
31 | */
32 | void doNothing(String unusedParam) {}
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/it/basicGroovydoc/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class SomeClassTest {
26 |
27 | @Test
28 | public void testSomeClassExists() {
29 | File generatedGroovyDoc = new File("target/gapidocs/org/codehaus/gmavenplus/SomeClass.html");
30 | Assert.assertTrue(generatedGroovyDoc + " does not exist.", generatedGroovyDoc.exists());
31 | Assert.assertTrue(generatedGroovyDoc + " is empty.", generatedGroovyDoc.length() > 0);
32 | }
33 |
34 | @Test
35 | public void testOverviewSummaryExists() {
36 | File generatedGroovyDoc = new File("target/gapidocs/overview-summary.html");
37 | Assert.assertTrue(generatedGroovyDoc + " does not exist.", generatedGroovyDoc.exists());
38 | Assert.assertTrue(generatedGroovyDoc + " is empty.", generatedGroovyDoc.length() > 0);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/it/basicGroovydocJar/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/basicGroovydocJar/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-basicGroovyDocJar
15 | testing
16 | GMavenPlus Plugin Basic GroovyDoc Jar Test
17 | The simplest GroovyDoc Jar use case. This will fail for Groovy 1.5.8 and 1.6-RC-1.
18 |
19 |
20 |
21 | junit
22 | junit
23 |
24 |
25 | @groovyGroupId@
26 | groovy
27 |
28 |
29 | @groovyGroupId@
30 | groovy-groovydoc
31 |
32 |
33 | @groovyGroupId@
34 | groovy-templates
35 |
36 |
37 |
38 |
39 |
40 |
41 | org.codehaus.gmavenplus
42 | gmavenplus-plugin
43 |
44 |
45 | generate-test-sources
46 |
47 | groovydoc-jar
48 |
49 |
50 |
51 |
52 |
53 | org.apache.maven.plugins
54 | maven-compiler-plugin
55 |
56 |
57 | org.apache.maven.plugins
58 | maven-surefire-plugin
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/src/it/basicGroovydocJar/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | /**
21 | * Some Example Cass
22 | *
23 | * @author Keegan Witt
24 | * @version super awesome
25 | */
26 | class SomeClass {
27 |
28 | /**
29 | * This method does absolutely nothing
30 | * @param unusedParam a useless parameter
31 | */
32 | void doNothing(String unusedParam) {}
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/it/basicGroovydocJar/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.IOException;
23 | import java.util.Enumeration;
24 | import java.util.zip.ZipEntry;
25 | import java.util.zip.ZipFile;
26 |
27 |
28 | public class SomeClassTest {
29 |
30 | @Test
31 | public void testGroovyDocExists() {
32 | boolean foundGroovydocDir = false;
33 | ZipFile zipFile = null;
34 | try {
35 | zipFile = new ZipFile("target/gmavenplus-plugin-it-basicGroovyDocJar-testing-groovydoc.jar");
36 | Enumeration extends ZipEntry> e = zipFile.entries();
37 | while (e.hasMoreElements()) {
38 | ZipEntry entry = e.nextElement();
39 | String entryName = entry.getName();
40 | if ("org/codehaus/gmavenplus/SomeClass.html".equals(entryName)) {
41 | foundGroovydocDir = true;
42 | break;
43 | }
44 | }
45 | } catch (IOException ioe) {
46 | System.err.println("Error opening zip file" + ioe);
47 | } finally {
48 | try {
49 | if (zipFile != null) {
50 | zipFile.close();
51 | }
52 | } catch (IOException ioe) {
53 | System.out.println("Error while closing zip file" + ioe);
54 | }
55 | }
56 | Assert.assertTrue(foundGroovydocDir);
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/it/cleanClasspathCompile/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean compile -Dmaven.plugin.validation=verbose
2 | invoker.buildResult=failure
3 | #invoker.debug = true
4 |
--------------------------------------------------------------------------------
/src/it/cleanClasspathCompile/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-cleanClasspathCompile
15 | testing
16 | GMavenPlus Plugin Clean Classpath Compile Test
17 | The simplest compile use case where it would fail if the classpath were polluted with the plugin
18 | classpath.
19 |
20 |
21 |
22 |
23 | junit
24 | junit
25 |
26 |
27 | @groovyGroupId@
28 | groovy
29 |
30 |
31 |
32 |
33 |
34 |
35 | org.codehaus.gmavenplus
36 | gmavenplus-plugin
37 |
38 |
39 |
40 | compile
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/src/it/cleanClasspathCompile/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 | import org.apache.maven.project.MavenProject
20 |
21 |
22 | class SomeClass {
23 |
24 | String someMethod(MavenProject project) {
25 | return 'Hello, world.'
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/cleanClasspathGenerateStubs/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean compile -Dmaven.plugin.validation=verbose
2 | invoker.buildResult=failure
3 | #invoker.debug = true
4 |
--------------------------------------------------------------------------------
/src/it/cleanClasspathGenerateStubs/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-cleanClasspathGenerateStubs
15 | testing
16 | GMavenPlus Plugin Clean Classpath Generate Stubs Test
17 | The simplest generate stubs use case where it would fail if the classpath were polluted with the plugin
18 | classpath. This will fail for all versions of Groovy before 1.8.2.
19 |
20 |
21 |
22 |
23 | junit
24 | junit
25 |
26 |
27 | @groovyGroupId@
28 | groovy
29 |
30 |
31 |
32 |
33 |
34 |
35 | org.codehaus.gmavenplus
36 | gmavenplus-plugin
37 |
38 |
39 |
40 | generateStubs
41 | removeStubs
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/it/cleanClasspathGenerateStubs/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 | import org.apache.maven.project.MavenProject
20 |
21 |
22 | class SomeClass {
23 |
24 | String someMethod(MavenProject project) {
25 | return 'Hello, world.'
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/configScriptCompile/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/configScriptCompile/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-configScriptCompile
15 | testing
16 | GMavenPlus Plugin Configuration Script Compile Test
17 | The simplest compile use case with a configuration script. This will fail for all Groovy versions
18 | before 2.1.0-rc-2.
19 |
20 |
21 |
22 |
23 | junit
24 | junit
25 |
26 |
27 | @groovyGroupId@
28 | groovy
29 |
30 |
31 |
32 |
33 |
34 |
35 | org.codehaus.gmavenplus
36 | gmavenplus-plugin
37 |
38 |
39 |
40 | compile
41 | compileTests
42 |
43 |
44 |
45 |
46 | src/conf/config.groovy
47 |
48 |
49 |
50 | org.apache.maven.plugins
51 | maven-compiler-plugin
52 |
53 |
54 | org.apache.maven.plugins
55 | maven-surefire-plugin
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/src/it/configScriptCompile/src/conf/config.groovy:
--------------------------------------------------------------------------------
1 | withConfig(configuration) {
2 | ast(groovy.transform.CompileStatic)
3 | }
4 |
--------------------------------------------------------------------------------
/src/it/configScriptCompile/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeClass {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/configScriptCompile/src/test/groovy/org/codehaus/gmavenplus/SomeClassTest.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 | import groovy.transform.CompileStatic
20 | import groovy.transform.TypeCheckingMode
21 | import org.junit.Assert
22 | import org.junit.Before
23 | import org.junit.Test
24 |
25 |
26 | class SomeClassTest {
27 | SomeClass someClass
28 |
29 | @Before
30 | @CompileStatic(TypeCheckingMode.SKIP)
31 | void setup() {
32 | someClass = new SomeClass()
33 | someClass.metaClass.someMethod = { "Goodbye, world." }
34 | }
35 |
36 | @Test
37 | void testSomeMethod() {
38 | Assert.assertEquals("Hello, world.", someClass.someMethod())
39 | }
40 |
41 | @Test
42 | @CompileStatic(TypeCheckingMode.SKIP)
43 | void testSomeMethodNoCheck() {
44 | Assert.assertEquals("Goodbye, world.", someClass.someMethod())
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/it/mavenPlugin/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean install -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/mavenPlugin/module/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 |
7 | org.codehaus.gmavenplus
8 | gmavenplus-plugin-it-mavenPlugin
9 | testing
10 |
11 |
12 | gmavenplus-plugin-it-mavenPlugin-Module
13 | GMavenPlus Plugin Maven Plugin Test Mojo Test
14 |
15 |
16 |
17 |
18 | org.codehaus.gmavenplus
19 | gmavenplus-plugin-it-mavenPlugin-Mojo
20 | testing
21 |
22 |
23 | install
24 |
25 | helloworld
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/it/mavenPlugin/mojo/src/main/groovy/org/codehaus/gmavenplus/HelloWorldMojo.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 | import org.apache.maven.plugin.AbstractMojo
20 | import org.apache.maven.plugins.annotations.LifecyclePhase
21 | import org.apache.maven.plugins.annotations.Mojo
22 |
23 |
24 | @Mojo(name = "helloworld", defaultPhase = LifecyclePhase.INSTALL)
25 | class HelloWorldMojo extends AbstractMojo {
26 |
27 | void execute() {
28 | getLog().error("Hello world!")
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/mavenPlugin/mojo/src/test/java/org/codehaus/gmavenplus/HelloWorldMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Test;
20 |
21 |
22 | public class HelloWorldMojoTest {
23 | private HelloWorldMojo mojo = new HelloWorldMojo();
24 |
25 | @Test
26 | public void testExecute() {
27 | // not really testing anything here, other than it doesn't unexpectedly blow up
28 | mojo.execute();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/mavenPlugin/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 |
7 | org.codehaus.gmavenplus
8 | gmavenplus-plugin-it-root
9 | testing
10 | ../pom.xml
11 |
12 |
13 | gmavenplus-plugin-it-mavenPlugin
14 | testing
15 | pom
16 | GMavenPlus Plugin Configuration Maven Plugin Test
17 |
18 |
19 | mojo
20 | module
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/it/mixedCompile/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/mixedCompile/src/main/groovy/org/codehaus/gmavenplus/groovy/Grandchild.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 | import org.codehaus.gmavenplus.java.Child
20 |
21 |
22 | class Grandchild extends Child {
23 |
24 | String yetAnotherMethod() {
25 | return someMethod()
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mixedCompile/src/main/groovy/org/codehaus/gmavenplus/groovy/Parent.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 |
20 | class Parent {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/mixedCompile/src/main/java/org/codehaus/gmavenplus/java/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.java;
18 |
19 | import org.codehaus.gmavenplus.groovy.Parent;
20 |
21 |
22 | public class Child extends Parent {
23 |
24 | public String someOtherMethod() {
25 | return someMethod();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mixedCompile/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.codehaus.gmavenplus.groovy.*;
20 | import org.codehaus.gmavenplus.java.*;
21 | import org.junit.Assert;
22 | import org.junit.Test;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void testYetAnotherMethod() {
29 | Grandchild grandchild = new Grandchild();
30 | Assert.assertEquals("Hello, world.", grandchild.yetAnotherMethod());
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/it/mixedCompile2/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/mixedCompile2/src/main/groovy/org/codehaus/gmavenplus/groovy/Child.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 | import org.codehaus.gmavenplus.java.Parent
20 |
21 |
22 | class Child extends Parent {
23 |
24 | String someOtherMethod() {
25 | someMethod()
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mixedCompile2/src/main/java/org/codehaus/gmavenplus/java/Grandchild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.codehaus.gmavenplus.groovy.Child;
20 |
21 |
22 | public class Grandchild extends Child {
23 |
24 | public String yetAnotherMethod() {
25 | return someMethod();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mixedCompile2/src/main/java/org/codehaus/gmavenplus/java/Parent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.java;
18 |
19 |
20 | public class Parent {
21 |
22 | public String someMethod() {
23 | return "Hello, world.";
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/mixedCompile2/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.codehaus.gmavenplus.groovy.*;
20 | import org.codehaus.gmavenplus.java.*;
21 | import org.junit.Assert;
22 | import org.junit.Test;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void testYetAnotherMethod() {
29 | Grandchild grandchild = new Grandchild();
30 | Assert.assertEquals("Hello, world.", grandchild.yetAnotherMethod());
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/it/mixedCompileCircular/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/mixedCompileCircular/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-mixedCompileCircular
15 | testing
16 | GMavenPlus Plugin Mixed Circular Compile Test
17 | This tests mixed Java/Groovy compilation with a circular dependency between Java and Groovy classes.
18 | This will fail for all versions of Groovy before 1.8.2.
19 |
20 |
21 |
22 |
23 | junit
24 | junit
25 |
26 |
27 | @groovyGroupId@
28 | groovy
29 |
30 |
31 |
32 |
33 |
34 |
35 | org.codehaus.gmavenplus
36 | gmavenplus-plugin
37 |
38 |
39 |
40 | generateStubs
41 | compile
42 |
43 |
44 |
45 |
46 | ${project.basedir}/src/main/groovy
47 |
48 | **/*.g
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | org.apache.maven.plugins
58 | maven-compiler-plugin
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/src/it/mixedCompileCircular/src/main/groovy/org/codehaus/gmavenplus/groovy/GClass.g:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 | import org.codehaus.gmavenplus.java.JObject
20 |
21 |
22 | class GClass {
23 | GObject gObject = new GObject()
24 | JObject jObject = new JObject()
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/mixedCompileCircular/src/main/groovy/org/codehaus/gmavenplus/groovy/GObject.g:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 | import org.codehaus.gmavenplus.java.JObject
20 |
21 |
22 | class GObject { }
23 |
--------------------------------------------------------------------------------
/src/it/mixedCompileCircular/src/main/java/org/codehaus/gmavenplus/java/JClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.java;
18 |
19 | import org.codehaus.gmavenplus.groovy.GObject;
20 |
21 |
22 | public class JClass {
23 | private GObject gObject = new GObject();
24 | private JObject jObject = new JObject();
25 |
26 | public GObject getgObject() {
27 | return gObject;
28 | }
29 |
30 | public void setgObject(GObject gObject) {
31 | this.gObject = gObject;
32 | }
33 |
34 | public JObject getjObject() {
35 | return jObject;
36 | }
37 |
38 | public void setjObject(JObject jObject) {
39 | this.jObject = jObject;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/it/mixedCompileCircular/src/main/java/org/codehaus/gmavenplus/java/JObject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.java;
18 |
19 |
20 | public class JObject {
21 | }
22 |
--------------------------------------------------------------------------------
/src/it/mixedCompileCircular/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.codehaus.gmavenplus.groovy.*;
20 | import org.codehaus.gmavenplus.java.*;
21 | import org.junit.Assert;
22 | import org.junit.Test;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void testYetAnotherMethod() {
29 | JClass jClass = new JClass();
30 | GClass gClass = new GClass();
31 | Assert.assertNotNull(jClass.getgObject());
32 | Assert.assertNotNull(jClass.getjObject());
33 | Assert.assertNotNull(gClass.getgObject());
34 | Assert.assertNotNull(gClass.getjObject());
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule/groovyModule/src/main/groovy/org/codehaus/gmavenplus/groovy/Parent.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 |
20 | class Parent {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule/javaModule/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-mixedCompileMultiModule
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-mixedCompileMultiModule-javaModule
15 | testing
16 | GMavenPlus Plugin Mixed Compile MultiModule Test Java Module
17 |
18 |
19 |
20 | junit
21 | junit
22 |
23 |
24 | org.codehaus.gmavenplus
25 | gmavenplus-plugin-it-mixedCompileMultiModule-groovyModule
26 |
27 |
28 | @groovyGroupId@
29 | groovy
30 |
31 |
32 |
33 |
34 |
35 |
36 | org.apache.maven.plugins
37 | maven-compiler-plugin
38 |
39 |
40 | org.apache.maven.plugins
41 | maven-surefire-plugin
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule/javaModule/src/main/java/org/codehaus/gmavenplus/java/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.java;
18 |
19 | import org.codehaus.gmavenplus.groovy.Parent;
20 |
21 |
22 | public class Child extends Parent {
23 |
24 | public String someOtherMethod() {
25 | return someMethod();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-mixedCompileMultiModule
15 | testing
16 | pom
17 | GMavenPlus Plugin Mixed Compile MultiModule Test
18 | This tests mixed Java/Groovy compilation across modules. This will fail for all versions of Groovy
19 | before 1.8.2.
20 |
21 |
22 |
23 |
24 |
25 | org.codehaus.gmavenplus
26 | gmavenplus-plugin-it-mixedCompileMultiModule-groovyModule
27 | ${project.version}
28 |
29 |
30 | org.codehaus.gmavenplus
31 | gmavenplus-plugin-it-mixedCompileMultiModule-javaModule
32 | ${project.version}
33 |
34 |
35 |
36 |
37 |
38 | groovyModule
39 | javaModule
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.codehaus.gmavenplus.groovy.*;
20 | import org.codehaus.gmavenplus.java.*;
21 | import org.junit.Assert;
22 | import org.junit.Test;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void testAnotherMethod() {
29 | Child child = new Child();
30 | Assert.assertEquals("Hello, world.", child.someOtherMethod());
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule2/groovyModule/src/main/groovy/org/codehaus/gmavenplus/groovy/Child.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 | import org.codehaus.gmavenplus.java.Parent
20 |
21 |
22 | class Child extends Parent {
23 |
24 | String someOtherMethod() {
25 | someMethod()
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule2/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule2/javaModule/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-mixedCompileMultiModule2
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-mixedCompileMultiModule-javaModule2
15 | testing
16 | GMavenPlus Plugin Mixed Compile MultiModule Test Java Module 2
17 |
18 |
19 |
20 | junit
21 | junit
22 |
23 |
24 | @groovyGroupId@
25 | groovy
26 |
27 |
28 |
29 |
30 |
31 |
32 | org.apache.maven.plugins
33 | maven-compiler-plugin
34 |
35 |
36 | org.apache.maven.plugins
37 | maven-surefire-plugin
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule2/javaModule/src/main/java/org/codehaus/gmavenplus/java/Parent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.java;
18 |
19 |
20 | public class Parent {
21 |
22 | public String someMethod() {
23 | return "Hello, world.";
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-mixedCompileMultiModule2
15 | testing
16 | pom
17 | GMavenPlus Plugin Mixed Compile MultiModule Test 2
18 | This tests mixed Java/Groovy compilation across modules. This will fail for all versions of Groovy
19 | before 1.8.2.
20 |
21 |
22 |
23 |
24 |
25 | org.codehaus.gmavenplus
26 | gmavenplus-plugin-it-mixedCompileMultiModule-groovyModule2
27 | ${project.version}
28 |
29 |
30 | org.codehaus.gmavenplus
31 | gmavenplus-plugin-it-mixedCompileMultiModule-javaModule2
32 | ${project.version}
33 |
34 |
35 |
36 |
37 |
38 | groovyModule
39 | javaModule
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/it/mixedCompileMultiModule2/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.codehaus.gmavenplus.groovy.*;
20 | import org.codehaus.gmavenplus.java.*;
21 | import org.junit.Assert;
22 | import org.junit.Test;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void testAnotherMethod() {
29 | Child child = new Child();
30 | Assert.assertEquals("Hello, world.", child.someOtherMethod());
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-mixedGroovyDoc
15 | testing
16 | GMavenPlus Plugin Mixed GroovyDoc Test
17 | This tests mixed Java/Groovy GroovyDoc generation. This will fail for all versions of Groovy before
18 | 1.8.2.
19 |
20 |
21 |
22 |
23 | junit
24 | junit
25 |
26 |
27 | @groovyGroupId@
28 | groovy
29 |
30 |
31 | @groovyGroupId@
32 | groovy-groovydoc
33 |
34 |
35 |
36 |
37 |
38 |
39 | org.codehaus.gmavenplus
40 | gmavenplus-plugin
41 |
42 |
43 | groovyDoc
44 | generate-sources
45 |
46 | generateStubs
47 | groovydoc
48 |
49 |
50 |
51 | removeStubs
52 | test
53 |
54 | removeStubs
55 |
56 |
57 |
58 |
59 |
60 | org.apache.maven.plugins
61 | maven-compiler-plugin
62 |
63 |
64 | org.apache.maven.plugins
65 | maven-surefire-plugin
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc/src/main/groovy/org/codehaus/gmavenplus/groovy/Grandchild.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 | import org.codehaus.gmavenplus.java.Child
20 |
21 |
22 | /**
23 | * Some GroovyDoc.
24 | */
25 | class Grandchild extends Child {
26 |
27 | /**
28 | * Some method GroovyDoc.
29 | *
30 | * @return the String from the parent
31 | */
32 | String yetAnotherMethod() {
33 | return someMethod()
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc/src/main/groovy/org/codehaus/gmavenplus/groovy/Parent.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 |
20 | /**
21 | * Some GroovyDoc.
22 | */
23 | class Parent {
24 |
25 | /**
26 | * Some method GroovyDoc.
27 | *
28 | * @return the string "Hello, world."
29 | */
30 | String someMethod() {
31 | return "Hello, world."
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc/src/main/java/org/codehaus/gmavenplus/java/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.java;
18 |
19 | import org.codehaus.gmavenplus.groovy.Parent;
20 |
21 |
22 | public class Child extends Parent {
23 |
24 | public String someOtherMethod() {
25 | return someMethod();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void testClassesExist() {
29 | File generatedGroovyDoc1 = new File("target/gapidocs/org/codehaus/gmavenplus/groovy/Parent.html");
30 | File generatedGroovyDoc2 = new File("target/gapidocs/org/codehaus/gmavenplus/groovy/Grandchild.html");
31 | File generatedGroovyDoc3 = new File("target/gapidocs/org/codehaus/gmavenplus/java/Child.html");
32 | Assert.assertTrue(generatedGroovyDoc1 + " does not exist.", generatedGroovyDoc1.exists());
33 | Assert.assertTrue(generatedGroovyDoc1 + " is empty.", generatedGroovyDoc1.length() > 0);
34 | Assert.assertTrue(generatedGroovyDoc2 + " does not exist.", generatedGroovyDoc2.exists());
35 | Assert.assertTrue(generatedGroovyDoc2 + " is empty.", generatedGroovyDoc2.length() > 0);
36 | Assert.assertTrue(generatedGroovyDoc3 + " does not exist.", generatedGroovyDoc3.exists());
37 | Assert.assertTrue(generatedGroovyDoc3 + " is empty.", generatedGroovyDoc3.length() > 0);
38 | }
39 |
40 | @Test
41 | public void testOverviewSummaryExists() {
42 | File generatedGroovyDoc = new File("target/gapidocs/overview-summary.html");
43 | Assert.assertTrue(generatedGroovyDoc + " does not exist.", generatedGroovyDoc.exists());
44 | Assert.assertTrue(generatedGroovyDoc + " is empty.", generatedGroovyDoc.length() > 0);
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc2/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc2/src/main/groovy/org/codehaus/gmavenplus/groovy/Child.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.groovy
18 |
19 | import org.codehaus.gmavenplus.java.Parent
20 |
21 |
22 | /**
23 | * Some GroovyDoc.
24 | */
25 | class Child extends Parent {
26 |
27 | /**
28 | * Some method GroovyDoc.
29 | *
30 | * @return the String from the parent
31 | */
32 | String someOtherMethod() {
33 | someMethod()
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc2/src/main/java/org/codehaus/gmavenplus/java/Parent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.java;
18 |
19 |
20 | public class Parent {
21 |
22 | public String someMethod() {
23 | return "Hello, world.";
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc2/src/main/java2/org/codehaus/gmavenplus/java/Grandchild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.codehaus.gmavenplus.groovy.Child;
20 |
21 |
22 | public class Grandchild extends Child {
23 |
24 | public String yetAnotherMethod() {
25 | return someMethod();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mixedGroovydoc2/src/test/java/org/codehaus/gmavenplus/TheTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class TheTest {
26 |
27 | @Test
28 | public void testClassesExist() {
29 | File generatedGroovyDoc1 = new File("target/gapidocs/org/codehaus/gmavenplus/groovy/Child.html");
30 | Assert.assertTrue(generatedGroovyDoc1 + " does not exist.", generatedGroovyDoc1.exists());
31 | Assert.assertTrue(generatedGroovyDoc1 + " is empty.", generatedGroovyDoc1.length() > 0);
32 | File generatedGroovyDoc2 = new File("target/gapidocs/org/codehaus/gmavenplus/java/Parent.html");
33 | Assert.assertTrue(generatedGroovyDoc2 + " does not exist.", generatedGroovyDoc2.exists());
34 | Assert.assertTrue(generatedGroovyDoc2 + " is empty.", generatedGroovyDoc2.length() > 0);
35 | File generatedGroovyDoc3 = new File("target/gapidocs/org/codehaus/gmavenplus/java/Grandchild.html");
36 | Assert.assertTrue(generatedGroovyDoc3 + " does not exist.", generatedGroovyDoc3.exists());
37 | Assert.assertTrue(generatedGroovyDoc3 + " is empty.", generatedGroovyDoc3.length() > 0);
38 | }
39 |
40 | @Test
41 | public void testOverviewSummaryExists() {
42 | File generatedGroovyDoc = new File("target/gapidocs/overview-summary.html");
43 | Assert.assertTrue(generatedGroovyDoc + " does not exist.", generatedGroovyDoc.exists());
44 | Assert.assertTrue(generatedGroovyDoc + " is empty.", generatedGroovyDoc.length() > 0);
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginAndProjectClasspath/a/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath-a
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test A Module
17 |
18 |
19 |
20 | junit
21 | junit
22 |
23 |
24 |
25 |
26 |
27 |
28 | org.codehaus.gmavenplus
29 | gmavenplus-plugin
30 |
31 |
32 | test
33 |
34 | execute
35 |
36 |
37 |
38 |
39 |
40 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginAndProjectClasspath/b/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath-b
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test B Module
17 |
18 |
19 |
20 | org.junit.jupiter
21 | junit-jupiter
22 |
23 |
24 |
25 |
26 |
27 |
28 | org.codehaus.gmavenplus
29 | gmavenplus-plugin
30 |
31 |
32 | test
33 |
34 | execute
35 |
36 |
37 |
38 |
39 |
40 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginAndProjectClasspath/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginAndProjectClasspath/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test
17 | pom
18 |
19 |
20 |
21 | @groovyGroupId@
22 | groovy
23 |
24 |
25 | @groovyGroupId@
26 | groovy-ant
27 |
28 |
29 |
30 |
31 |
32 |
33 | org.apache.maven.plugins
34 | maven-compiler-plugin
35 |
36 |
37 | org.apache.maven.plugins
38 | maven-surefire-plugin
39 |
40 |
41 |
42 |
43 |
44 | a
45 | b
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginAndProjectClasspath2/a/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2-a
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test 2 A Module
17 |
18 |
19 |
20 |
21 | org.codehaus.gmavenplus
22 | gmavenplus-plugin
23 |
24 |
25 | test
26 |
27 | execute
28 |
29 |
30 |
31 |
32 |
33 |
42 |
43 |
44 |
45 |
46 | junit
47 | junit
48 | @junitVersion@
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginAndProjectClasspath2/b/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2-b
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test 2 B Module
17 |
18 |
19 |
20 |
21 | org.codehaus.gmavenplus
22 | gmavenplus-plugin
23 |
24 |
25 | test
26 |
27 | execute
28 |
29 |
30 |
31 |
32 |
33 |
42 |
43 |
44 |
45 |
46 | org.junit.jupiter
47 | junit-jupiter
48 | ${junit5Version}
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginAndProjectClasspath2/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginAndProjectClasspath2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginAndProjectClasspath2
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test 2
17 | pom
18 |
19 |
20 |
21 |
22 | org.codehaus.gmavenplus
23 | gmavenplus-plugin
24 |
25 |
26 | @groovyGroupId@
27 | groovy
28 | @groovyVersion@
29 |
30 |
31 | @groovyGroupId@
32 | groovy-ant
33 | @groovyVersion@
34 |
35 |
36 |
37 |
38 | org.apache.maven.plugins
39 | maven-compiler-plugin
40 |
41 |
42 | org.apache.maven.plugins
43 | maven-surefire-plugin
44 |
45 |
46 |
47 |
48 |
49 | a
50 | b
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginClasspath/a/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-multimodulePluginClasspath
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginClasspath-a
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin Classpath Test A Module
17 |
18 |
19 |
20 |
21 | org.codehaus.gmavenplus
22 | gmavenplus-plugin
23 |
24 |
25 | test
26 |
27 | execute
28 |
29 |
30 |
31 |
32 | PLUGIN_ONLY
33 |
34 |
43 |
44 |
45 |
46 |
47 | junit
48 | junit
49 | @junitVersion@
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginClasspath/b/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-multimodulePluginClasspath
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginClasspath-b
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin Classpath Test B Module
17 |
18 |
19 |
20 |
21 | org.codehaus.gmavenplus
22 | gmavenplus-plugin
23 |
24 |
25 | test
26 |
27 | execute
28 |
29 |
30 |
31 |
32 | PLUGIN_ONLY
33 |
34 |
43 |
44 |
45 |
46 |
47 | org.junit.jupiter
48 | junit-jupiter
49 | ${junit5Version}
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginClasspath/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/multimodulePluginClasspath/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimodulePluginClasspath
15 | testing
16 | GMavenPlus Plugin Multi-Module Plugin and Project Classpath Test
17 | pom
18 |
19 |
20 |
21 |
22 | org.codehaus.gmavenplus
23 | gmavenplus-plugin
24 |
25 |
26 | @groovyGroupId@
27 | groovy
28 | @groovyVersion@
29 |
30 |
31 | @groovyGroupId@
32 | groovy-ant
33 | @groovyVersion@
34 |
35 |
36 |
37 |
38 | org.apache.maven.plugins
39 | maven-compiler-plugin
40 |
41 |
42 | org.apache.maven.plugins
43 | maven-surefire-plugin
44 |
45 |
46 |
47 |
48 |
49 | a
50 | b
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/src/it/multimoduleProjectClasspath/a/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-multimoduleProjectClasspath
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimoduleProjectClasspath-a
15 | testing
16 | GMavenPlus Plugin Multi-Module Project Classpath Test A Module
17 |
18 |
19 |
20 | junit
21 | junit
22 |
23 |
24 |
25 |
26 |
27 |
28 | org.codehaus.gmavenplus
29 | gmavenplus-plugin
30 |
31 |
32 | test
33 |
34 | execute
35 |
36 |
37 |
38 |
39 | PROJECT_ONLY
40 |
41 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/it/multimoduleProjectClasspath/b/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-multimoduleProjectClasspath
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimoduleProjectClasspath-b
15 | testing
16 | GMavenPlus Plugin Multi-Module Project Classpath Test B Module
17 |
18 |
19 |
20 | org.junit.jupiter
21 | junit-jupiter
22 |
23 |
24 |
25 |
26 |
27 |
28 | org.codehaus.gmavenplus
29 | gmavenplus-plugin
30 |
31 |
32 | test
33 |
34 | execute
35 |
36 |
37 |
38 |
39 | PROJECT_ONLY
40 |
41 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/it/multimoduleProjectClasspath/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/multimoduleProjectClasspath/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-multimoduleProjectClasspath
15 | testing
16 | GMavenPlus Plugin Multi-Module Project Classpath Test
17 | pom
18 |
19 |
20 |
21 | @groovyGroupId@
22 | groovy
23 |
24 |
25 |
26 |
27 |
28 |
29 | org.apache.maven.plugins
30 | maven-compiler-plugin
31 |
32 |
33 | org.apache.maven.plugins
34 | maven-surefire-plugin
35 |
36 |
37 |
38 |
39 |
40 | a
41 | b
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/it/parametersCompile/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/parametersCompile/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-parametersCompile
15 | testing
16 | GMavenPlus Plugin Parameters Compile Test
17 | The simplest compile with parameters use case. This will fail for all Groovy versions before
18 | 2.5.0-beta-1.
19 |
20 |
21 |
22 |
23 | junit
24 | junit
25 |
26 |
27 | @groovyGroupId@
28 | groovy
29 |
30 |
31 |
32 |
33 |
34 |
35 | org.codehaus.gmavenplus
36 | gmavenplus-plugin
37 |
38 | true
39 |
40 |
41 |
42 |
43 | compile
44 |
45 |
46 |
47 |
48 |
49 | org.apache.maven.plugins
50 | maven-compiler-plugin
51 |
52 |
53 | org.apache.maven.plugins
54 | maven-surefire-plugin
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/src/it/parametersCompile/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeClass {
21 |
22 | void someMethod(String param1, String param2) {}
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/it/parametersCompile/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import groovy.lang.GroovySystem;
20 | import org.junit.Assert;
21 | import org.junit.Test;
22 |
23 | import java.lang.reflect.Method;
24 | import java.lang.reflect.Parameter;
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 |
29 | public class SomeClassTest {
30 |
31 | @Test
32 | public void testSomeMethod() throws NoSuchMethodException {
33 | Method method = SomeClass.class.getDeclaredMethod("someMethod", String.class, String.class);
34 | List parameterNames = Arrays.asList(method.getParameters());
35 |
36 | Assert.assertEquals(2, parameterNames.size());
37 |
38 | if (GroovySystem.getVersion().startsWith("1.5")
39 | || GroovySystem.getVersion().startsWith("1.6")
40 | || GroovySystem.getVersion().startsWith("1.7")
41 | || GroovySystem.getVersion().startsWith("1.8")
42 | || GroovySystem.getVersion().startsWith("1.9")
43 | || GroovySystem.getVersion().startsWith("2.0")
44 | || GroovySystem.getVersion().startsWith("2.1")
45 | || GroovySystem.getVersion().startsWith("2.2")
46 | || GroovySystem.getVersion().startsWith("2.3")
47 | || GroovySystem.getVersion().startsWith("2.4")) {
48 | Assert.assertEquals("arg0", parameterNames.get(0).getName());
49 | Assert.assertEquals("arg1", parameterNames.get(1).getName());
50 | } else {
51 | Assert.assertEquals("param1", parameterNames.get(0).getName());
52 | Assert.assertEquals("param2", parameterNames.get(1).getName());
53 | }
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/it/pluginAndProjectClasspath/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/pluginAndProjectClasspath/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-pluginAndProjectClasspath
15 | testing
16 | GMavenPlus Plugin Plugin and Project Classpath test
17 | Compiling, generating stubs, and GroovyDoc, using Groovy as a plugin dependency, while also including
18 | project dependencies.
19 |
20 |
21 |
22 |
23 | junit
24 | junit
25 |
26 |
27 | @groovyGroupId@
28 | groovy
29 | runtime
30 |
31 |
32 | @groovyGroupId@
33 | groovy-groovydoc
34 | runtime
35 |
36 |
37 |
38 |
39 |
40 |
41 | org.codehaus.gmavenplus
42 | gmavenplus-plugin
43 |
44 | PROJECT_AND_PLUGIN
45 |
46 |
47 |
48 | process-test-classes
49 |
50 | generateStubs
51 | groovydoc
52 | compile
53 |
54 |
55 |
56 |
57 |
58 | @groovyGroupId@
59 | groovy
60 | @groovyVersion@
61 |
62 |
63 | @groovyGroupId@
64 | groovy-groovydoc
65 | @groovyVersion@
66 |
67 |
68 |
69 |
70 | org.apache.maven.plugins
71 | maven-compiler-plugin
72 |
73 |
74 | org.apache.maven.plugins
75 | maven-surefire-plugin
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/src/it/pluginAndProjectClasspath/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 | import org.apache.maven.project.MavenProject
20 |
21 |
22 | class SomeClass {
23 |
24 | String someMethod(MavenProject project) {
25 | return "Hello, world."
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/pluginAndProjectClasspath/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class SomeClassTest {
26 |
27 | @Test
28 | public void testSomeClassClassExists() {
29 | File classFile = new File("target/classes/org/codehaus/gmavenplus/SomeClass.class");
30 | Assert.assertTrue(classFile + " does not exist.", classFile.exists());
31 | Assert.assertTrue(classFile + " is empty.", classFile.length() > 0);
32 | }
33 |
34 | @Test
35 | public void testSomeClassExists() {
36 | File generatedGroovyDoc = new File("target/gapidocs/org/codehaus/gmavenplus/SomeClass.html");
37 | Assert.assertTrue(generatedGroovyDoc + " does not exist.", generatedGroovyDoc.exists());
38 | Assert.assertTrue(generatedGroovyDoc + " is empty.", generatedGroovyDoc.length() > 0);
39 | }
40 |
41 | @Test
42 | public void testOverviewSummaryExists() {
43 | File generatedGroovyDoc = new File("target/gapidocs/overview-summary.html");
44 | Assert.assertTrue(generatedGroovyDoc + " does not exist.", generatedGroovyDoc.exists());
45 | Assert.assertTrue(generatedGroovyDoc + " is empty.", generatedGroovyDoc.length() > 0);
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/it/pluginClasspath/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/pluginClasspath/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-pluginClasspath
15 | testing
16 | GMavenPlus Plugin Plugin Classpath test
17 | Compiling, generating stubs, and GroovyDoc, using Groovy as a plugin dependency.
18 |
19 |
20 |
21 | junit
22 | junit
23 |
24 |
25 | @groovyGroupId@
26 | groovy
27 | runtime
28 |
29 |
30 | @groovyGroupId@
31 | groovy-groovydoc
32 | runtime
33 |
34 |
35 |
36 |
37 |
38 |
39 | org.codehaus.gmavenplus
40 | gmavenplus-plugin
41 |
42 | PLUGIN_ONLY
43 |
44 |
45 |
46 | process-test-classes
47 |
48 | generateStubs
49 | groovydoc
50 | compile
51 |
52 |
53 |
54 |
55 |
56 | @groovyGroupId@
57 | groovy
58 | @groovyVersion@
59 |
60 |
61 | @groovyGroupId@
62 | groovy-groovydoc
63 | @groovyVersion@
64 |
65 |
66 |
67 |
68 | org.apache.maven.plugins
69 | maven-compiler-plugin
70 |
71 |
72 | org.apache.maven.plugins
73 | maven-surefire-plugin
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/src/it/pluginClasspath/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 | import org.apache.maven.project.MavenProject
20 |
21 |
22 | class SomeClass {
23 |
24 | String someMethod(MavenProject project) {
25 | return "Hello, world."
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/pluginClasspath/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | import java.io.File;
23 |
24 |
25 | public class SomeClassTest {
26 |
27 | @Test
28 | public void testSomeClassClassExists() {
29 | File classFile = new File("target/classes/org/codehaus/gmavenplus/SomeClass.class");
30 | Assert.assertTrue(classFile + " does not exist.", classFile.exists());
31 | Assert.assertTrue(classFile + " is empty.", classFile.length() > 0);
32 | }
33 |
34 | @Test
35 | public void testSomeClassExists() {
36 | File generatedGroovyDoc = new File("target/gapidocs/org/codehaus/gmavenplus/SomeClass.html");
37 | Assert.assertTrue(generatedGroovyDoc + " does not exist.", generatedGroovyDoc.exists());
38 | Assert.assertTrue(generatedGroovyDoc + " is empty.", generatedGroovyDoc.length() > 0);
39 | }
40 |
41 | @Test
42 | public void testOverviewSummaryExists() {
43 | File generatedGroovyDoc = new File("target/gapidocs/overview-summary.html");
44 | Assert.assertTrue(generatedGroovyDoc + " does not exist.", generatedGroovyDoc.exists());
45 | Assert.assertTrue(generatedGroovyDoc + " is empty.", generatedGroovyDoc.length() > 0);
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/it/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | it-repo
7 |
8 | true
9 |
10 |
11 |
12 | local.central
13 | @localRepositoryUrl@
14 |
15 | true
16 |
17 |
18 | true
19 |
20 |
21 |
22 |
23 |
24 | local.central
25 | @localRepositoryUrl@
26 |
27 | true
28 |
29 |
30 | true
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/it/shadedGroovy/invoker.properties:
--------------------------------------------------------------------------------
1 | invoker.goals=clean test -Dmaven.plugin.validation=verbose
2 | #invoker.debug = true
3 |
--------------------------------------------------------------------------------
/src/it/shadedGroovy/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-root
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-shadedGroovy
15 | testing
16 | pom
17 | GMavenPlus Plugin Shaded Groovy Test
18 | This tests Groovy on the classpath from an uber jar. This will fail with Groovy versions older than
19 | 1.6.6 and 1.7-beta-1 and 1.7-beta-2.
20 |
21 |
22 |
23 |
24 |
25 | org.codehaus.gmavenplus
26 | gmavenplus-plugin-it-shadedGroovy-uberModule
27 | ${project.version}
28 |
29 |
30 | org.codehaus.gmavenplus
31 | gmavenplus-plugin-it-shadedGroovy-testModule
32 | ${project.version}
33 |
34 |
35 |
36 |
37 |
38 | uberModule
39 | testModule
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/it/shadedGroovy/testModule/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.codehaus.gmavenplus
9 | gmavenplus-plugin-it-shadedGroovy
10 | testing
11 | ../pom.xml
12 |
13 |
14 | gmavenplus-plugin-it-shadedGroovy-testModule
15 | testing
16 | GMavenPlus Plugin Shaded Groovy Test Module
17 |
18 |
19 |
20 | org.codehaus.gmavenplus
21 | gmavenplus-plugin-it-shadedGroovy-uberModule
22 |
23 |
24 | junit
25 | junit
26 |
27 |
28 |
29 |
30 |
31 |
32 | org.codehaus.gmavenplus
33 | gmavenplus-plugin
34 |
35 |
36 |
37 | compile
38 |
39 |
40 |
41 |
42 |
43 | org.apache.maven.plugins
44 | maven-compiler-plugin
45 |
46 |
47 | org.apache.maven.plugins
48 | maven-surefire-plugin
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/src/it/shadedGroovy/testModule/src/main/groovy/org/codehaus/gmavenplus/SomeClass.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus
18 |
19 |
20 | class SomeClass {
21 |
22 | String someMethod() {
23 | return "Hello, world."
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/shadedGroovy/testModule/src/test/java/org/codehaus/gmavenplus/SomeClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus;
18 |
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 |
23 | public class SomeClassTest {
24 |
25 | @Test
26 | public void testSomeMethod() {
27 | SomeClass someClass = new SomeClass();
28 | Assert.assertEquals("Hello, world.", someClass.someMethod());
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/shadedGroovy/uberModule/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 |
7 | org.codehaus.gmavenplus
8 | gmavenplus-plugin-it-shadedGroovy
9 | testing
10 | ../pom.xml
11 |
12 |
13 | gmavenplus-plugin-it-shadedGroovy-uberModule
14 | testing
15 | GMavenPlus Plugin Shaded Groovy Uber Jar Module
16 |
17 |
18 |
19 | @groovyGroupId@
20 | groovy
21 |
22 |
23 |
24 |
25 |
26 |
27 | org.apache.maven.plugins
28 | maven-dependency-plugin
29 | @dependencyPluginVersion@
30 |
31 |
32 |
33 | compile
34 |
35 | unpack-dependencies
36 |
37 |
38 | ${project.build.outputDirectory}
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/groovyworkarounds/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Classes to work around issues with Groovy (some of which were fixed in later
19 | * Groovy versions).
20 | */
21 | package org.codehaus.gmavenplus.groovyworkarounds;
22 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/model/IncludeClasspath.java:
--------------------------------------------------------------------------------
1 | package org.codehaus.gmavenplus.model;
2 |
3 | /**
4 | * The possible classpaths to include.
5 | */
6 | public enum IncludeClasspath {
7 | PROJECT_ONLY,
8 | PROJECT_AND_PLUGIN,
9 | PLUGIN_ONLY
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/model/Link.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003-2010 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // note that this won't be properly consumed by mojo unless it's in the same package as the mojo
18 | package org.codehaus.gmavenplus.model;
19 |
20 |
21 | /**
22 | * This class was taken from the Groovy project, so that GroovyDoc links can be
23 | * added as mojo parameters without a compile dependency on Groovy. Represents a link pair (href, packages).
24 | * The packages are comma separated.
25 | */
26 | public class Link {
27 |
28 | /**
29 | * Link URL.
30 | */
31 | private String href = "";
32 |
33 | /**
34 | * Link packages.
35 | */
36 | private String packages = "";
37 |
38 | /**
39 | * Get the packages attribute.
40 | *
41 | * @return the packages attribute
42 | */
43 | public String getPackages() {
44 | return packages;
45 | }
46 |
47 | /**
48 | * Set the packages attribute.
49 | *
50 | * @param newPackages the comma separated package prefixes corresponding to this link
51 | */
52 | public void setPackages(final String newPackages) {
53 | packages = newPackages;
54 | }
55 |
56 | /**
57 | * Get the href attribute.
58 | *
59 | * @return the href attribute
60 | */
61 | public String getHref() {
62 | return href;
63 | }
64 |
65 | /**
66 | * Set the href attribute.
67 | *
68 | * @param newHref a String
value representing the URL to use for this link
69 | */
70 | public void setHref(final String newHref) {
71 | href = newHref;
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/model/Scopes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.model;
18 |
19 |
20 | /**
21 | * Scope access modifiers supported by Java.
22 | *
23 | * @author Keegan Witt
24 | * @since 1.0-beta-1
25 | */
26 | public enum Scopes {
27 |
28 | /**
29 | * The public scope.
30 | */
31 | PUBLIC,
32 |
33 | /**
34 | * The protected scope.
35 | */
36 | PROTECTED,
37 |
38 | /**
39 | * The package scope.
40 | */
41 | PACKAGE,
42 |
43 | /**
44 | * The private scope.
45 | */
46 | PRIVATE
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/model/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Classes to model supporting data.
19 | */
20 | package org.codehaus.gmavenplus.model.internal;
21 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/model/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Classes to model Maven parameters.
19 | */
20 | package org.codehaus.gmavenplus.model;
21 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/mojo/AddSourcesMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.plugins.annotations.LifecyclePhase;
20 | import org.apache.maven.plugins.annotations.Mojo;
21 | import org.apache.maven.plugins.annotations.Parameter;
22 | import org.apache.maven.shared.model.fileset.FileSet;
23 |
24 |
25 | /**
26 | * This mojo adds Groovy sources to the project's sources.
27 | *
28 | * @author Keegan Witt
29 | * @since 1.0-beta-1
30 | */
31 | @Mojo(name = "addSources", defaultPhase = LifecyclePhase.INITIALIZE, threadSafe = true)
32 | public class AddSourcesMojo extends AbstractGroovySourcesMojo {
33 |
34 | /**
35 | * The Groovy source files (relative paths).
36 | * Default: "${project.basedir}/src/main/groovy/**/*.groovy"
37 | */
38 | @Parameter
39 | protected FileSet[] sources;
40 |
41 | /**
42 | * Executes this mojo.
43 | */
44 | @Override
45 | public void execute() {
46 | for (FileSet source : getFilesets(sources, false)) {
47 | addSourcePath(source.getDirectory());
48 | }
49 | }
50 |
51 | /**
52 | * Adds the specified source path to the project's main compile sources.
53 | *
54 | * @param path The source path to add to the project's main compile sources
55 | */
56 | protected void addSourcePath(final String path) {
57 | if (!project.getCompileSourceRoots().contains(path)) {
58 | getLog().debug("Added source directory: " + path);
59 | project.addCompileSourceRoot(path);
60 | }
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/mojo/AddStubSourcesMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.plugins.annotations.Mojo;
20 | import org.apache.maven.plugins.annotations.Parameter;
21 |
22 | import java.io.File;
23 |
24 |
25 | /**
26 | * Adds Groovy stubs directory back to Maven's list of source directories. Normally, you won't need to use this mojo.
27 | *
28 | * @author Keegan Witt
29 | * @since 1.1
30 | */
31 | @Mojo(name = "addStubSources", threadSafe = true)
32 | public class AddStubSourcesMojo extends AbstractGroovyStubSourcesMojo {
33 |
34 | /**
35 | * The location for the compiled classes.
36 | */
37 | @Parameter(defaultValue = "${project.build.directory}/generated-sources/groovy-stubs/main")
38 | protected File stubsOutputDirectory;
39 |
40 | /**
41 | * Executes this mojo.
42 | */
43 | @Override
44 | public void execute() {
45 | getLog().debug("Added stub directory " + stubsOutputDirectory.getAbsolutePath() + " to project sources.");
46 | project.addCompileSourceRoot(stubsOutputDirectory.getAbsolutePath());
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/mojo/AddTestSourcesMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.plugins.annotations.LifecyclePhase;
20 | import org.apache.maven.plugins.annotations.Mojo;
21 | import org.apache.maven.plugins.annotations.Parameter;
22 | import org.apache.maven.shared.model.fileset.FileSet;
23 |
24 |
25 | /**
26 | * This mojo adds Groovy test sources to the project's test sources.
27 | *
28 | * @author Keegan Witt
29 | * @since 1.0-beta-3
30 | */
31 | @Mojo(name = "addTestSources", defaultPhase = LifecyclePhase.INITIALIZE, threadSafe = true)
32 | public class AddTestSourcesMojo extends AbstractGroovySourcesMojo {
33 |
34 | /**
35 | * The Groovy test source files (relative paths).
36 | * Default: "${project.basedir}/src/test/groovy/**/*.groovy"
37 | */
38 | @Parameter
39 | protected FileSet[] testSources;
40 |
41 | /**
42 | * Executes this mojo.
43 | */
44 | @Override
45 | public void execute() {
46 | for (FileSet testSource : getTestFilesets(testSources, false)) {
47 | addTestSourcePath(testSource.getDirectory());
48 | }
49 | }
50 |
51 | /**
52 | * Adds the specified test source path to the project's test compile sources.
53 | *
54 | * @param path The test source path to add to the project's test compile sources
55 | */
56 | protected void addTestSourcePath(final String path) {
57 | if (!project.getTestCompileSourceRoots().contains(path)) {
58 | getLog().debug("Added test source directory: " + path);
59 | project.addTestCompileSourceRoot(path);
60 | }
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/mojo/AddTestStubSourcesMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.plugins.annotations.Mojo;
20 | import org.apache.maven.plugins.annotations.Parameter;
21 |
22 | import java.io.File;
23 |
24 |
25 | /**
26 | * Adds Groovy test stubs directory back to Maven's list of test source directories. Normally, you won't need to use this mojo.
27 | *
28 | * @author Keegan Witt
29 | * @since 1.1
30 | */
31 | @Mojo(name = "addTestStubSources", threadSafe = true)
32 | public class AddTestStubSourcesMojo extends AbstractGroovyStubSourcesMojo {
33 |
34 | /**
35 | * The location for the compiled test classes.
36 | */
37 | @Parameter(defaultValue = "${project.build.directory}/generated-sources/groovy-stubs/test")
38 | protected File testStubsOutputDirectory;
39 |
40 | /**
41 | * Flag to allow adding test sources to be skipped.
42 | */
43 | @Parameter(property = "maven.test.skip", defaultValue = "false")
44 | protected boolean skipTests;
45 |
46 | /**
47 | * Executes this mojo.
48 | */
49 | @Override
50 | public void execute() {
51 | if (!skipTests) {
52 | getLog().debug("Added test stub directory " + testStubsOutputDirectory.getAbsolutePath() + " to project test sources.");
53 | project.addTestCompileSourceRoot(testStubsOutputDirectory.getAbsolutePath());
54 | }
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/mojo/RemoveStubsMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.plugins.annotations.LifecyclePhase;
20 | import org.apache.maven.plugins.annotations.Mojo;
21 | import org.apache.maven.plugins.annotations.Parameter;
22 |
23 | import java.io.File;
24 |
25 |
26 | /**
27 | * This mojo removes Groovy stubs from the project's sources.
28 | *
29 | * @author Keegan Witt
30 | * @since 1.0-beta-3
31 | */
32 | @Mojo(name = "removeStubs", defaultPhase = LifecyclePhase.COMPILE, threadSafe = true)
33 | public class RemoveStubsMojo extends AbstractGroovyStubSourcesMojo {
34 |
35 | /**
36 | * The location for the compiled classes.
37 | */
38 | @Parameter(defaultValue = "${project.build.directory}/generated-sources/groovy-stubs/main")
39 | protected File stubsOutputDirectory;
40 |
41 | /**
42 | * Executes this mojo.
43 | */
44 | @Override
45 | public void execute() {
46 | try {
47 | project.getCompileSourceRoots().remove(stubsOutputDirectory.getAbsolutePath());
48 | } catch (UnsupportedOperationException e) {
49 | try {
50 | removeSourceRoot(project, "main", stubsOutputDirectory);
51 | } catch (Throwable e2) {
52 | e.addSuppressed(e2);
53 | throw e;
54 | }
55 | }
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/mojo/RemoveTestStubsMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.plugins.annotations.LifecyclePhase;
20 | import org.apache.maven.plugins.annotations.Mojo;
21 | import org.apache.maven.plugins.annotations.Parameter;
22 |
23 | import java.io.File;
24 |
25 |
26 | /**
27 | * This mojo removes Groovy test stubs from the project's sources.
28 | *
29 | * @author Keegan Witt
30 | * @since 1.0-beta-3
31 | */
32 | @Mojo(name = "removeTestStubs", defaultPhase = LifecyclePhase.TEST_COMPILE, threadSafe = true)
33 | public class RemoveTestStubsMojo extends AbstractGroovyStubSourcesMojo {
34 |
35 | /**
36 | * The location for the compiled test classes.
37 | */
38 | @Parameter(defaultValue = "${project.build.directory}/generated-sources/groovy-stubs/test")
39 | protected File testStubsOutputDirectory;
40 |
41 | /**
42 | * Flag to allow adding test sources to be skipped.
43 | */
44 | @Parameter(property = "maven.test.skip", defaultValue = "false")
45 | protected boolean skipTests;
46 |
47 | /**
48 | * Executes this mojo.
49 | */
50 | @Override
51 | public void execute() {
52 | if (!skipTests) {
53 | try {
54 | project.getTestCompileSourceRoots().remove(testStubsOutputDirectory.getAbsolutePath());
55 | } catch (UnsupportedOperationException e) {
56 | try {
57 | removeSourceRoot(project, "test", testStubsOutputDirectory);
58 | } catch (Throwable e2) {
59 | e.addSuppressed(e2);
60 | throw e;
61 | }
62 | }
63 | }
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/mojo/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Maven mojos.
19 | */
20 | package org.codehaus.gmavenplus.mojo;
21 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/util/NoExitSecurityManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.util;
18 |
19 | import java.security.Permission;
20 |
21 |
22 | /**
23 | * Custom security manager to {@link System#exit} (and related) from being used.
24 | *
25 | * @author Jason Dillon
26 | * @since 1.2
27 | */
28 | public class NoExitSecurityManager extends SecurityManager {
29 |
30 | /**
31 | * The parent SecurityManager.
32 | */
33 | private final SecurityManager parent;
34 |
35 | /**
36 | * Construct a new NoExitSecurityManager from the parent.
37 | *
38 | * @param newParent the parent to set
39 | */
40 | public NoExitSecurityManager(final SecurityManager newParent) {
41 | parent = newParent;
42 | }
43 |
44 | /**
45 | * Construct a new NoExitSecurityManager, using the System SecurityManager as the parent.
46 | */
47 | public NoExitSecurityManager() {
48 | this(System.getSecurityManager());
49 | }
50 |
51 | /**
52 | * Check the given Permission.
53 | *
54 | * @param permission the Permission to check
55 | */
56 | public void checkPermission(final Permission permission) {
57 | if (parent != null) {
58 | parent.checkPermission(permission);
59 | }
60 | }
61 |
62 | /**
63 | * Always throws {@link SecurityException}.
64 | *
65 | * @param code the exit code that is completely ignored
66 | */
67 | public void checkExit(final int code) {
68 | throw new SecurityException("Use of System.exit() is forbidden!");
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/org/codehaus/gmavenplus/util/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility classes.
19 | */
20 | package org.codehaus.gmavenplus.util;
21 |
--------------------------------------------------------------------------------
/src/site/apt/index.apt.vm:
--------------------------------------------------------------------------------
1 | ---------------
2 | ${project.name}
3 | ---------------
4 | Keegan Witt
5 | ---------------
6 | ---------------
7 |
8 | ${project.name}
9 |
10 | * Introduction
11 |
12 | ${project.name} is a rewrite of {{{https://github.com/groovy/gmaven}GMaven}}, a {{{http://maven.apache.org/}Maven}} plugin that allows you to integrate {{{http://groovy-lang.org/}Groovy}} into your Maven projects.\
13 | Basic usage can be found on the {{{https://github.com/groovy/GMavenPlus/wiki/Usage}usage}} page, with additional usages on the {{{https://github.com/groovy/GMavenPlus/wiki/Examples}examples}} page.
14 | For more information, consult the {{{https://github.com/groovy/GMavenPlus/wiki}wiki}}.
15 |
--------------------------------------------------------------------------------
/src/site/resources/images/logos/GMavenPlusLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/groovy/GMavenPlus/70a5c84e5781fd3daad6d28cdb67f33be27cbdd3/src/site/resources/images/logos/GMavenPlusLogo.png
--------------------------------------------------------------------------------
/src/site/resources/images/logos/GMavenPlusLogo_sm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/groovy/GMavenPlus/70a5c84e5781fd3daad6d28cdb67f33be27cbdd3/src/site/resources/images/logos/GMavenPlusLogo_sm.png
--------------------------------------------------------------------------------
/src/site/site.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | GMavenPlus
9 | /images/logos/GMavenPlusLogo_sm.png
10 | GMavenPlus logo
11 | /index.html
12 |
13 |
14 |
15 | org.apache.maven.skins
16 | maven-fluido-skin
17 | 2.0.1
18 |
19 |
20 |
21 |
22 | false
23 | true
24 |
25 | groovy/gmavenplus
26 | right
27 | red
28 |
29 |
30 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/model/LinkTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.model;
18 |
19 | import org.junit.Test;
20 |
21 | import static org.junit.Assert.assertEquals;
22 |
23 |
24 | /**
25 | * Unit tests for the Link class
26 | */
27 | public class LinkTest {
28 |
29 | @Test
30 | public void testGettersAndSetters() {
31 | String packages = "PACKAGES";
32 | String href = "HREF";
33 | Link link = new Link();
34 | assertEquals(0, link.getPackages().length());
35 | assertEquals(0, link.getHref().length());
36 | link.setPackages(packages);
37 | link.setHref(href);
38 | assertEquals(packages, link.getPackages());
39 | assertEquals(href, link.getHref());
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/model/ScopesTest.java:
--------------------------------------------------------------------------------
1 | package org.codehaus.gmavenplus.model;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.assertEquals;
6 |
7 |
8 | /**
9 | * Unit tests for Scopes class.
10 | *
11 | * @author Keegan Witt
12 | */
13 | public class ScopesTest {
14 |
15 | @Test
16 | public void test() {
17 | assertEquals(4, Scopes.values().length);
18 | assertEquals(Scopes.PUBLIC, Scopes.values()[0]);
19 | assertEquals(Scopes.PROTECTED, Scopes.values()[1]);
20 | assertEquals(Scopes.PACKAGE, Scopes.values()[2]);
21 | assertEquals(Scopes.PRIVATE, Scopes.values()[3]);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/AbstractGroovyDocMojoTest.java:
--------------------------------------------------------------------------------
1 | package org.codehaus.gmavenplus.mojo;
2 |
3 | import org.apache.maven.plugin.MojoExecution;
4 | import org.apache.maven.plugin.descriptor.MojoDescriptor;
5 | import org.apache.maven.project.MavenProject;
6 | import org.apache.maven.shared.model.fileset.FileSet;
7 | import org.apache.maven.shared.model.fileset.util.FileSetManager;
8 | import org.junit.Before;
9 | import org.junit.Test;
10 | import org.mockito.Mock;
11 | import org.mockito.MockitoAnnotations;
12 | import org.mockito.Spy;
13 |
14 | import java.io.File;
15 | import java.util.Properties;
16 |
17 | import static java.util.Collections.emptyList;
18 | import static org.mockito.Mockito.*;
19 |
20 | /**
21 | * Unit tests for the AbstractGroovyDocMojo class.
22 | *
23 | * @author Rick Venutolo
24 | */
25 | public class AbstractGroovyDocMojoTest {
26 | @Spy
27 | private TestMojo testMojo;
28 |
29 | @Mock
30 | private MojoExecution mojoExecution;
31 |
32 | @Mock
33 | private MojoDescriptor mojoDescriptor;
34 |
35 | @Mock
36 | private MavenProject project;
37 |
38 | @Before
39 | public void setup() throws Exception {
40 | MockitoAnnotations.openMocks(this);
41 | testMojo.mojoExecution = mojoExecution;
42 | doReturn(mojoDescriptor).when(mojoExecution).getMojoDescriptor();
43 | testMojo.project = project;
44 | doReturn(new Properties()).when(testMojo).setupProperties();
45 | doReturn(emptyList()).when(testMojo).setupGroovyDocSources(any(FileSet[].class), any(FileSetManager.class));
46 | doNothing().when(testMojo).generateGroovyDoc(any(File.class), any(Class.class), any(Class.class), any(), anyList(), any());
47 | }
48 |
49 | @Test
50 | public void testDontSkipGroovyDoc() throws Exception {
51 | testMojo.doGroovyDocGeneration(new FileSet[]{new FileSet()}, emptyList(), new File(""));
52 | verify(testMojo, times(1)).generateGroovyDoc(any(File.class), any(Class.class), any(Class.class), any(), anyList(), any());
53 | }
54 |
55 | @Test
56 | public void testSkipGroovyDoc() throws Exception {
57 | testMojo.skipGroovyDoc = true;
58 | testMojo.doGroovyDocGeneration(new FileSet[]{new FileSet()}, emptyList(), new File(""));
59 | verify(testMojo, never()).generateGroovyDoc(any(File.class), any(Class.class), any(Class.class), any(), anyList(), any());
60 | }
61 |
62 | public static class TestMojo extends AbstractGroovyDocMojo {
63 | @Override
64 | public void execute() {
65 | }
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/AbstractGroovyMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.codehaus.gmavenplus.model.internal.Version;
20 | import org.junit.Before;
21 | import org.junit.Test;
22 |
23 | import static org.junit.Assert.*;
24 | import static org.mockito.Mockito.doReturn;
25 | import static org.mockito.Mockito.spy;
26 |
27 |
28 | /**
29 | * Unit tests for the AbstractGroovyMojo class.
30 | *
31 | * @author Keegan Witt
32 | */
33 | public class AbstractGroovyMojoTest {
34 | private AbstractGroovyMojo testMojo;
35 |
36 | @Before
37 | public void setup() {
38 | testMojo = spy(new TestGroovyMojo());
39 | }
40 |
41 | @Test
42 | public void testGetJavaVersion() {
43 | assertTrue(testMojo.getJavaVersionString() != null && !testMojo.getJavaVersionString().isEmpty());
44 | assertNotNull(testMojo.getJavaVersion());
45 | }
46 |
47 | @Test
48 | public void testIsJavaSupportIndy() {
49 | doReturn(Version.parseFromString("1.7.0_45")).when(testMojo).getJavaVersion();
50 | assertTrue(testMojo.isJavaSupportIndy());
51 | }
52 |
53 | @Test
54 | public void testIsJavaSupportIndyNo() {
55 | doReturn(Version.parseFromString("1.6.0_45")).when(testMojo).getJavaVersion();
56 | assertFalse(testMojo.isJavaSupportIndy());
57 | }
58 |
59 | @Test
60 | public void testIsJavaSupportPreviewFeatures() {
61 | doReturn(Version.parseFromString("12.0.1")).when(testMojo).getJavaVersion();
62 | assertTrue(testMojo.isJavaSupportPreviewFeatures());
63 | }
64 |
65 | @Test
66 | public void testIsJavaSupportPreviewFeaturesNo() {
67 | doReturn(Version.parseFromString("11.0.3")).when(testMojo).getJavaVersion();
68 | assertFalse(testMojo.isJavaSupportPreviewFeatures());
69 | }
70 |
71 | public static class TestGroovyMojo extends AbstractGroovyMojo {
72 | @Override
73 | public void execute() {
74 | }
75 | }
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/AbstractGroovyStubSourcesMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.junit.Before;
20 | import org.junit.Test;
21 | import org.mockito.Mock;
22 | import org.mockito.MockitoAnnotations;
23 |
24 | import java.io.File;
25 |
26 | import static org.junit.Assert.assertEquals;
27 | import static org.mockito.Mockito.doReturn;
28 |
29 |
30 | /**
31 | * Unit tests for the AbstractGroovyStubSourcesMojo class.
32 | *
33 | * @author Keegan Witt
34 | */
35 | public class AbstractGroovyStubSourcesMojoTest {
36 | private TestMojo testMojo;
37 | @Mock
38 | private File outputDirectory;
39 | private static final String PATH = "path";
40 |
41 | @Before
42 | public void setup() {
43 | MockitoAnnotations.openMocks(this);
44 | testMojo = new TestMojo();
45 | doReturn(PATH).when(outputDirectory).getAbsolutePath();
46 | }
47 |
48 | @Test
49 | public void testGetStubsEmpty() {
50 | assertEquals(0, testMojo.getStubs(outputDirectory).size());
51 | }
52 |
53 | protected static class TestMojo extends AbstractGroovyStubSourcesMojo {
54 | @Override
55 | public void execute() {
56 | }
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/AddSourcesMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.project.MavenProject;
20 | import org.apache.maven.shared.model.fileset.FileSet;
21 | import org.junit.Before;
22 | import org.junit.Test;
23 | import org.mockito.Mock;
24 | import org.mockito.MockitoAnnotations;
25 |
26 | import static java.util.Collections.singletonList;
27 | import static org.mockito.Mockito.*;
28 |
29 |
30 | /**
31 | * Unit tests for the AddSourcesMojo class.
32 | *
33 | * @author Keegan Witt
34 | */
35 | public class AddSourcesMojoTest {
36 | private AddSourcesMojo addSourcesMojo;
37 |
38 | private static final String PATH = "PATH";
39 |
40 | @Mock
41 | private MavenProject project;
42 |
43 | @Before
44 | public void setup() {
45 | MockitoAnnotations.openMocks(this);
46 | addSourcesMojo = new AddSourcesMojo();
47 | addSourcesMojo.project = project;
48 | }
49 |
50 | @Test
51 | public void testAddSourcePathContainsPath() {
52 | doReturn(singletonList(PATH)).when(project).getCompileSourceRoots();
53 | FileSet fs = new FileSet();
54 | fs.setDirectory(PATH);
55 | addSourcesMojo.sources = new FileSet[]{fs};
56 | addSourcesMojo.execute();
57 | verify(project, never()).addCompileSourceRoot(anyString());
58 | }
59 |
60 | @Test
61 | public void testAddSourcePathNotContainsPath() {
62 | doReturn(singletonList(PATH)).when(project).getCompileSourceRoots();
63 | FileSet fs = new FileSet();
64 | fs.setDirectory("OTHER PATH");
65 | addSourcesMojo.sources = new FileSet[]{fs};
66 | addSourcesMojo.execute();
67 | verify(project, times(1)).addCompileSourceRoot(anyString());
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/AddStubSourcesMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.project.MavenProject;
20 | import org.junit.Before;
21 | import org.junit.Test;
22 | import org.mockito.Mock;
23 | import org.mockito.MockitoAnnotations;
24 |
25 | import java.io.File;
26 |
27 | import static org.mockito.Mockito.verify;
28 |
29 |
30 | /**
31 | * Unit tests for the AddStubSourcesMojo class.
32 | *
33 | * @author Keegan Witt
34 | */
35 | public class AddStubSourcesMojoTest {
36 | private AddStubSourcesMojo addStubSourcesMojo;
37 | @Mock
38 | private MavenProject project;
39 | @Mock
40 | private File stubsOutputDirectory;
41 |
42 | @Before
43 | public void setup() {
44 | MockitoAnnotations.openMocks(this);
45 | addStubSourcesMojo = new AddStubSourcesMojo();
46 | addStubSourcesMojo.project = project;
47 | addStubSourcesMojo.stubsOutputDirectory = stubsOutputDirectory;
48 | }
49 |
50 | @Test
51 | public void testAddsStubsToSources() {
52 | addStubSourcesMojo.execute();
53 | verify(project).addCompileSourceRoot(stubsOutputDirectory.getAbsolutePath());
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/AddTestSourcesMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.project.MavenProject;
20 | import org.apache.maven.shared.model.fileset.FileSet;
21 | import org.junit.Before;
22 | import org.junit.Test;
23 | import org.mockito.Mock;
24 | import org.mockito.MockitoAnnotations;
25 |
26 | import static java.util.Collections.singletonList;
27 | import static org.mockito.Mockito.*;
28 |
29 |
30 | /**
31 | * Unit tests for the AddTestSourcesMojo class.
32 | *
33 | * @author Keegan Witt
34 | */
35 | public class AddTestSourcesMojoTest {
36 | private AddTestSourcesMojo addTestSourcesMojo;
37 |
38 | private static final String PATH = "PATH";
39 |
40 | @Mock
41 | private MavenProject project;
42 |
43 | @Before
44 | public void setup() {
45 | MockitoAnnotations.openMocks(this);
46 | addTestSourcesMojo = new AddTestSourcesMojo();
47 | addTestSourcesMojo.project = project;
48 | }
49 |
50 | @Test
51 | public void testAddSourcePathContainsPath() {
52 | doReturn(singletonList(PATH)).when(project).getTestCompileSourceRoots();
53 | FileSet fs = new FileSet();
54 | fs.setDirectory(PATH);
55 | addTestSourcesMojo.testSources = new FileSet[]{fs};
56 | addTestSourcesMojo.execute();
57 | verify(project, never()).addTestCompileSourceRoot(anyString());
58 | }
59 |
60 | @Test
61 | public void testAddSourcePathNotContainsPath() {
62 | doReturn(singletonList(PATH)).when(project).getTestCompileSourceRoots();
63 | FileSet fs = new FileSet();
64 | fs.setDirectory("OTHER PATH");
65 | addTestSourcesMojo.testSources = new FileSet[]{fs};
66 | addTestSourcesMojo.execute();
67 | verify(project, times(1)).addTestCompileSourceRoot(anyString());
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/AddTestStubSourcesMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * You may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.project.MavenProject;
20 | import org.junit.Before;
21 | import org.junit.Test;
22 | import org.mockito.Mock;
23 | import org.mockito.MockitoAnnotations;
24 |
25 | import java.io.File;
26 |
27 | import static org.mockito.Mockito.never;
28 | import static org.mockito.Mockito.verify;
29 |
30 |
31 | /**
32 | * Unit tests for the AddTestStubSourcesMojo class.
33 | *
34 | * @author Keegan Witt
35 | */
36 | public class AddTestStubSourcesMojoTest {
37 | private AddTestStubSourcesMojo addTestStubSourcesMojo;
38 | @Mock
39 | private MavenProject project;
40 | @Mock
41 | private File outputDirectory;
42 |
43 | @Before
44 | public void setup() {
45 | MockitoAnnotations.openMocks(this);
46 | addTestStubSourcesMojo = new AddTestStubSourcesMojo();
47 | addTestStubSourcesMojo.project = project;
48 | addTestStubSourcesMojo.testStubsOutputDirectory = outputDirectory;
49 | }
50 |
51 | @Test
52 | public void testAddsTestStubsToSources() {
53 | addTestStubSourcesMojo.execute();
54 | verify(project).addTestCompileSourceRoot(outputDirectory.getAbsolutePath());
55 | }
56 |
57 | @Test
58 | public void testDoesNothingWhenSkipFlagIsSet() {
59 | addTestStubSourcesMojo.skipTests = true;
60 | addTestStubSourcesMojo.execute();
61 | verify(project, never()).addTestCompileSourceRoot(outputDirectory.getAbsolutePath());
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/RemoveStubsMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.project.MavenProject;
20 | import org.junit.Before;
21 | import org.junit.Test;
22 |
23 | import java.io.File;
24 |
25 | import static org.junit.Assert.assertEquals;
26 |
27 |
28 | /**
29 | * Unit tests for the RemoveStubsMojo class.
30 | *
31 | * @author Keegan Witt
32 | */
33 | public class RemoveStubsMojoTest {
34 | private RemoveStubsMojo removeStubsMojo;
35 | private static final String PATH = "FAKE_PATH";
36 | private MavenProject project;
37 |
38 | @Before
39 | public void setup() {
40 | removeStubsMojo = new RemoveStubsMojo();
41 | project = new MavenProject();
42 | removeStubsMojo.project = project;
43 | removeStubsMojo.stubsOutputDirectory = new File(PATH);
44 | }
45 |
46 | @Test
47 | public void testRemoveSourcePathContainsPath() {
48 | project.addCompileSourceRoot(removeStubsMojo.stubsOutputDirectory.getAbsolutePath());
49 | assertEquals(1, project.getCompileSourceRoots().size());
50 | removeStubsMojo.execute();
51 | assertEquals(0, project.getCompileSourceRoots().size());
52 | }
53 |
54 | @Test
55 | public void testRemoveSourcePathNotContainsPath() {
56 | assertEquals(0, project.getCompileSourceRoots().size());
57 | removeStubsMojo.execute();
58 | assertEquals(0, project.getCompileSourceRoots().size());
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/mojo/RemoveTestStubsMojoTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.mojo;
18 |
19 | import org.apache.maven.project.MavenProject;
20 | import org.junit.Before;
21 | import org.junit.Test;
22 |
23 | import java.io.File;
24 |
25 | import static org.junit.Assert.assertEquals;
26 |
27 |
28 | /**
29 | * Unit tests for the RemoveStubsMojo class.
30 | *
31 | * @author Keegan Witt
32 | */
33 | public class RemoveTestStubsMojoTest {
34 | private RemoveTestStubsMojo removeTestStubsMojo;
35 | private static final String PATH = "FAKE_PATH";
36 | private MavenProject project;
37 |
38 | @Before
39 | public void setup() {
40 | removeTestStubsMojo = new RemoveTestStubsMojo();
41 | project = new MavenProject();
42 | removeTestStubsMojo.project = project;
43 | removeTestStubsMojo.testStubsOutputDirectory = new File(PATH);
44 | }
45 |
46 | @Test
47 | public void testRemoveTestSourcePathContainsPath() {
48 | project.addTestCompileSourceRoot(removeTestStubsMojo.testStubsOutputDirectory.getAbsolutePath());
49 | assertEquals(1, project.getTestCompileSourceRoots().size());
50 | removeTestStubsMojo.execute();
51 | assertEquals(0, project.getTestCompileSourceRoots().size());
52 | }
53 |
54 | @Test
55 | public void testRemoveTestSourcePathNotContainsPath() {
56 | assertEquals(0, project.getCompileSourceRoots().size());
57 | removeTestStubsMojo.execute();
58 | assertEquals(0, project.getTestCompileSourceRoots().size());
59 | }
60 |
61 | @Test
62 | public void testDoesNothingWhenSkipFlagIsSet() {
63 | project.addTestCompileSourceRoot(removeTestStubsMojo.testStubsOutputDirectory.getAbsolutePath());
64 | removeTestStubsMojo.skipTests = true;
65 | removeTestStubsMojo.execute();
66 | assertEquals(1, project.getTestCompileSourceRoots().size());
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/test/java/org/codehaus/gmavenplus/util/FileUtilsTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.codehaus.gmavenplus.util;
18 |
19 | import org.junit.Test;
20 |
21 | import java.io.*;
22 |
23 | import static org.junit.Assert.assertEquals;
24 | import static org.mockito.Mockito.doThrow;
25 | import static org.mockito.Mockito.mock;
26 |
27 |
28 | /**
29 | * Unit tests for the FileUtils class.
30 | *
31 | * @author Keegan Witt
32 | */
33 | public class FileUtilsTest {
34 | private static final IOException ioException = new IOException("Intentionally blowing up.");
35 |
36 | @Test
37 | public void testGetFileExtension() {
38 | assertEquals("gz", FileUtils.getFileExtension("foo.tar.gz"));
39 | }
40 |
41 | @Test
42 | public void testGetNameWithoutExtension() {
43 | assertEquals("foo.tar", FileUtils.getNameWithoutExtension("foo.tar.gz"));
44 | }
45 |
46 | @Test
47 | public void testCloseInputStreamQuietly() throws Exception {
48 | InputStream inputStream = mock(InputStream.class);
49 | doThrow(ioException).when(inputStream).close();
50 | FileUtils.closeQuietly(inputStream);
51 | }
52 |
53 | @Test
54 | public void testCloseOutputStreamQuietly() throws Exception {
55 | OutputStream outputStream = mock(OutputStream.class);
56 | doThrow(ioException).when(outputStream).close();
57 | FileUtils.closeQuietly(outputStream);
58 | }
59 |
60 | @Test
61 | public void testCloseReaderQuietly() throws Exception {
62 | Reader reader = mock(Reader.class);
63 | doThrow(ioException).when(reader).close();
64 | FileUtils.closeQuietly(reader);
65 | }
66 |
67 | @Test
68 | public void testCloseWriterQuietly() throws Exception {
69 | Writer writer = mock(Writer.class);
70 | doThrow(ioException).when(writer).close();
71 | FileUtils.closeQuietly(writer);
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/test/resources/testScript.groovy:
--------------------------------------------------------------------------------
1 | new File("target/testFile.txt").withWriter { w ->
2 | w << "Hello world!"
3 | }
4 |
--------------------------------------------------------------------------------