-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARCHETYPE-274] Add integration test
- Loading branch information
Showing
18 changed files
with
291 additions
and
104 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...-archetype-plugin/src/it/projects/ARCHETYPE-274_conditional_filesets/archetype.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
excludePatterns=build.log,invoker.properties,verify.groovy |
44 changes: 44 additions & 0 deletions
44
maven-archetype-plugin/src/it/projects/ARCHETYPE-274_conditional_filesets/archetype/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.apache.maven.plugins.archetype.its</groupId> | ||
<artifactId>archetype274-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>archetype274-archetype</artifactId> | ||
<packaging>maven-archetype</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-archetype-plugin</artifactId> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<archetypeDirectory>src/main/resources</archetypeDirectory> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
60 changes: 60 additions & 0 deletions
60
...4_conditional_filesets/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one | ||
~ or more contributor license agreements. See the NOTICE file | ||
~ distributed with this work for additional information | ||
~ regarding copyright ownership. The ASF licenses this file | ||
~ to you under the Apache License, Version 2.0 (the | ||
~ "License"); you may not use this file except in compliance | ||
~ with the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, | ||
~ software distributed under the License is distributed on an | ||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
~ KIND, either express or implied. See the License for the | ||
~ specific language governing permissions and limitations | ||
~ under the License. | ||
--> | ||
<archetype-descriptor name="include-condition-test"> | ||
|
||
<requiredProperties> | ||
<requiredProperty key="extraSupport"/> | ||
<requiredProperty key="anotherSupport"/> | ||
</requiredProperties> | ||
|
||
<fileSets> | ||
<fileSet filtered="true" packaged="true"> | ||
<directory>src/main/java</directory> | ||
<includes> | ||
<include>**/*.java</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="false" packaged="false" includeCondition="${extraSupport}"> | ||
<directory>src/main/resources</directory> | ||
<includes> | ||
<include>**/include-without-filter.txt</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="true" packaged="false" includeCondition="${extraSupport}"> | ||
<directory>src/main/resources</directory> | ||
<includes> | ||
<include>**/include-with-filter.txt</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="true" packaged="false" includeCondition="${anotherSupport}"> | ||
<directory>src/main/resources</directory> | ||
<includes> | ||
<include>**/exclude-with-filter.txt</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="false" packaged="false" includeCondition="${anotherSupport}"> | ||
<directory>src/main/resources</directory> | ||
<includes> | ||
<include>**/exclude-without-filter.txt</include> | ||
</includes> | ||
</fileSet> | ||
</fileSets> | ||
|
||
</archetype-descriptor> |
28 changes: 28 additions & 0 deletions
28
...CHETYPE-274_conditional_filesets/archetype/src/main/resources/archetype-resources/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>${groupId}</groupId> | ||
<artifactId>${artifactId}</artifactId> | ||
<version>${version}</version> | ||
<packaging>pom</packaging> | ||
|
||
</project> |
5 changes: 5 additions & 0 deletions
5
...ditional_filesets/archetype/src/main/resources/archetype-resources/src/main/java/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public class App { | ||
public static void main(String[] args) { | ||
System.out.println("This file should not be included"); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...chetype/src/main/resources/archetype-resources/src/main/resources/exclude-with-filter.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this should be excluded: ${package} |
1 change: 1 addition & 0 deletions
1
...type/src/main/resources/archetype-resources/src/main/resources/exclude-without-filter.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this should be excluded: ${package} |
1 change: 1 addition & 0 deletions
1
...chetype/src/main/resources/archetype-resources/src/main/resources/include-with-filter.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this should be included: ${package} |
1 change: 1 addition & 0 deletions
1
...type/src/main/resources/archetype-resources/src/main/resources/include-without-filter.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this should be included: ${package} |
22 changes: 22 additions & 0 deletions
22
maven-archetype-plugin/src/it/projects/ARCHETYPE-274_conditional_filesets/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
invoker.goals.1 = install | ||
invoker.project.1 = archetype | ||
|
||
invoker.goals.2 = org.apache.maven.plugins:maven-archetype-plugin:${project.version}:generate | ||
invoker.userPropertiesFile = project.properties |
48 changes: 48 additions & 0 deletions
48
maven-archetype-plugin/src/it/projects/ARCHETYPE-274_conditional_filesets/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.apache.maven.plugins.archetype.its</groupId> | ||
<artifactId>archetype274-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<extensions> | ||
<extension> | ||
<groupId>org.apache.maven.archetype</groupId> | ||
<artifactId>archetype-packaging</artifactId> | ||
<version>@project.version@</version> | ||
</extension> | ||
</extensions> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-archetype-plugin</artifactId> | ||
<version>@project.version@</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
28 changes: 28 additions & 0 deletions
28
maven-archetype-plugin/src/it/projects/ARCHETYPE-274_conditional_filesets/project.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
archetypeGroupId=org.apache.maven.plugins.archetype.its | ||
archetypeArtifactId=archetype274-archetype | ||
archetypeVersion=1.0-SNAPSHOT | ||
|
||
groupId=com.company | ||
artifactId=myArtifactId | ||
version=1.0-SNAPSHOT | ||
package=com.company.project | ||
|
||
extraSupport=true | ||
anotherSupport=false |
34 changes: 34 additions & 0 deletions
34
maven-archetype-plugin/src/it/projects/ARCHETYPE-274_conditional_filesets/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import java.io.File | ||
|
||
def mainJava = new File(basedir, "/myArtifactId/src/main/java") | ||
def includeFirstResource = new File(basedir, "/myArtifactId/src/main/resources/include-with-filter.txt") | ||
def includeSecondResource = new File(basedir, "/myArtifactId/src/main/resources/include-without-filter.txt") | ||
def excludeFirstResource = new File(basedir, "/myArtifactId/src/main/resources/exclude-with-filter.txt") | ||
def excludeSecondResource = new File(basedir, "/myArtifactId/src/main/resources/exclude-without-filter.txt") | ||
|
||
assert mainJava.exists() : "${mainJava} should be present." | ||
assert includeFirstResource.exists() : "${includeFirstResource} should be present." | ||
assert includeSecondResource.exists() : "${includeSecondResource} should be present." | ||
assert !excludeFirstResource.exists() : "${excludeFirstResource} should not be present." | ||
assert !excludeSecondResource.exists() : "${excludeSecondResource} should not be present." | ||
|
||
|
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
test-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
test-archetype/src/main/resources/archetype-resources/pom.xml
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
test-archetype/src/main/resources/archetype-resources/src/main/resources/example.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.