├── .gitignore
├── .travis.yml
├── LICENSE.txt
├── README.md
├── pom.xml
├── site-deploy.sh
└── src
├── it
├── basicTest
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── basicWithPropertiesTest
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── contentTest
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── directoryIteratorTest
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── soebes
│ │ │ │ │ └── maven
│ │ │ │ │ └── multiple
│ │ │ │ │ ├── first
│ │ │ │ │ └── App.java
│ │ │ │ │ ├── second
│ │ │ │ │ └── App.java
│ │ │ │ │ └── third
│ │ │ │ │ └── App.java
│ │ │ └── resources
│ │ │ │ └── log4j.properties
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── soebes
│ │ │ └── maven
│ │ │ └── multiple
│ │ │ └── configuration
│ │ │ └── AppTest.java
│ └── verify.groovy
├── exec-maven-pluginTest
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── soebes
│ │ │ └── test
│ │ │ └── Main.java
│ └── verify.groovy
├── failAtEndTest
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── soebes
│ │ │ └── test
│ │ │ └── MainIT.java
│ └── verify.groovy
├── failTest
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── soebes
│ │ │ └── test
│ │ │ └── MainIT.java
│ └── verify.groovy
├── invokerBasicTest
│ ├── configurations
│ │ ├── one
│ │ │ └── pom.xml
│ │ ├── three
│ │ │ └── pom.xml
│ │ └── two
│ │ │ └── pom.xml
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── invokerSkipTest
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── itemsFromCLITest
│ ├── invoker.properties
│ ├── pom.xml
│ ├── test.properties
│ └── verify.groovy
├── iteratorSkipTest
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── mavenAssemblyPluginTest
│ ├── dev.xml
│ ├── invoker.properties
│ ├── pom.xml
│ ├── prod.xml
│ ├── src
│ │ ├── main
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── soebes
│ │ │ │ │ └── maven
│ │ │ │ │ └── multiple
│ │ │ │ │ └── configuration
│ │ │ │ │ └── App.java
│ │ │ ├── resources
│ │ │ │ └── log4j.properties
│ │ │ └── webapp
│ │ │ │ └── WEB-INF
│ │ │ │ ├── applicationContext.xml
│ │ │ │ ├── faces-config.xml
│ │ │ │ ├── jsf
│ │ │ │ ├── body.xhtml
│ │ │ │ ├── footer.xhtml
│ │ │ │ ├── header.xhtml
│ │ │ │ └── template.xhtml
│ │ │ │ └── web.xml
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── soebes
│ │ │ └── maven
│ │ │ └── multiple
│ │ │ └── configuration
│ │ │ └── AppTest.java
│ ├── test.xml
│ └── verify.groovy
├── mavenAssemblyPluginWithPropertiesTest
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ ├── assembly
│ │ │ └── archive.xml
│ │ ├── main
│ │ │ ├── environment
│ │ │ │ ├── dev
│ │ │ │ │ └── server.properties
│ │ │ │ ├── production
│ │ │ │ │ └── server.properties
│ │ │ │ ├── qa
│ │ │ │ │ └── server.properties
│ │ │ │ └── test
│ │ │ │ │ └── server.properties
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── soebes
│ │ │ │ │ └── maven
│ │ │ │ │ └── multiple
│ │ │ │ │ └── configuration
│ │ │ │ │ └── App.java
│ │ │ ├── resources
│ │ │ │ └── log4j.properties
│ │ │ └── webapp
│ │ │ │ └── WEB-INF
│ │ │ │ ├── applicationContext.xml
│ │ │ │ ├── faces-config.xml
│ │ │ │ ├── jsf
│ │ │ │ ├── body.xhtml
│ │ │ │ ├── footer.xhtml
│ │ │ │ ├── header.xhtml
│ │ │ │ └── template.xhtml
│ │ │ │ └── web.xml
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── soebes
│ │ │ └── maven
│ │ │ └── multiple
│ │ │ └── configuration
│ │ │ └── AppTest.java
│ └── verify.groovy
├── mavenAssemblySharedDescriptorTest
│ ├── dist
│ │ ├── pom.xml
│ │ └── proj1-assembly.xml
│ ├── package-1
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── soebes
│ │ │ │ └── maven
│ │ │ │ └── multiple
│ │ │ │ └── configuration
│ │ │ │ └── App.java
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── soebes
│ │ │ └── maven
│ │ │ └── multiple
│ │ │ └── configuration
│ │ │ └── AppTest.java
│ ├── package-2
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── soebes
│ │ │ │ └── maven
│ │ │ │ └── multiple
│ │ │ │ └── configuration
│ │ │ │ └── App.java
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── soebes
│ │ │ └── maven
│ │ │ └── multiple
│ │ │ └── configuration
│ │ │ └── AppTest.java
│ ├── pom.xml
│ └── shared
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ └── resources
│ │ └── assemblies
│ │ └── package.xml
├── outputWithoutDebugTest
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── pluginConfigurationFromPluginManagementTest
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── pluginVersionFromPluginManagementTest
│ ├── invoker.properties
│ ├── pom.xml
│ └── verify.groovy
├── settings.xml
└── setup
│ ├── invoker.properties
│ └── pom.xml
├── main
└── java
│ └── com
│ └── soebes
│ └── maven
│ └── plugins
│ └── iterator
│ ├── AbstractInvokerMojo.java
│ ├── AbstractIteratorMojo.java
│ ├── InvokerMojo.java
│ ├── ItemWithProperties.java
│ ├── IteratorMojo.java
│ ├── OutputConsumer.java
│ └── PluginExecutor.java
├── site
├── apt
│ ├── index.apt.vm
│ ├── invoker-overview.apt.vm
│ ├── invoker.apt.vm
│ ├── iterator-folder.apt.vm
│ ├── iterator-overview.apt.vm
│ └── iterator-property.apt.vm
├── resources
│ └── attached-includes
│ │ └── css
│ │ ├── shCoreDefault.css
│ │ └── shCoreDefault.css.gz
└── site.xml
└── test
├── groovy
└── IntegrationBase.groovy
└── java
└── com
└── soebes
└── maven
└── plugins
└── iterator
├── AbstractInvokerMojoTest.java
├── AbstractIteratorMojoTest.java
├── ExecutorMojoTest.java
└── ItemWithPropertiesTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | nbactions.xml
4 | .settings
5 | target
6 | test-output
7 | *.iml
8 | .idea
9 | *~
10 | /bin/
11 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | # Enable container-based infrastructure
3 | # see http://docs.travis-ci.com/user/workers/container-based-infrastructure/
4 | sudo: false
5 | jdk:
6 | - oraclejdk8
7 | - openjdk9
8 | - openjdk10
9 | - openjdk11
10 | cache:
11 | directories:
12 | - $HOME/.m2/repository
13 | # Just skip installation step
14 | # cause everything is done
15 | # in script step.
16 | env:
17 | - MAVEN_VERSION=3.6.0
18 |
19 | install:
20 | - "mvn -N io.takari:maven:wrapper -Dmaven=${MAVEN_VERSION}"
21 |
22 | script:
23 | - "./mvnw --show-version --errors --batch-mode -Prun-its clean verify"
24 |
--------------------------------------------------------------------------------
/site-deploy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | #
20 |
21 | # generate output which is used during site generation
22 | mvn -Prun-its clean verify
23 | mvn site site:stage scm-publish:publish-scm
24 |
--------------------------------------------------------------------------------
/src/it/basicTest/invoker.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 |
18 | invoker.name = Basic Test
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.debug = true
23 |
24 | debug = true
25 |
--------------------------------------------------------------------------------
/src/it/basicTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | basic-test
37 | 0.1-SNAPSHOT
38 |
39 | iterator-maven-plugin BasicTest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | org.apache.maven.plugins
55 | maven-surefire-plugin
56 |
57 |
58 | org.apache.maven.plugins
59 | maven-compiler-plugin
60 |
61 |
62 |
63 |
64 |
65 |
66 | @project.groupId@
67 | @project.artifactId@
68 | @project.version@
69 |
70 |
71 | package
72 |
73 | iterator
74 |
75 |
76 |
77 | - eins
78 | - zwei
79 | - drei
80 |
81 |
82 |
83 |
84 | com.soebes.maven.plugins
85 | maven-echo-plugin
86 | 0.1
87 |
88 | echo
89 |
90 |
91 | This is a message: @item@
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/src/it/basicTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 |
47 | t.checkExistenceAndContentOfAFile(buildLogFile, [
48 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':iterator (default) @ basic-test ---',
49 | '[INFO] ------ (eins) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
50 | '[INFO] This is a message: eins',
51 | '[INFO] ------ (zwei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
52 | '[INFO] This is a message: zwei',
53 | '[INFO] ------ (drei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
54 | '[INFO] This is a message: drei',
55 | '[INFO] BUILD SUCCESS',
56 | ])
57 |
58 |
59 | return true;
60 |
--------------------------------------------------------------------------------
/src/it/basicWithPropertiesTest/invoker.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 |
18 | invoker.name = Basic With Properties Test
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.debug = true
23 |
--------------------------------------------------------------------------------
/src/it/basicWithPropertiesTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 |
47 | t.checkExistenceAndContentOfAFile(buildLogFile, [
48 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':iterator (default) @ basic-with-properties-test ---',
49 | '[INFO] ------ (eins) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
50 | '[INFO] This is a message: item: eins Prop: First',
51 | '[INFO] ------ (zwei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
52 | '[INFO] This is a message: item: zwei Prop: Second',
53 | '[INFO] ------ (drei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
54 | '[INFO] This is a message: item: drei Prop: Third',
55 | '[INFO] BUILD SUCCESS',
56 | ])
57 |
58 |
59 | return true;
60 |
--------------------------------------------------------------------------------
/src/it/contentTest/invoker.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 |
18 | invoker.name = Basic Test
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.debug = true
23 |
24 | debug = true
25 |
--------------------------------------------------------------------------------
/src/it/contentTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | content-test
37 | 0.1-SNAPSHOT
38 |
39 | iterator-maven-plugin contentTest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 | @project.groupId@
54 | @project.artifactId@
55 | @project.version@
56 |
57 |
58 | package
59 |
60 | iterator
61 |
62 |
63 | eins, zwei, drei
64 |
65 |
66 |
67 | com.soebes.maven.plugins
68 | maven-echo-plugin
69 | 0.1
70 |
71 | echo
72 |
73 |
74 | This is a message: @item@
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/src/it/contentTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 |
47 | t.checkExistenceAndContentOfAFile(buildLogFile, [
48 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':iterator (default) @ content-test ---',
49 | '[INFO] ------ (eins) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
50 | '[INFO] This is a message: eins',
51 | '[INFO] ------ (zwei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
52 | '[INFO] This is a message: zwei',
53 | '[INFO] ------ (drei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
54 | '[INFO] This is a message: drei',
55 | '[INFO] BUILD SUCCESS',
56 | ])
57 |
58 |
59 | return true;
60 |
--------------------------------------------------------------------------------
/src/it/directoryIteratorTest/invoker.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 |
18 | invoker.name = outputWithoutDebug Test
19 |
20 | invoker.goals = clean package
21 |
--------------------------------------------------------------------------------
/src/it/directoryIteratorTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | directoryIteratorTest
37 | 0.1-SNAPSHOT
38 |
39 | Iterator Executor Invoker Maven Plugin directoryIteratorTest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | @project.groupId@
57 | @project.artifactId@
58 | @project.version@
59 |
60 |
61 | package
62 |
63 | iterator
64 |
65 |
66 | src/main/java/com/soebes/maven/multiple/
67 |
68 |
69 |
70 | com.soebes.maven.plugins
71 | maven-echo-plugin
72 |
73 | echo
74 |
75 |
76 | This is a message: @item@
77 |
78 |
79 |
80 |
81 |
82 | org.apache.maven.plugins
83 | maven-jar-plugin
84 |
85 | jar
86 |
87 |
88 | com/soebes/maven/multiple/@item@/**
89 |
90 | @item@
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/src/it/directoryIteratorTest/src/main/java/com/soebes/maven/multiple/first/App.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.first;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 | public static void main( String[] args )
29 | {
30 | System.out.println( "First App!" );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/it/directoryIteratorTest/src/main/java/com/soebes/maven/multiple/second/App.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.second;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 | public static void main( String[] args )
29 | {
30 | System.out.println( "Second App!" );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/it/directoryIteratorTest/src/main/java/com/soebes/maven/multiple/third/App.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.third;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 | public static void main( String[] args )
29 | {
30 | System.out.println( "Third App!" );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/it/directoryIteratorTest/src/main/resources/log4j.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 |
18 | TEST
19 |
--------------------------------------------------------------------------------
/src/it/directoryIteratorTest/src/test/java/com/soebes/maven/multiple/configuration/AppTest.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import junit.framework.Test;
23 | import junit.framework.TestCase;
24 | import junit.framework.TestSuite;
25 |
26 | /**
27 | * Unit test for simple App.
28 | */
29 | public class AppTest
30 | extends TestCase
31 | {
32 | /**
33 | * Create the test case
34 | *
35 | * @param testName name of the test case
36 | */
37 | public AppTest( String testName )
38 | {
39 | super( testName );
40 | }
41 |
42 | /**
43 | * @return the suite of tests being tested
44 | */
45 | public static Test suite()
46 | {
47 | return new TestSuite( AppTest.class );
48 | }
49 |
50 | /**
51 | * Rigourous Test :-)
52 | */
53 | public void testApp()
54 | {
55 | assertTrue( true );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/it/directoryIteratorTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 | def getProjectVersion() {
27 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
28 |
29 | def allPlugins = pom.build.plugins.plugin;
30 |
31 | def configurationMavenPlugin = allPlugins.find { item ->
32 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
33 | }
34 |
35 | return configurationMavenPlugin.version;
36 | }
37 |
38 | def projectVersion = getProjectVersion();
39 |
40 | println "Project version: ${projectVersion}"
41 |
42 | def currentFolder = new File(basedir, ".").getCanonicalPath() + "/";
43 |
44 | def logFileInput = new File(basedir, "build.log")
45 |
46 | t.checkExistenceAndContentOfAFile(logFileInput, [
47 | '[INFO] --- iterator-maven-plugin:' + projectVersion + ':iterator (default) @ directoryIteratorTest ---',
48 | '[INFO] ------ (first) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
49 | '[INFO] This is a message: first',
50 | '[INFO] ------ (second) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
51 | '[INFO] This is a message: second',
52 | '[INFO] ------ (third) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
53 | '[INFO] This is a message: third',
54 | '[INFO] BUILD SUCCESS',
55 | ])
56 |
57 | return true;
58 |
--------------------------------------------------------------------------------
/src/it/exec-maven-pluginTest/invoker.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 |
18 | invoker.name = exec maven plugin Test
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.debug = true
23 |
--------------------------------------------------------------------------------
/src/it/exec-maven-pluginTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | exec-maven-plugin-test
37 | 0.1-SNAPSHOT
38 |
39 | iterator-maven-plugin Exec Maven Plugin
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 | org.apache.commons
50 | commons-lang3
51 | 3.4
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | @project.groupId@
60 | @project.artifactId@
61 | @project.version@
62 |
63 |
64 |
65 | iterator
66 |
67 |
68 |
69 | - 1
70 | - 2
71 | - 3
72 |
73 |
74 |
75 |
76 | org.codehaus.mojo
77 | exec-maven-plugin
78 |
79 | java
80 |
81 | com.soebes.test.Main
82 |
83 | @item@
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/src/it/exec-maven-pluginTest/src/main/java/com/soebes/test/Main.java:
--------------------------------------------------------------------------------
1 | package com.soebes.test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.lang3.StringUtils;
23 |
24 | public final class Main {
25 |
26 | public static void main(String[] args) {
27 | System.out.println("Argument is : " + StringUtils.leftPad(args[0], 3, '0'));
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/exec-maven-pluginTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 |
47 | t.checkExistenceAndContentOfAFile(buildLogFile, [
48 | 'Argument is : 001',
49 | 'Argument is : 002',
50 | 'Argument is : 003',
51 | ])
52 |
53 |
54 | return true;
55 |
--------------------------------------------------------------------------------
/src/it/failAtEndTest/invoker.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 |
18 | invoker.name = Fail At End
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.buildResult = failure
23 |
24 | invoker.debug = true
25 |
--------------------------------------------------------------------------------
/src/it/failAtEndTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | fail-the-whole-test
36 | 0.1-SNAPSHOT
37 |
38 | iterator-maven-plugin Fail The Whole If One Iteration Fails
39 | http://www.soebes.de
40 |
41 |
42 |
43 | junit
44 | junit
45 | test
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @project.groupId@
54 | @project.artifactId@
55 | @project.version@
56 |
57 |
58 |
59 | invoker
60 |
61 |
62 | true
63 |
64 | - 1
65 | - 2
66 | - 3
67 |
68 |
69 | surefire:anton -Dargument=@item@
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/src/it/failAtEndTest/src/test/java/com/soebes/test/MainIT.java:
--------------------------------------------------------------------------------
1 | package com.soebes.test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.junit.Test;
23 |
24 | import junit.framework.Assert;
25 |
26 | public class MainIT
27 | {
28 |
29 | @Test
30 | public void firstTest()
31 | {
32 | Assert.assertEquals( "2", System.getProperty( "argument" ) );
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/it/failAtEndTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 |
47 | t.checkExistenceAndContentOfAFile(buildLogFile, [
48 | '[INFO] ------ iterator-maven-plugin ( iteration: 1 )',
49 | '[ERROR] ------ Maven call was NOT Ok. for iteration 1 ( return code: 1 )',
50 | '[INFO] ------ iterator-maven-plugin ( iteration: 2 )',
51 | '[ERROR] ------ Maven call was NOT Ok. for iteration 2 ( return code: 1 )',
52 | '[INFO] ------ iterator-maven-plugin ( iteration: 3 )',
53 | '[ERROR] ------ Maven call was NOT Ok. for iteration 3 ( return code: 1 )',
54 | 'java.lang.RuntimeException: Maven call failed with return code 1 for iteration: 1',
55 | 'java.lang.RuntimeException: Maven call failed with return code 1 for iteration: 2',
56 | 'java.lang.RuntimeException: Maven call failed with return code 1 for iteration: 3',
57 | '[INFO] BUILD FAILURE',
58 | ])
59 |
60 |
61 | return true;
62 |
--------------------------------------------------------------------------------
/src/it/failTest/invoker.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 |
18 | invoker.name = Fail Test
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.buildResult = failure
23 |
24 | invoker.debug = true
25 |
--------------------------------------------------------------------------------
/src/it/failTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | fail--test
36 | 0.1-SNAPSHOT
37 |
38 | iterator-maven-plugin Fail Test
39 | http://www.soebes.de
40 |
41 |
42 |
43 | junit
44 | junit
45 | test
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @project.groupId@
54 | @project.artifactId@
55 | @project.version@
56 |
57 |
58 |
59 | invoker
60 |
61 |
62 |
63 | - 1
64 | - 2
65 | - 3
66 |
67 |
68 | surefire:anton -Dargument=@item@
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/src/it/failTest/src/test/java/com/soebes/test/MainIT.java:
--------------------------------------------------------------------------------
1 | package com.soebes.test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.junit.Test;
23 |
24 | import junit.framework.Assert;
25 |
26 | public class MainIT
27 | {
28 |
29 | @Test
30 | public void firstTest()
31 | {
32 | Assert.assertEquals( "2", System.getProperty( "argument" ) );
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/it/failTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 | //This test is currently not very sure.
47 | //Checking the existence of those lines is ok,
48 | //but we should check the non existinence of
49 | //some other lines to make 100% sure this works
50 | //as expected.
51 | //TODO: Think about this.
52 | t.checkExistenceAndContentOfAFile(buildLogFile, [
53 | '[INFO] ------ iterator-maven-plugin ( iteration: 1 )',
54 | '[ERROR] ------ Maven call was NOT Ok. for iteration 1 ( return code: 1 )',
55 | '[INFO] [INFO] BUILD FAILURE',
56 | "[INFO] [ERROR] Could not find goal 'anton' in plugin org.apache.maven.plugins:maven-surefire-plugin:2.18.1 among available goals help, test -> [Help 1]",
57 | '[INFO] BUILD FAILURE',
58 | ])
59 |
60 | def result = false
61 | buildLogFile.eachLine { file_content, file_line ->
62 | if (file_content.equals('[INFO] ------ iterator-maven-plugin ( iteration: 2 )')) {
63 | result = true
64 | }
65 | }
66 |
67 | if (result) {
68 | //We have found a line which shouldn't be existing!
69 | return false
70 | }
71 | return true;
72 |
--------------------------------------------------------------------------------
/src/it/invokerBasicTest/configurations/one/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 | com.soebes.maven.plugins.test.integration
30 | invoker-basic-test-1
31 | 0.1-SNAPSHOT
32 |
33 | itexin-maven-plugin InvokerBasicTest-1
34 | http://www.soebes.de
35 |
36 |
37 | UTF-8
38 |
39 |
40 |
41 |
42 | junit
43 | junit
44 | 4.8
45 | test
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | org.apache.maven.plugins
54 | maven-surefire-plugin
55 | 2.10
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/src/it/invokerBasicTest/configurations/three/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 | com.soebes.maven.plugins.test.integration
30 | invoker-basic-test-3
31 | 0.1-SNAPSHOT
32 |
33 | itexin-maven-plugin InvokerBasicTest-3
34 | http://www.soebes.de
35 |
36 |
37 | UTF-8
38 |
39 |
40 |
41 |
42 | junit
43 | junit
44 | 4.8
45 | test
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | org.apache.maven.plugins
54 | maven-surefire-plugin
55 | 2.10
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/src/it/invokerBasicTest/configurations/two/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 | com.soebes.maven.plugins.test.integration
30 | invoker-basic-test-2
31 | 0.1-SNAPSHOT
32 |
33 | itexin-maven-plugin InvokerBasicTest-2
34 | http://www.soebes.de
35 |
36 |
37 | UTF-8
38 |
39 |
40 |
41 |
42 | junit
43 | junit
44 | 4.8
45 | test
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | org.apache.maven.plugins
54 | maven-surefire-plugin
55 | 2.10
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/src/it/invokerBasicTest/invoker.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 |
18 | invoker.name = Invoker Basic Test
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.debug = false
23 |
--------------------------------------------------------------------------------
/src/it/invokerBasicTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | invoker-basic-test
37 | 0.1-SNAPSHOT
38 |
39 | iterator-maven-plugin InvokerBasicTest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | @project.groupId@
55 | @project.artifactId@
56 | @project.version@
57 |
58 |
59 | package
60 |
61 | invoker
62 |
63 |
64 |
65 | - one
66 | - two
67 | - three
68 |
69 | configurations/@item@
70 |
71 | clean
72 | package
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/src/it/invokerBasicTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("itexin-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 |
47 | t.checkExistenceAndContentOfAFile(buildLogFile, [
48 | '[INFO] ------ iterator-maven-plugin ( iteration: one )',
49 | '[INFO] [INFO] Building itexin-maven-plugin InvokerBasicTest-1 0.1-SNAPSHOT',
50 | '[INFO] ------ iterator-maven-plugin ( iteration: two )',
51 | '[INFO] [INFO] Building itexin-maven-plugin InvokerBasicTest-2 0.1-SNAPSHOT',
52 | '[INFO] ------ iterator-maven-plugin ( iteration: three )',
53 | '[INFO] [INFO] Building itexin-maven-plugin InvokerBasicTest-3 0.1-SNAPSHOT',
54 | ])
55 |
56 |
57 | return true;
58 |
--------------------------------------------------------------------------------
/src/it/invokerSkipTest/invoker.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 |
18 | invoker.name = Invoker Skip Test
19 |
20 | invoker.goals = -Diterator.skip=true clean package
21 |
22 |
--------------------------------------------------------------------------------
/src/it/invokerSkipTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | invoker-skip-test
37 | 0.1-SNAPSHOT
38 |
39 | iterator-maven-plugin Inovker Skip Test
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | org.apache.maven.plugins
55 | maven-surefire-plugin
56 |
57 |
58 | org.apache.maven.plugins
59 | maven-compiler-plugin
60 |
61 |
62 |
63 |
64 |
65 |
66 | @project.groupId@
67 | @project.artifactId@
68 | @project.version@
69 |
70 |
71 | package
72 |
73 | invoker
74 |
75 |
76 |
77 | - one
78 | - two
79 | - three
80 |
81 | configurations/@item@
82 |
83 | clean
84 | package
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/src/it/invokerSkipTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 | t.checkExistenceAndContentOfAFile(buildLogFile, [
47 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':invoker (default) @ invoker-skip-test ---',
48 | '[INFO] Skip by user request.',
49 | '[INFO] BUILD SUCCESS',
50 | ])
51 |
52 |
53 | return true;
54 |
--------------------------------------------------------------------------------
/src/it/itemsFromCLITest/invoker.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 |
18 | invoker.name = Basic Test
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.systemPropertiesFile=test.properties
23 |
24 | invoker.debug = true
25 |
26 | debug = true
27 |
--------------------------------------------------------------------------------
/src/it/itemsFromCLITest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | items-from-cli-test
37 | 0.1-SNAPSHOT
38 |
39 | iterator-maven-plugin ItemsFromCLITest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | @project.groupId@
55 | @project.artifactId@
56 | @project.version@
57 |
58 |
59 | package
60 |
61 | iterator
62 |
63 |
64 |
65 |
66 | - eins
67 | - drei
68 | - zwei
69 |
70 |
71 |
72 |
73 | com.soebes.maven.plugins
74 | maven-echo-plugin
75 | 0.1
76 |
77 | echo
78 |
79 |
80 | This is a message: @item@
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/src/it/itemsFromCLITest/test.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 |
18 | iterator.items=zwei,mal,drei,macht,vier
19 |
--------------------------------------------------------------------------------
/src/it/itemsFromCLITest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find {
33 | item -> item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 |
47 | t.checkExistenceAndContentOfAFile(buildLogFile, [
48 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':iterator (default) @ items-from-cli-test ---',
49 | '[INFO] ------ (zwei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
50 | '[INFO] This is a message: zwei',
51 | '[INFO] ------ (mal) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
52 | '[INFO] This is a message: mal',
53 | '[INFO] ------ (drei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
54 | '[INFO] This is a message: drei',
55 | '[INFO] ------ (macht) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
56 | '[INFO] This is a message: macht',
57 | '[INFO] ------ (vier) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
58 | '[INFO] This is a message: vier',
59 | '[INFO] BUILD SUCCESS',
60 | ])
61 |
62 |
63 | return true;
64 |
--------------------------------------------------------------------------------
/src/it/iteratorSkipTest/invoker.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 |
18 | invoker.name = Iterator Skip Test
19 |
20 | invoker.goals = -Diterator.skip=true clean package
21 |
22 |
--------------------------------------------------------------------------------
/src/it/iteratorSkipTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | iterator-skip-test
37 | 0.1-SNAPSHOT
38 |
39 | iterator-maven-plugin Iterator Skip Test
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | org.apache.maven.plugins
55 | maven-surefire-plugin
56 |
57 |
58 | org.apache.maven.plugins
59 | maven-compiler-plugin
60 |
61 |
62 |
63 |
64 |
65 |
66 | @project.groupId@
67 | @project.artifactId@
68 | @project.version@
69 |
70 |
71 | package
72 |
73 | iterator
74 |
75 |
76 |
77 | - eins
78 | - zwei
79 | - drei
80 |
81 |
82 |
83 |
84 | com.soebes.maven.plugins
85 | maven-echo-plugin
86 | 0.1
87 |
88 | echo
89 |
90 |
91 | This is a message: @item@
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/src/it/iteratorSkipTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 |
44 | def buildLogFile = new File( basedir, "build.log");
45 |
46 | t.checkExistenceAndContentOfAFile(buildLogFile, [
47 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':iterator (default) @ iterator-skip-test ---',
48 | '[INFO] Skip by user request.',
49 | '[INFO] BUILD SUCCESS',
50 | ])
51 |
52 |
53 | return true;
54 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/dev.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
24 |
25 | dev
26 |
27 | war
28 |
29 | false
30 |
31 |
32 | true
33 | true
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/invoker.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 |
18 | invoker.name = outputWithoutDebug Test
19 |
20 | invoker.goals = clean package
21 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | mavenAssemblyTest
37 | 0.1-SNAPSHOT
38 |
39 | Iterator Executor Invoker Maven Plugin mavenAssemblyTest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | @project.groupId@
57 | @project.artifactId@
58 | @project.version@
59 |
60 |
61 | package
62 |
63 | iterator
64 |
65 |
66 |
67 | - test
68 | - prod
69 | - dev
70 |
71 |
72 |
73 |
74 |
75 | org.apache.maven.plugins
76 | maven-assembly-plugin
77 | 2.5.2
78 |
79 | single
80 |
81 |
82 | ${project.basedir}/@item@.xml
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/prod.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
24 |
25 | prod
26 |
27 | war
28 |
29 | false
30 |
31 |
32 | true
33 | true
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/main/java/com/soebes/maven/multiple/configuration/App.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 | public static void main( String[] args )
29 | {
30 | System.out.println( "Hello World!" );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/main/resources/log4j.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 |
18 | TEST
19 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/main/webapp/WEB-INF/applicationContext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
24 |
25 |
28 |
31 |
34 |
35 |
36 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/main/webapp/WEB-INF/faces-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 |
41 |
42 |
48 |
49 |
50 | com.sun.facelets.FaceletViewHandler
51 | org.springframework.web.jsf.el.SpringBeanFacesELResolver
52 |
53 |
54 | testBean
55 | com.soebes.supose.release.web.TestSession
56 | session
57 |
58 |
59 |
60 | repositoryBean
61 | com.soebes.supose.release.web.RepositoryBean
62 | session
63 |
64 |
65 |
66 |
67 | /index.xhtml
68 |
69 | SUCCESS
70 | /result.xhtml
71 |
72 |
73 | ERROR
74 | /error.xhtml
75 |
76 |
77 |
78 | /result.xhtml
79 |
80 | SUCCESS
81 | /index.xhtml
82 |
83 |
84 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/main/webapp/WEB-INF/jsf/body.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/main/webapp/WEB-INF/jsf/footer.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
26 |
27 |
28 |
29 |
30 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/main/webapp/WEB-INF/jsf/header.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
26 |
27 |
28 |
29 | SupoSE
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/main/webapp/WEB-INF/jsf/template.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/src/test/java/com/soebes/maven/multiple/configuration/AppTest.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import junit.framework.Test;
23 | import junit.framework.TestCase;
24 | import junit.framework.TestSuite;
25 |
26 | /**
27 | * Unit test for simple App.
28 | */
29 | public class AppTest
30 | extends TestCase
31 | {
32 | /**
33 | * Create the test case
34 | *
35 | * @param testName name of the test case
36 | */
37 | public AppTest( String testName )
38 | {
39 | super( testName );
40 | }
41 |
42 | /**
43 | * @return the suite of tests being tested
44 | */
45 | public static Test suite()
46 | {
47 | return new TestSuite( AppTest.class );
48 | }
49 |
50 | /**
51 | * Rigourous Test :-)
52 | */
53 | public void testApp()
54 | {
55 | assertTrue( true );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/test.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
24 |
25 | test
26 |
27 | war
28 |
29 | false
30 |
31 |
32 | true
33 | true
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 |
27 | def getProjectVersion() {
28 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
29 |
30 | def allPlugins = pom.build.plugins.plugin;
31 |
32 | def configurationMavenPlugin = allPlugins.find { item ->
33 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
34 | }
35 |
36 | return configurationMavenPlugin.version;
37 | }
38 |
39 | def projectVersion = getProjectVersion();
40 |
41 | println "Project version: ${projectVersion}"
42 |
43 | def currentFolder = new File(basedir, ".").getCanonicalPath() + "/";
44 |
45 | def logFileInput = new File(basedir, "build.log")
46 |
47 | new File(basedir, "build-filtered.log").withWriter { out ->
48 | logFileInput.eachLine { line ->
49 |
50 | if (line.contains(currentFolder)) {
51 | line = line.replace(currentFolder, "/home/iterator/");
52 | }
53 |
54 | if ( !line.startsWith("Download: ")
55 | && !line.startsWith("Downloaded: ")
56 | && !line.startsWith("Downloading: ")
57 | && !line.startsWith("[INFO] Downloaded: ")
58 | && !line.startsWith("[INFO] Downloading: ")
59 | && !line.startsWith(" wagon http use")
60 | && !line.startsWith("Running post-build")
61 | && !line.startsWith("Finished post-build ")
62 | && !line.startsWith("Project version:")) {
63 | out.println line;
64 | }
65 | }
66 | }
67 |
68 |
69 | t.checkExistenceAndContentOfAFile(logFileInput, [
70 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':iterator (default) @ mavenAssemblyTest ---',
71 | '[INFO] ------ (test) org.apache.maven.plugins:maven-assembly-plugin:2.5.2:single',
72 | '[INFO] ------ (dev) org.apache.maven.plugins:maven-assembly-plugin:2.5.2:single',
73 | '[INFO] ------ (prod) org.apache.maven.plugins:maven-assembly-plugin:2.5.2:single',
74 | '[INFO] Reading assembly descriptor: ' + basedir + '/test.xml',
75 | '[INFO] Building war: ' + basedir + t.convertPathIntoPlatform('/target/mavenAssemblyTest-0.1-SNAPSHOT-test.war'),
76 | '[INFO] Reading assembly descriptor: ' + basedir + '/dev.xml',
77 | '[INFO] Building war: ' + basedir + t.convertPathIntoPlatform('/target/mavenAssemblyTest-0.1-SNAPSHOT-dev.war'),
78 | '[INFO] Reading assembly descriptor: ' + basedir + '/prod.xml',
79 | '[INFO] Building war: ' + basedir + t.convertPathIntoPlatform('/target/mavenAssemblyTest-0.1-SNAPSHOT-prod.war'),
80 | '[INFO] BUILD SUCCESS',
81 | ])
82 | def test_war = new File (basedir, "/target/mavenAssemblyTest-0.1-SNAPSHOT-test.war");
83 | if (!test_war.exists()) {
84 | throw new FileNotFoundException("The file " + test_war + " does not exist!");
85 | }
86 | def dev_war = new File (basedir, "/target/mavenAssemblyTest-0.1-SNAPSHOT-dev.war");
87 | if (!dev_war.exists()) {
88 | throw new FileNotFoundException("The file " + dev_war + " does not exist!");
89 | }
90 | def prod_war = new File (basedir, "/target/mavenAssemblyTest-0.1-SNAPSHOT-prod.war");
91 | if (!prod_war.exists()) {
92 | throw new FileNotFoundException("The file " + prod_war + " does not exist!");
93 | }
94 |
95 |
96 | return true;
97 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/invoker.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 |
18 | invoker.name = outputWithoutDebug Test
19 |
20 | invoker.goals = clean package
21 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | mavenAssemblyPluginWithPropertiesTest
37 | 0.1-SNAPSHOT
38 |
39 | war
40 |
41 | Iterator Executor Invoker Maven Plugin mavenAssemblyPluginWithPropertiesTest
42 | http://www.soebes.de
43 |
44 |
45 |
46 | junit
47 | junit
48 | test
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | @project.groupId@
57 | @project.artifactId@
58 | @project.version@
59 |
60 |
61 | package
62 |
63 | iterator
64 |
65 |
66 |
67 | - dev
68 | - test
69 | - production
70 | - qa
71 |
72 |
73 |
74 |
75 |
76 | org.apache.maven.plugins
77 | maven-assembly-plugin
78 | 2.5.2
79 |
80 | single
81 |
82 |
83 | ${project.basedir}/src/assembly/archive.xml
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/assembly/archive.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
26 |
27 | ${item}
28 |
29 | war
30 |
31 | false
32 |
33 |
34 | true
35 | true
36 |
37 |
38 |
39 |
40 | WEB-INF
41 | ${basedir}/src/main/environment/${item}/
42 |
43 | **
44 |
45 |
46 |
47 | WEB-INF
48 | ${project.build.directory}/environment/${item}/
49 |
50 | **
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/environment/dev/server.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 |
18 | server=http://www.dev-server.com
19 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/environment/production/server.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 |
18 | server=http://www.production-server.com
19 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/environment/qa/server.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 |
18 | server=http://www.qa-server.com
19 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/environment/test/server.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 |
18 | server=http://www.test-server.com
19 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/java/com/soebes/maven/multiple/configuration/App.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 | public static void main( String[] args )
29 | {
30 | System.out.println( "Hello World!" );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/resources/log4j.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 |
18 | TEST
19 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/webapp/WEB-INF/applicationContext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
24 |
25 |
28 |
31 |
34 |
35 |
36 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/webapp/WEB-INF/faces-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
28 |
29 |
30 | com.sun.facelets.FaceletViewHandler
31 | org.springframework.web.jsf.el.SpringBeanFacesELResolver
32 |
33 |
34 | testBean
35 | com.soebes.supose.release.web.TestSession
36 | session
37 |
38 |
39 |
40 | repositoryBean
41 | com.soebes.supose.release.web.RepositoryBean
42 | session
43 |
44 |
45 |
46 |
47 | /index.xhtml
48 |
49 | SUCCESS
50 | /result.xhtml
51 |
52 |
53 | ERROR
54 | /error.xhtml
55 |
56 |
57 |
58 | /result.xhtml
59 |
60 | SUCCESS
61 | /index.xhtml
62 |
63 |
64 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/webapp/WEB-INF/jsf/body.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/webapp/WEB-INF/jsf/footer.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
26 |
27 |
28 |
29 |
30 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/webapp/WEB-INF/jsf/header.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
26 |
27 |
28 |
29 | SupoSE
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/webapp/WEB-INF/jsf/template.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
27 |
28 | SupoSE
29 |
30 |
31 | org.springframework.web.context.ContextLoaderListener
32 |
33 |
34 | org.springframework.web.context.request.RequestContextListener
35 |
36 |
37 | Repository Bean
38 | repositoryBean
39 | com.soebes.supose.release.web.RepositoryBean
40 |
41 |
42 |
43 |
44 | javax.faces.DEFAULT_SUFFIX
45 | .xhtml
46 |
47 |
48 | facelets.LIBRARIES
49 | /META-INF/tomahawk.taglib.xml
50 |
51 |
52 |
53 | javax.faces.STATE_SAVING_METHOD
54 | client
55 |
56 |
57 |
58 | facelets.SKIP_COMMENTS
59 | true
60 |
61 |
62 |
63 | MyFacesExtensionsFilter
64 | org.apache.myfaces.webapp.filter.ExtensionsFilter
65 |
66 | maxFileSize
67 | 20m
68 |
69 |
70 |
71 |
73 |
74 | MyFacesExtensionsFilter
75 | /faces/myFacesExtensionResource/*
76 |
77 |
78 |
79 | MyFacesExtensionsFilter
80 | *.xhtml
81 |
82 |
83 |
84 | Faces Servlet
85 | javax.faces.webapp.FacesServlet
86 | 1
87 |
88 |
89 |
90 | Faces Servlet
91 | *.xhtml
92 |
93 |
94 |
95 | index.xhtml
96 |
97 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblyPluginWithPropertiesTest/src/test/java/com/soebes/maven/multiple/configuration/AppTest.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import junit.framework.Test;
23 | import junit.framework.TestCase;
24 | import junit.framework.TestSuite;
25 |
26 | /**
27 | * Unit test for simple App.
28 | */
29 | public class AppTest
30 | extends TestCase
31 | {
32 | /**
33 | * Create the test case
34 | *
35 | * @param testName name of the test case
36 | */
37 | public AppTest( String testName )
38 | {
39 | super( testName );
40 | }
41 |
42 | /**
43 | * @return the suite of tests being tested
44 | */
45 | public static Test suite()
46 | {
47 | return new TestSuite( AppTest.class );
48 | }
49 |
50 | /**
51 | * Rigourous Test :-)
52 | */
53 | public void testApp()
54 | {
55 | assertTrue( true );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/dist/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 | 4.0.0
27 |
28 |
29 | org.test.parent
30 | root
31 | 1.0.0-SNAPSHOT
32 |
33 |
34 | Packaging Test : Distribution
35 | dist
36 |
37 |
38 |
39 | ${project.groupId}
40 | package-one
41 | ${project.version}
42 | package
43 | zip
44 |
45 |
46 | ${project.groupId}
47 | package-two
48 | ${project.version}
49 | package
50 | zip
51 |
52 |
53 | junit
54 | junit
55 | 4.11
56 | test
57 |
58 |
59 |
60 |
61 |
62 |
63 | maven-assembly-plugin
64 |
65 |
66 | make-bundles
67 | package
68 |
69 | single
70 |
71 |
72 |
73 | proj1-assembly.xml
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/dist/proj1-assembly.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
25 |
26 | proj1-assembly
27 |
28 |
29 | zip
30 |
31 |
32 | false
33 |
34 |
35 |
36 | /
37 | false
38 | false
39 | runtime
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/package-1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 | 4.0.0
27 |
28 |
29 | org.test.parent
30 | root
31 | 1.0.0-SNAPSHOT
32 |
33 |
34 | package-one
35 |
36 | Packaging Test : Package-1
37 |
38 |
39 |
40 |
41 | maven-assembly-plugin
42 |
43 |
44 | org.test.parent
45 | package-shared
46 | 1.0.0-SNAPSHOT
47 |
48 |
49 |
50 |
51 | package-1
52 | package
53 |
54 | single
55 |
56 |
57 |
58 | package
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | junit
71 | junit
72 | 4.11
73 | test
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/package-1/src/main/java/com/soebes/maven/multiple/configuration/App.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 | public static void main( String[] args )
29 | {
30 | System.out.println( "Hello World!" );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/package-1/src/test/java/com/soebes/maven/multiple/configuration/AppTest.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import junit.framework.Test;
23 | import junit.framework.TestCase;
24 | import junit.framework.TestSuite;
25 |
26 | /**
27 | * Unit test for simple App.
28 | */
29 | public class AppTest
30 | extends TestCase
31 | {
32 | /**
33 | * Create the test case
34 | *
35 | * @param testName name of the test case
36 | */
37 | public AppTest( String testName )
38 | {
39 | super( testName );
40 | }
41 |
42 | /**
43 | * @return the suite of tests being tested
44 | */
45 | public static Test suite()
46 | {
47 | return new TestSuite( AppTest.class );
48 | }
49 |
50 | /**
51 | * Rigourous Test :-)
52 | */
53 | public void testApp()
54 | {
55 | assertTrue( true );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/package-2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 | 4.0.0
27 |
28 |
29 | org.test.parent
30 | root
31 | 1.0.0-SNAPSHOT
32 |
33 |
34 | package-two
35 |
36 | Packaging Test : Package-2
37 |
38 |
39 |
40 | maven-assembly-plugin
41 |
42 |
43 | org.test.parent
44 | package-shared
45 | 1.0.0-SNAPSHOT
46 |
47 |
48 |
49 |
50 | package-1
51 | package
52 |
53 | single
54 |
55 |
56 |
57 | package
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | junit
69 | junit
70 | 4.11
71 | test
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/package-2/src/main/java/com/soebes/maven/multiple/configuration/App.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 | public static void main( String[] args )
29 | {
30 | System.out.println( "Hello World!" );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/package-2/src/test/java/com/soebes/maven/multiple/configuration/AppTest.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.multiple.configuration;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import junit.framework.Test;
23 | import junit.framework.TestCase;
24 | import junit.framework.TestSuite;
25 |
26 | /**
27 | * Unit test for simple App.
28 | */
29 | public class AppTest
30 | extends TestCase
31 | {
32 | /**
33 | * Create the test case
34 | *
35 | * @param testName name of the test case
36 | */
37 | public AppTest( String testName )
38 | {
39 | super( testName );
40 | }
41 |
42 | /**
43 | * @return the suite of tests being tested
44 | */
45 | public static Test suite()
46 | {
47 | return new TestSuite( AppTest.class );
48 | }
49 |
50 | /**
51 | * Rigourous Test :-)
52 | */
53 | public void testApp()
54 | {
55 | assertTrue( true );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 | 4.0.0
27 |
28 |
29 | com.soebes.maven.plugins.test.integration
30 | parent
31 | 0.1
32 |
33 |
34 | org.test.parent
35 | root
36 | 1.0.0-SNAPSHOT
37 |
38 | pom
39 |
40 | Packaging Test
41 |
42 |
43 | dist
44 | package-1
45 | package-2
46 | shared
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/shared/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 | 4.0.0
27 |
28 |
29 | org.test.parent
30 | root
31 | 1.0.0-SNAPSHOT
32 |
33 |
34 | package-shared
35 |
36 | Packaging Test : Shared Descriptor
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/it/mavenAssemblySharedDescriptorTest/shared/src/main/resources/assemblies/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
25 |
26 | package
27 |
28 |
29 | zip
30 |
31 |
32 | false
33 |
34 |
35 |
36 | /
37 | true
38 | false
39 | runtime
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/it/outputWithoutDebugTest/invoker.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 |
18 | invoker.name = outputWithoutDebug Test
19 |
20 | invoker.goals = clean package
21 |
--------------------------------------------------------------------------------
/src/it/outputWithoutDebugTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | basic-test
37 | 0.1-SNAPSHOT
38 |
39 | Iterator Executor Invoker Maven Plugin outputWithoutDebugTest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | test
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | @project.groupId@
55 | @project.artifactId@
56 | @project.version@
57 |
58 |
59 | package
60 |
61 | iterator
62 |
63 |
64 |
65 | - one
66 | - two
67 | - three
68 |
69 |
70 |
71 |
72 | com.soebes.maven.plugins
73 | maven-echo-plugin
74 | 0.1
75 |
76 | echo
77 |
78 |
79 | This is a message: @item@
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/src/it/outputWithoutDebugTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 | def getProjectVersion() {
27 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
28 |
29 | def allPlugins = pom.build.plugins.plugin;
30 |
31 | def configurationMavenPlugin = allPlugins.find { item ->
32 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
33 | }
34 |
35 | return configurationMavenPlugin.version;
36 | }
37 |
38 | def projectVersion = getProjectVersion();
39 |
40 | println "Project version: ${projectVersion}"
41 |
42 | def currentFolder = new File(basedir, ".").getCanonicalPath() + "/";
43 |
44 | def logFileInput = new File(basedir, "build.log")
45 |
46 | new File(basedir, "build-filtered.log").withWriter { out ->
47 | logFileInput.eachLine { line ->
48 |
49 | if (line.contains(currentFolder)) {
50 | line = line.replace(currentFolder, "/home/iterator/");
51 | }
52 |
53 | if ( !line.startsWith("Download")
54 | && !line.startsWith(" wagon http use")
55 | && !line.startsWith("Running post-build")
56 | && !line.startsWith("Finished post-build ")
57 | && !line.startsWith("Project version:")) {
58 | out.println line;
59 | }
60 | }
61 | }
62 |
63 |
64 | t.checkExistenceAndContentOfAFile(logFileInput, [
65 | '[INFO] --- iterator-maven-plugin:' + projectVersion + ':iterator (default) @ basic-test ---',
66 | '[INFO] ------ (one) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
67 | '[INFO] This is a message: one',
68 | '[INFO] ------ (two) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
69 | '[INFO] This is a message: two',
70 | '[INFO] ------ (three) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
71 | '[INFO] This is a message: three',
72 | '[INFO] BUILD SUCCESS',
73 | ])
74 |
75 |
76 | return true;
77 |
--------------------------------------------------------------------------------
/src/it/pluginConfigurationFromPluginManagementTest/invoker.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 |
18 | invoker.name = pluginConfigurationFromPluginManagementTest
19 |
20 | invoker.goals = clean package
21 |
22 | invoker.debug = true
23 |
--------------------------------------------------------------------------------
/src/it/pluginConfigurationFromPluginManagementTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | configuration-from-plugin-management-test
37 | 0.1-SNAPSHOT
38 |
39 | Iterator Executor Invoker Maven Plugin pluginConfigurationFromPluginManagementTest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | 4.8
47 | test
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | com.soebes.maven.plugins
57 | maven-echo-plugin
58 | 0.1
59 |
60 | WARNING
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | @project.groupId@
69 | @project.artifactId@
70 | @project.version@
71 |
72 |
73 | package
74 |
75 | iterator
76 |
77 |
78 |
79 | - one
80 | - two
81 | - three
82 |
83 |
84 |
85 |
86 | com.soebes.maven.plugins
87 | maven-echo-plugin
88 |
89 | echo
90 |
91 |
92 | This is a message: @item@
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/src/it/pluginConfigurationFromPluginManagementTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 | def getProjectVersion() {
27 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
28 |
29 | def allPlugins = pom.build.plugins.plugin;
30 |
31 | def configurationMavenPlugin = allPlugins.find { item ->
32 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
33 | }
34 |
35 | return configurationMavenPlugin.version;
36 | }
37 |
38 | def projectVersion = getProjectVersion();
39 |
40 | println "Project version: ${projectVersion}"
41 |
42 | def currentFolder = new File(basedir, ".").getCanonicalPath() + "/";
43 |
44 | def logFileInput = new File(basedir, "build.log")
45 |
46 | new File(basedir, "build-filtered.log").withWriter { out ->
47 | logFileInput.eachLine { line ->
48 |
49 | if (line.contains(currentFolder)) {
50 | line = line.replace(currentFolder, "/home/itexin/");
51 | }
52 |
53 | if ( !line.startsWith("Download")
54 | && !line.startsWith(" wagon http use")
55 | && !line.startsWith("Running post-build")
56 | && !line.startsWith("Finished post-build ")) {
57 | out.println line;
58 | }
59 | }
60 | }
61 |
62 |
63 | t.checkExistenceAndContentOfAFile(logFileInput, [
64 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':iterator (default) @ configuration-from-plugin-management-test ---',
65 | '[INFO] ------ (one) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
66 | '[WARNING] This is a message: one',
67 | '[INFO] ------ (two) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
68 | '[WARNING] This is a message: two',
69 | '[INFO] ------ (three) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
70 | '[WARNING] This is a message: three',
71 | '[INFO] BUILD SUCCESS',
72 | ])
73 |
74 |
75 | return true;
76 |
--------------------------------------------------------------------------------
/src/it/pluginVersionFromPluginManagementTest/invoker.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 |
18 | invoker.name = pluginVersionFromPluginManagement Test
19 |
20 | invoker.goals = clean package
21 |
--------------------------------------------------------------------------------
/src/it/pluginVersionFromPluginManagementTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
26 |
27 | 4.0.0
28 |
29 |
30 | com.soebes.maven.plugins.test.integration
31 | parent
32 | 0.1
33 |
34 |
35 | com.soebes.maven.plugins.test.integration
36 | version-from-plugin-management-test
37 | 0.1-SNAPSHOT
38 |
39 | Iterator Executor Invoker Maven Plugin pluginVersionFromPluginManagmenetTest
40 | http://www.soebes.de
41 |
42 |
43 |
44 | junit
45 | junit
46 | 4.8
47 | test
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | com.soebes.maven.plugins
57 | maven-echo-plugin
58 | 0.1
59 |
60 |
61 |
62 |
63 |
64 |
65 | @project.groupId@
66 | @project.artifactId@
67 | @project.version@
68 |
69 |
70 | package
71 |
72 | iterator
73 |
74 |
75 |
76 | - eins
77 | - zwei
78 | - drei
79 |
80 |
81 |
82 |
83 | com.soebes.maven.plugins
84 | maven-echo-plugin
85 |
86 | echo
87 |
88 |
89 | This is a message: @item@
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/src/it/pluginVersionFromPluginManagementTest/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.io.*
21 | import java.util.*
22 |
23 |
24 | t = new IntegrationBase()
25 |
26 | def getProjectVersion() {
27 | def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml'))
28 |
29 | def allPlugins = pom.build.plugins.plugin;
30 |
31 | def configurationMavenPlugin = allPlugins.find { item ->
32 | item.groupId.equals("com.soebes.maven.plugins") && item.artifactId.equals("iterator-maven-plugin");
33 | }
34 |
35 | return configurationMavenPlugin.version;
36 | }
37 |
38 | def projectVersion = getProjectVersion();
39 |
40 | println "Project version: ${projectVersion}"
41 |
42 | def currentFolder = new File(basedir, ".").getCanonicalPath() + "/";
43 |
44 | def logFileInput = new File(basedir, "build.log")
45 |
46 | new File(basedir, "build-filtered.log").withWriter { out ->
47 | logFileInput.eachLine { line ->
48 |
49 | if (line.contains(currentFolder)) {
50 | line = line.replace(currentFolder, "/home/itexin/");
51 | }
52 |
53 | if ( !line.startsWith("Download")
54 | && !line.startsWith(" wagon http use")
55 | && !line.startsWith("Running post-build")
56 | && !line.startsWith("Finished post-build ")) {
57 | out.println line;
58 | }
59 | }
60 | }
61 |
62 |
63 | t.checkExistenceAndContentOfAFile(logFileInput, [
64 | '[INFO] --- iterator-maven-plugin:' +projectVersion + ':iterator (default) @ version-from-plugin-management-test ---',
65 | '[INFO] ------ (eins) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
66 | '[INFO] This is a message: eins',
67 | '[INFO] ------ (zwei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
68 | '[INFO] This is a message: zwei',
69 | '[INFO] ------ (drei) com.soebes.maven.plugins:maven-echo-plugin:0.1:echo',
70 | '[INFO] This is a message: drei',
71 | '[INFO] BUILD SUCCESS',
72 | ])
73 |
74 |
75 | return true;
76 |
--------------------------------------------------------------------------------
/src/it/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 |
24 |
25 | it-repo
26 | RPM
27 | @localRepositoryUrl@
28 | *
29 |
30 |
31 |
32 |
33 |
34 | it-repo
35 |
36 | true
37 |
38 |
39 |
40 | local.central
41 | @localRepositoryUrl@
42 |
43 | true
44 |
45 |
46 | true
47 |
48 |
49 |
50 |
51 |
52 | local.central
53 | @localRepositoryUrl@
54 |
55 | true
56 |
57 |
58 | true
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/src/it/setup/invoker.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 |
18 | invoker.name = Setup Integration Test Parent
19 |
20 | invoker.goals = install
21 |
22 | invoker.debug = true
23 |
24 | debug = true
25 |
--------------------------------------------------------------------------------
/src/main/java/com/soebes/maven/plugins/iterator/OutputConsumer.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.plugins.iterator;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.maven.plugin.logging.Log;
23 | import org.apache.maven.shared.invoker.InvocationOutputHandler;
24 |
25 | /**
26 | * @author Karl-Heinz Marbaise khmarbaise@apache.org
27 | */
28 | public class OutputConsumer
29 | implements InvocationOutputHandler
30 | {
31 |
32 | private Log log;
33 |
34 | public OutputConsumer( Log log )
35 | {
36 | this.log = log;
37 | }
38 |
39 | @Override
40 | public void consumeLine( String line )
41 | {
42 | log.info( line );
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/soebes/maven/plugins/iterator/PluginExecutor.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.plugins.iterator;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.maven.model.Plugin;
23 | import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
24 |
25 | /**
26 | * @author Karl-Heinz Marbaise khmarbaise@apache.org
27 | */
28 | public class PluginExecutor
29 | {
30 | /**
31 | * The plugin to be executed.
32 | *
33 | *
34 | * {@code
35 | *
36 | * ..
37 | * ..
38 | * ..
39 | *
40 | * }
41 | *
42 | */
43 | private Plugin plugin;
44 |
45 | /**
46 | * The plugin goal to be executed.
47 | */
48 | private String goal;
49 |
50 | /**
51 | * Plugin configuration to use in the execution.
52 | *
53 | *
54 | * {@code
55 | *
56 | * Plugin Configuration
57 | *
58 | * }
59 | *
60 | */
61 | private XmlPlexusConfiguration configuration;
62 |
63 | public PluginExecutor()
64 | {
65 | }
66 |
67 | public Plugin getPlugin()
68 | {
69 | return plugin;
70 | }
71 |
72 | public void setPlugin( Plugin plugin )
73 | {
74 | this.plugin = plugin;
75 | }
76 |
77 | public String getGoal()
78 | {
79 | return goal;
80 | }
81 |
82 | public void setGoal( String goal )
83 | {
84 | this.goal = goal;
85 | }
86 |
87 | public XmlPlexusConfiguration getConfiguration()
88 | {
89 | return configuration;
90 | }
91 |
92 | public void setConfiguration( XmlPlexusConfiguration configuration )
93 | {
94 | this.configuration = configuration;
95 | }
96 | }
--------------------------------------------------------------------------------
/src/site/apt/invoker.apt.vm:
--------------------------------------------------------------------------------
1 | ~~
2 | ~~ Licensed to the Apache Software Foundation (ASF) under one
3 | ~~ or more contributor license agreements. See the NOTICE file
4 | ~~ distributed with this work for additional information
5 | ~~ regarding copyright ownership. The ASF licenses this file
6 | ~~ to you under the Apache License, Version 2.0 (the
7 | ~~ "License"); you may not use this file except in compliance
8 | ~~ with the License. You may obtain a copy of the License at
9 | ~~
10 | ~~ http://www.apache.org/licenses/LICENSE-2.0
11 | ~~
12 | ~~ Unless required by applicable law or agreed to in writing,
13 | ~~ software distributed under the License is distributed on an
14 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | ~~ KIND, either express or implied. See the License for the
16 | ~~ specific language governing permissions and limitations
17 | ~~ under the License.
18 |
19 | ~~ NOTE: For help with the syntax of this file, see:
20 | ~~ http://maven.apache.org/doxia/references/apt-format.html
21 |
22 | ------
23 | Usage
24 | ------
25 | Karl Heinz Marbaise
26 | ------
27 | 2013-01-12
28 | ------
29 |
30 |
31 | Usage
32 |
33 | Lets assume you would like to call the
34 | {{{http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22maven-echo-plugin%22}maven-echo-plugin}}
35 | several times. Apart form being really useful it's for an example.
36 | This can be achieved by the following:
37 |
38 | %{include|source=target/it/outputWithoutDebugTest/pom.xml|snippet=#start}
39 |
40 | This will produce the following output during a <<>> call
41 | which will show you the messages produced by the
42 | {{{http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22maven-echo-plugin%22}maven-echo-plugin}}
43 | and their appropriate values.
44 |
45 | %{include|source=target/it/outputWithoutDebugTest/build-filtered.log|highlight-type=text}
46 |
47 | []
48 |
49 |
--------------------------------------------------------------------------------
/src/site/apt/iterator-folder.apt.vm:
--------------------------------------------------------------------------------
1 | ~~
2 | ~~ Licensed to the Apache Software Foundation (ASF) under one
3 | ~~ or more contributor license agreements. See the NOTICE file
4 | ~~ distributed with this work for additional information
5 | ~~ regarding copyright ownership. The ASF licenses this file
6 | ~~ to you under the Apache License, Version 2.0 (the
7 | ~~ "License"); you may not use this file except in compliance
8 | ~~ with the License. You may obtain a copy of the License at
9 | ~~
10 | ~~ http://www.apache.org/licenses/LICENSE-2.0
11 | ~~
12 | ~~ Unless required by applicable law or agreed to in writing,
13 | ~~ software distributed under the License is distributed on an
14 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | ~~ KIND, either express or implied. See the License for the
16 | ~~ specific language governing permissions and limitations
17 | ~~ under the License.
18 |
19 | ~~ NOTE: For help with the syntax of this file, see:
20 | ~~ http://maven.apache.org/doxia/references/apt-format.html
21 |
22 | ------
23 | Introduction
24 | ------
25 | Karl Heinz Marbaise
26 | ------
27 | 2014-07-22
28 | ------
29 |
30 | Iterator Maven Plugin
31 |
32 |
33 | * Using Folder
34 |
35 | The iterator-maven-plugin can be used to iterate over folders which might be helpful
36 | in some situations cause it's dynamic and not fixed in the pom file.
37 |
38 | +-----
39 | .
40 | src/
41 | ├── main
42 | │ ├── java
43 | │ │ └── com
44 | │ │ └── soebes
45 | │ │ └── maven
46 | │ │ └── multiple
47 | │ │ ├── first
48 | │ │ ├── second
49 | │ │ └── third
50 |
51 | +-----
52 |
53 | Let us think you would like to iterate over the folders , and .
54 |
55 | %{include|source=target/it/directoryIteratorTest/pom.xml|snippet=#start}
56 |
57 | During the execution the values for item will be , and .
58 |
59 | []
60 |
--------------------------------------------------------------------------------
/src/site/apt/iterator-overview.apt.vm:
--------------------------------------------------------------------------------
1 | ~~
2 | ~~ Licensed to the Apache Software Foundation (ASF) under one
3 | ~~ or more contributor license agreements. See the NOTICE file
4 | ~~ distributed with this work for additional information
5 | ~~ regarding copyright ownership. The ASF licenses this file
6 | ~~ to you under the Apache License, Version 2.0 (the
7 | ~~ "License"); you may not use this file except in compliance
8 | ~~ with the License. You may obtain a copy of the License at
9 | ~~
10 | ~~ http://www.apache.org/licenses/LICENSE-2.0
11 | ~~
12 | ~~ Unless required by applicable law or agreed to in writing,
13 | ~~ software distributed under the License is distributed on an
14 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | ~~ KIND, either express or implied. See the License for the
16 | ~~ specific language governing permissions and limitations
17 | ~~ under the License.
18 |
19 | ~~ NOTE: For help with the syntax of this file, see:
20 | ~~ http://maven.apache.org/doxia/references/apt-format.html
21 |
22 | ------
23 | Introduction
24 | ------
25 | Karl Heinz Marbaise
26 | ------
27 | 2013-03-19
28 | ------
29 |
30 | Iterator Maven Plugin
31 |
32 |
33 | * Overview
34 |
35 | The <{{{./iterator-mojo.html}iterator}}> goal is intended to call one or more maven plugins
36 | during the iteration of the values.
37 |
38 | Let us take a look at a real example which makes explanations simpler. We have the following
39 | layout of the project:
40 |
41 |
42 | +----------
43 | .
44 | ├── dev.xml
45 | ├── pom.xml
46 | ├── prod.xml
47 | ├── test.xml
48 | └── src
49 | ├── main
50 | │ ├── java
51 | │ ├── ...
52 | │ └── resources
53 | │ └── log4j.properties
54 | └── test
55 | └── java
56 | ...
57 | +----------
58 |
59 | Where the <<>> file contains the following:
60 |
61 | %{include|source=target/it/mavenAssemblyPluginTest/pom.xml|snippet=#start}
62 |
63 | The above call will produce an output like the following:
64 |
65 | %{include|source=target/it/mavenAssemblyPluginTest/build-filtered.log|highlight-type=text}
66 |
67 | As you can see the maven-assembly-plugin is being called three times with the
68 | parameter <<>>, <<>> and <<>> which adresses the appropriate
69 | descriptor in the folder.
70 |
71 | []
72 |
--------------------------------------------------------------------------------
/src/site/apt/iterator-property.apt.vm:
--------------------------------------------------------------------------------
1 | ~~
2 | ~~ Licensed to the Apache Software Foundation (ASF) under one
3 | ~~ or more contributor license agreements. See the NOTICE file
4 | ~~ distributed with this work for additional information
5 | ~~ regarding copyright ownership. The ASF licenses this file
6 | ~~ to you under the Apache License, Version 2.0 (the
7 | ~~ "License"); you may not use this file except in compliance
8 | ~~ with the License. You may obtain a copy of the License at
9 | ~~
10 | ~~ http://www.apache.org/licenses/LICENSE-2.0
11 | ~~
12 | ~~ Unless required by applicable law or agreed to in writing,
13 | ~~ software distributed under the License is distributed on an
14 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | ~~ KIND, either express or implied. See the License for the
16 | ~~ specific language governing permissions and limitations
17 | ~~ under the License.
18 |
19 | ~~ NOTE: For help with the syntax of this file, see:
20 | ~~ http://maven.apache.org/doxia/references/apt-format.html
21 |
22 | ------
23 | Introduction
24 | ------
25 | Karl Heinz Marbaise
26 | ------
27 | 2013-03-29
28 | ------
29 |
30 | Iterator Maven Plugin
31 |
32 |
33 | * Using Property
34 |
35 | The iterator-maven-plugin will inject the current value as a property which means you can
36 | use this property to parameterize your build. First let us take a view on an example
37 | project:
38 |
39 | +-----
40 | .
41 | ├── pom.xml
42 | └── src
43 | ├── main
44 | │ ├── assembly
45 | │ │ └── archive.xml
46 | │ ├── environment
47 | │ │ ├── dev
48 | │ │ │ └── server.properties
49 | │ │ ├── production
50 | │ │ │ └── server.properties
51 | │ │ ├── qa
52 | │ │ │ └── server.properties
53 | │ │ └── test
54 | │ │ └── server.properties
55 | │ ├── java
56 | │ │ └── ...
57 | └── test
58 | └── java
59 | └── ...
60 | +-----
61 |
62 | The next step is to look at the <<>> file which will define the iteration
63 | over the values , , , which is defined by:
64 |
65 | %{include|source=target/it/mavenAssemblyPluginWithPropertiesTest/pom.xml|snippet=#start}
66 |
67 | During the execution the values for item will be injected as property in the maven model
68 | which means they can be accessed by the usual property usage like <<<$\{item}>>>. This
69 | is done in the assembly descriptor to fulfill the needs in this case.
70 |
71 | %{include|source=src/it/mavenAssemblyPluginWithPropertiesTest/src/assembly/archive.xml|snippet=#start}
72 |
73 | []
74 |
--------------------------------------------------------------------------------
/src/site/resources/attached-includes/css/shCoreDefault.css.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khmarbaise/iterator-maven-plugin/26e4df412235f4309efba30715ff5ea09c422521/src/site/resources/attached-includes/css/shCoreDefault.css.gz
--------------------------------------------------------------------------------
/src/site/site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
25 |
26 | http://soebes.de/images/weblogo.gif
27 | http://www.soebes.de/
28 |
29 |
30 | org.apache.maven.skins
31 | maven-fluido-skin
32 | 1.5
33 |
34 |
35 |
36 | true
37 | true
38 |
39 | ${project.url}
40 |
41 |
42 | khmarbaise/iterator-maven-plugin
43 | right
44 | gray
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/src/test/groovy/IntegrationBase.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | class IntegrationBase {
21 |
22 | void checkExistenceAndContentOfAFile(file, contents) {
23 | if (!file.canRead()) {
24 | throw new FileNotFoundException( "Could not find the " + file)
25 | }
26 |
27 | def lines_to_check_in_unix_script_marker = [:]
28 | (0..contents.size()).each { index ->
29 | lines_to_check_in_unix_script_marker[index] = false
30 | }
31 |
32 | file.eachLine { file_content, file_line ->
33 | contents.eachWithIndex { contents_expected, index ->
34 | if (file_content.equals(contents_expected)) {
35 | lines_to_check_in_unix_script_marker[index] = true
36 | }
37 | }
38 | }
39 |
40 | contents.eachWithIndex { value, index ->
41 | if ( lines_to_check_in_unix_script_marker[index] == false ) {
42 | throw new Exception("The expected content in " + file + " couldn't be found." + contents[index])
43 | }
44 | }
45 | }
46 |
47 | def String convertPathIntoPlatform(String contents) {
48 | def result = "";
49 | if (File.separator.equals("\\")) {
50 | result = contents.replaceAll("/", "\\\\");
51 | } else {
52 | result = contents;
53 | }
54 |
55 | return result;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/test/java/com/soebes/maven/plugins/iterator/ExecutorMojoTest.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.plugins.iterator;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.io.File;
23 | import java.util.Collections;
24 | import java.util.List;
25 |
26 | import org.apache.maven.plugin.MojoExecutionException;
27 | import org.apache.maven.plugin.MojoFailureException;
28 | import org.apache.maven.plugin.logging.Log;
29 | import org.mockito.Mockito;
30 | import org.testng.annotations.BeforeMethod;
31 | import org.testng.annotations.Test;
32 |
33 | import static org.mockito.Mockito.mock;
34 | import static org.mockito.Mockito.verify;
35 | import static org.mockito.Mockito.when;
36 |
37 | /**
38 | * @author Karl-Heinz Marbaise khmarbaise@apache.org
39 | */
40 | public class ExecutorMojoTest
41 | {
42 |
43 | private IteratorMojo mock;
44 |
45 | @BeforeMethod
46 | public void beforeMethod()
47 | {
48 | mock = mock( IteratorMojo.class, Mockito.CALLS_REAL_METHODS );
49 | }
50 |
51 | @Test
52 | public void shouldFailWithMEEAndMessageIfNoParameterIsSet()
53 | throws MojoExecutionException, MojoFailureException
54 | {
55 | // Given
56 | Log log = mock(Log.class);
57 | mock.setLog(log);
58 | when( mock.isFolderNull() ).thenReturn( true );
59 | when( mock.isItemsNull() ).thenReturn( true );
60 | when( mock.isContentNull() ).thenReturn( true );
61 | when( mock.isItemsWithPropertiesNull() ).thenReturn( true );
62 |
63 | // Then
64 | mock.execute();
65 | verify(log).warn("Neither items, itemsWithProperties, content nor folder have been set.");
66 | }
67 |
68 | @Test( expectedExceptions = {
69 | MojoExecutionException.class }, expectedExceptionsMessageRegExp = "You can use only one element. "
70 | + "Either items, itemsWithProperties, content or folder element but not more than one of them." )
71 | public void shouldFailWithMEEAndMessageIfAllAreSet()
72 | throws MojoExecutionException, MojoFailureException
73 | {
74 | List itemWithProperties =
75 | Collections.singletonList( new ItemWithProperties( "x", ItemWithProperties.NO_PROPERTIES ) );
76 |
77 | List nonEmptyItemsList = Collections.singletonList( "A" );
78 | String nonEmptyConent = "X";
79 | File nonEmptyFile = new File( "." );
80 |
81 | // When
82 | mock.setItems( nonEmptyItemsList );
83 | mock.setContent( nonEmptyConent );
84 | mock.setItemsWithProperties( itemWithProperties );
85 | mock.setFolder( nonEmptyFile );
86 |
87 | // Then
88 | mock.execute();
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/test/java/com/soebes/maven/plugins/iterator/ItemWithPropertiesTest.java:
--------------------------------------------------------------------------------
1 | package com.soebes.maven.plugins.iterator;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | import java.util.Properties;
25 |
26 | import org.testng.annotations.Test;
27 |
28 | /**
29 | * @author Karl-Heinz Marbaise khmarbaise@apache.org
30 | */
31 | public class ItemWithPropertiesTest
32 | {
33 | public class ItemNullTest
34 | {
35 | @Test( expectedExceptions = {
36 | NullPointerException.class }, expectedExceptionsMessageRegExp = "name is not allowed to be null." )
37 | public void shouldReturnNPEForNameParameter()
38 | {
39 | new ItemWithProperties( null, new Properties() );
40 | }
41 |
42 | @Test( expectedExceptions = {
43 | NullPointerException.class }, expectedExceptionsMessageRegExp = "properties is not allowed to be null." )
44 | public void shouldReturnNPEForPropertiesParameters()
45 | {
46 | new ItemWithProperties( "name", null );
47 | }
48 |
49 | @Test( expectedExceptions = {
50 | NullPointerException.class }, expectedExceptionsMessageRegExp = "properties is not allowed to be null." )
51 | public void setPropertiesShouldReturnNPEForNullParameter()
52 | {
53 | new ItemWithProperties( "name", ItemWithProperties.NO_PROPERTIES ).setProperties( null );
54 | }
55 |
56 | @Test( expectedExceptions = {
57 | NullPointerException.class }, expectedExceptionsMessageRegExp = "name is not allowed to be null." )
58 | public void setNameShouldReturnNPEForNullParameter()
59 | {
60 | new ItemWithProperties( "name", new Properties() ).setName( null );
61 | }
62 |
63 | }
64 |
65 | public class ItemContentTest
66 | {
67 | @Test
68 | public void hasNameShouldBeFalseForNO_NAMEValue()
69 | {
70 | assertThat( new ItemWithProperties( ItemWithProperties.NO_NAME,
71 | ItemWithProperties.NO_PROPERTIES ).hasName() ).isFalse();
72 | }
73 |
74 | @Test
75 | public void hasNameShouldBeTrueForAnyOtherValue()
76 | {
77 | assertThat( new ItemWithProperties( "x", ItemWithProperties.NO_PROPERTIES ).hasName() ).isTrue();
78 | }
79 |
80 | @Test
81 | public void hasPropertiesShouldBeFalseForNO_PROPERTIESValue()
82 | {
83 | assertThat( new ItemWithProperties( "name", ItemWithProperties.NO_PROPERTIES ).hasProperties() ).isFalse();
84 | }
85 |
86 | @Test
87 | public void hasPropertiesShouldBeTrueForAnyOtherProperties()
88 | {
89 | assertThat( new ItemWithProperties( "name", new Properties() ).hasProperties() ).isTrue();
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------