Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-491

Allow to run integration test with another archetype as parent project

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 3.0.0
    • Component/s: Plugin
    • Labels:
      None

      Description

      Archetypes can be either used as module archetypes (below existing Maven projects, then the parent will be automatically set) or as regular project archetypes (i.e. will run standalone, because they need no parent or have a parent hardcoded in their pom). Currently only the latter is properly supported for the goal integration-test.

      To also support the former it would be good to allow the setup of arbitrary parent structures (from other archetypes) below which the actual IT should be executed.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user kwin closed the pull request at:

          https://github.com/apache/maven-archetype/pull/8

          Show
          githubbot ASF GitHub Bot added a comment - Github user kwin closed the pull request at: https://github.com/apache/maven-archetype/pull/8
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user kwin commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          This has been merged.

          Show
          githubbot ASF GitHub Bot added a comment - Github user kwin commented on the issue: https://github.com/apache/maven-archetype/pull/8 This has been merged.
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in maven-archetype-m3 #214 (See https://builds.apache.org/job/maven-archetype-m3/214/)
          ARCHETYPE-491 Allow to run integration test with another archetype as (michaelo: rev 50ec46b58af6084429622bc3bf645d5963f84634)

          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/verify.bsh
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/reference/src/main/java/build/archetype/App.java
          • maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/archetype.pom.properties
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/main/resources/archetype-resources/src/main/java/App.java
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/archetype.properties
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/archetype.properties
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/invoker.properties
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/main/resources/META-INF/maven/archetype-metadata.xml
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/pom.xml
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/verify.groovy
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/test-settings.xml
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/goal.txt
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/main/resources/archetype-resources/pom.xml
          • maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/reference/pom.xml
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in maven-archetype-m3 #214 (See https://builds.apache.org/job/maven-archetype-m3/214/ ) ARCHETYPE-491 Allow to run integration test with another archetype as (michaelo: rev 50ec46b58af6084429622bc3bf645d5963f84634) maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/verify.bsh maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/reference/src/main/java/build/archetype/App.java maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/archetype.pom.properties maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/main/resources/archetype-resources/src/main/java/App.java maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/archetype.properties maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/archetype.properties maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/invoker.properties maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/main/resources/META-INF/maven/archetype-metadata.xml maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/pom.xml maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/verify.groovy maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/test-settings.xml maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/goal.txt maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/main/resources/archetype-resources/pom.xml maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/reference/pom.xml
          Hide
          michael-o Michael Osipov added a comment -
          Show
          michael-o Michael Osipov added a comment - Fixed with 50ec46b58af6084429622bc3bf645d5963f84634 .
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          I have found the issue on the line ending. Will elaborate later.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on the issue: https://github.com/apache/maven-archetype/pull/8 I have found the issue on the line ending. Will elaborate later.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          The IT does not pass. `target\it\build-archetype-and-run-its-with-existing-parent\target\test-classes\projects\basic\project\project\basic\pom.xml` has mixed line endings while `target\it\build-archetype-and-run-its-with-existing-parent\target\test-classes\projects\basic\reference\pom.xml` has proper line endings on Windows. I fear that this is a bug in Maven Archetype itself. Can you please double check?

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on the issue: https://github.com/apache/maven-archetype/pull/8 The IT does not pass. `target\it\build-archetype-and-run-its-with-existing-parent\target\test-classes\projects\basic\project\project\basic\pom.xml` has mixed line endings while `target\it\build-archetype-and-run-its-with-existing-parent\target\test-classes\projects\basic\reference\pom.xml` has proper line endings on Windows. I fear that this is a bug in Maven Archetype itself. Can you please double check?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user kwin commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70208080

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/reference/pom.xml —
          @@ -0,0 +1,32 @@
          +<?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.
          +--><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>
          + <artifactId>project</artifactId>
          + <groupId>com.company</groupId>
          + <version>1.0-SNAPSHOT</version>
          + </parent>
          +
          + <groupId>archetype.it</groupId>
          + <artifactId>basic</artifactId>
          + <version>0.1-SNAPSHOT</version>
          — End diff –

          In this case I just compare with the generated pom.xml. Also the parent version and the current version is indeed different, therefore removing it would change the semantics.

          Show
          githubbot ASF GitHub Bot added a comment - Github user kwin commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70208080 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/reference/pom.xml — @@ -0,0 +1,32 @@ +<?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. +--><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> + <artifactId>project</artifactId> + <groupId>com.company</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + + <groupId>archetype.it</groupId> + <artifactId>basic</artifactId> + <version>0.1-SNAPSHOT</version> — End diff – In this case I just compare with the generated pom.xml. Also the parent version and the current version is indeed different, therefore removing it would change the semantics.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          @kwin Please have a look at the inline comments.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on the issue: https://github.com/apache/maven-archetype/pull/8 @kwin Please have a look at the inline comments.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186237

          — Diff: maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java —
          @@ -84,6 +90,43 @@

          • the IT.</li>
          • </ul>
          • <p/>
            + * To let the IT create a Maven module below some other Maven project (being generated from another archetype)
            + * one can additionally specify an optional <code>archetype.pom.properties</code> file in the parent directory,
            + * specifying the archetype's <code>groupId</code>, <code>artifactId</code> and <code>version</code> along with its
            + * <code>archetype.properties</code> file, containing properties for project generation. Both files are leveraged
            + * to create the parent project for this IT. Parent projects can be nested.
            + * An example structure for such an integration test looks like this
            + * <table>
            + * <tr>
            + * <th>File/Folder</code></td>
            + * <th>Description</td>
            + * </tr>
            + * <tr>
            + * <td><code>src/test/resources/projects/it1</code></td>
            + * <td>Folder for integration test 1</td>
            + * </tr>
            + * <tr>
            + * <td><code>src/test/resources/projects/it1/archetype.pom.properties</code></td>
            + * <td>GAV for the archetype from which to generate the parent</td>
            + * </tr>
            + * <tr>
            + * <td><code>src/test/resources/projects/it1/archetype.properties</code></td>
            + * <td>All required properties for the archetype being specified by <code>archetype.pom.properties</code> on this level</td>
            + * </tr>
            + * <tr>
            + * <td><code>src/test/resources/projects/it1/child</code></td>
            + * <td>Folder for maven module within integration test 1 (this folder's name is not relevant)</td>
              • End diff –

          ditto

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186237 — Diff: maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java — @@ -84,6 +90,43 @@ the IT.</li> </ul> <p/> + * To let the IT create a Maven module below some other Maven project (being generated from another archetype) + * one can additionally specify an optional <code>archetype.pom.properties</code> file in the parent directory, + * specifying the archetype's <code>groupId</code>, <code>artifactId</code> and <code>version</code> along with its + * <code>archetype.properties</code> file, containing properties for project generation. Both files are leveraged + * to create the parent project for this IT. Parent projects can be nested. + * An example structure for such an integration test looks like this + * <table> + * <tr> + * <th>File/Folder</code></td> + * <th>Description</td> + * </tr> + * <tr> + * <td><code>src/test/resources/projects/it1</code></td> + * <td>Folder for integration test 1</td> + * </tr> + * <tr> + * <td><code>src/test/resources/projects/it1/archetype.pom.properties</code></td> + * <td>GAV for the archetype from which to generate the parent</td> + * </tr> + * <tr> + * <td><code>src/test/resources/projects/it1/archetype.properties</code></td> + * <td>All required properties for the archetype being specified by <code>archetype.pom.properties</code> on this level</td> + * </tr> + * <tr> + * <td><code>src/test/resources/projects/it1/child</code></td> + * <td>Folder for maven module within integration test 1 (this folder's name is not relevant)</td> End diff – ditto
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186236

          — Diff: maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java —
          @@ -84,6 +90,43 @@

          • the IT.</li>
          • </ul>
          • <p/>
            + * To let the IT create a Maven module below some other Maven project (being generated from another archetype)
            + * one can additionally specify an optional <code>archetype.pom.properties</code> file in the parent directory,
            + * specifying the archetype's <code>groupId</code>, <code>artifactId</code> and <code>version</code> along with its
            + * <code>archetype.properties</code> file, containing properties for project generation. Both files are leveraged
            + * to create the parent project for this IT. Parent projects can be nested.
            + * An example structure for such an integration test looks like this
            + * <table>
            + * <tr>
            + * <th>File/Folder</code></td>
            + * <th>Description</td>
            + * </tr>
            + * <tr>
            + * <td><code>src/test/resources/projects/it1</code></td>
            + * <td>Folder for integration test 1</td>
              • End diff –

          Same as above

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186236 — Diff: maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java — @@ -84,6 +90,43 @@ the IT.</li> </ul> <p/> + * To let the IT create a Maven module below some other Maven project (being generated from another archetype) + * one can additionally specify an optional <code>archetype.pom.properties</code> file in the parent directory, + * specifying the archetype's <code>groupId</code>, <code>artifactId</code> and <code>version</code> along with its + * <code>archetype.properties</code> file, containing properties for project generation. Both files are leveraged + * to create the parent project for this IT. Parent projects can be nested. + * An example structure for such an integration test looks like this + * <table> + * <tr> + * <th>File/Folder</code></td> + * <th>Description</td> + * </tr> + * <tr> + * <td><code>src/test/resources/projects/it1</code></td> + * <td>Folder for integration test 1</td> End diff – Same as above
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186234

          — Diff: maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java —
          @@ -84,6 +90,43 @@

          • the IT.</li>
          • </ul>
          • <p/>
            + * To let the IT create a Maven module below some other Maven project (being generated from another archetype)
            + * one can additionally specify an optional <code>archetype.pom.properties</code> file in the parent directory,
            + * specifying the archetype's <code>groupId</code>, <code>artifactId</code> and <code>version</code> along with its
            + * <code>archetype.properties</code> file, containing properties for project generation. Both files are leveraged
            + * to create the parent project for this IT. Parent projects can be nested.
            + * An example structure for such an integration test looks like this
            + * <table>
            + * <tr>
            + * <th>File/Folder</code></td>
              • End diff –

          Folder => Directory

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186234 — Diff: maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java — @@ -84,6 +90,43 @@ the IT.</li> </ul> <p/> + * To let the IT create a Maven module below some other Maven project (being generated from another archetype) + * one can additionally specify an optional <code>archetype.pom.properties</code> file in the parent directory, + * specifying the archetype's <code>groupId</code>, <code>artifactId</code> and <code>version</code> along with its + * <code>archetype.properties</code> file, containing properties for project generation. Both files are leveraged + * to create the parent project for this IT. Parent projects can be nested. + * An example structure for such an integration test looks like this + * <table> + * <tr> + * <th>File/Folder</code></td> End diff – Folder => Directory
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186199

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/verify.bsh —
          @@ -0,0 +1,46 @@
          +
          +/*
          + * 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.*;
          +import org.codehaus.plexus.util.*;
          +
          +basedir = new File( basedir, "target/test-classes/projects/basic/project/project/basic" );
          +if (!basedir.exists())

          { + throw new Exception( basedir + " is missing." ); +}

          +
          +File main = new File( basedir, "src/main" );
          +
          +// check <fileset packaged="true">
          +File app = new File( main, "java/build/archetype/App.java" );
          +if ( !app.isFile() )
          +

          { + throw new Exception( app + " file is missing or not a file." ); +}

          +
          +File buildLog = new File(basedir, "build.log");
          +
          +String content = FileUtils.fileRead( buildLog, "UTF-8" );
          +
          +int idx = content.indexOf( "Yeah Baby it rocks!");
          +if ( idx < 0 )
          +{
          + throw new Exception( "build.log missing out.println from verify.groovy" );
          — End diff –

          `System.out.println` and not `out.println`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186199 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/verify.bsh — @@ -0,0 +1,46 @@ + +/* + * 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.*; +import org.codehaus.plexus.util.*; + +basedir = new File( basedir, "target/test-classes/projects/basic/project/project/basic" ); +if (!basedir.exists()) { + throw new Exception( basedir + " is missing." ); +} + +File main = new File( basedir, "src/main" ); + +// check <fileset packaged="true"> +File app = new File( main, "java/build/archetype/App.java" ); +if ( !app.isFile() ) + { + throw new Exception( app + " file is missing or not a file." ); +} + +File buildLog = new File(basedir, "build.log"); + +String content = FileUtils.fileRead( buildLog, "UTF-8" ); + +int idx = content.indexOf( "Yeah Baby it rocks!"); +if ( idx < 0 ) +{ + throw new Exception( "build.log missing out.println from verify.groovy" ); — End diff – `System.out.println` and not `out.println`.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186193

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/verify.bsh —
          @@ -0,0 +1,46 @@
          +
          +/*
          + * 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.*;
          +import org.codehaus.plexus.util.*;
          +
          +basedir = new File( basedir, "target/test-classes/projects/basic/project/project/basic" );
          +if (!basedir.exists())

          { + throw new Exception( basedir + " is missing." ); +}

          +
          +File main = new File( basedir, "src/main" );
          +
          +// check <fileset packaged="true">
          +File app = new File( main, "java/build/archetype/App.java" );
          +if ( !app.isFile() )
          +

          { + throw new Exception( app + " file is missing or not a file." ); +}

          +
          +File buildLog = new File(basedir, "build.log");
          +
          +String content = FileUtils.fileRead( buildLog, "UTF-8" );
          +
          +int idx = content.indexOf( "Yeah Baby it rocks!");
          — End diff –

          Content does not correspong to the `sysout` and whitespace is missing.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186193 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/verify.bsh — @@ -0,0 +1,46 @@ + +/* + * 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.*; +import org.codehaus.plexus.util.*; + +basedir = new File( basedir, "target/test-classes/projects/basic/project/project/basic" ); +if (!basedir.exists()) { + throw new Exception( basedir + " is missing." ); +} + +File main = new File( basedir, "src/main" ); + +// check <fileset packaged="true"> +File app = new File( main, "java/build/archetype/App.java" ); +if ( !app.isFile() ) + { + throw new Exception( app + " file is missing or not a file." ); +} + +File buildLog = new File(basedir, "build.log"); + +String content = FileUtils.fileRead( buildLog, "UTF-8" ); + +int idx = content.indexOf( "Yeah Baby it rocks!"); — End diff – Content does not correspong to the `sysout` and whitespace is missing.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186185

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/verify.bsh —
          @@ -0,0 +1,46 @@
          +
          +/*
          + * 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.*;
          +import org.codehaus.plexus.util.*;
          +
          +basedir = new File( basedir, "target/test-classes/projects/basic/project/project/basic" );
          +if (!basedir.exists()) {
          — End diff –

          whitespase missing

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186185 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/verify.bsh — @@ -0,0 +1,46 @@ + +/* + * 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.*; +import org.codehaus.plexus.util.*; + +basedir = new File( basedir, "target/test-classes/projects/basic/project/project/basic" ); +if (!basedir.exists()) { — End diff – whitespase missing
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186177

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/verify.groovy —
          @@ -0,0 +1 @@
          +System.out.println(" Yeah Baby it rocks!")
          — End diff –

          Please add trailing line break and change to proper English: "Yeah baby, it rocks!"

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186177 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/verify.groovy — @@ -0,0 +1 @@ +System.out.println(" Yeah Baby it rocks!") — End diff – Please add trailing line break and change to proper English: "Yeah baby, it rocks!"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186173

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/reference/pom.xml —
          @@ -0,0 +1,32 @@
          +<?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.
          +--><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>
          + <artifactId>project</artifactId>
          + <groupId>com.company</groupId>
          + <version>1.0-SNAPSHOT</version>
          + </parent>
          +
          + <groupId>archetype.it</groupId>
          + <artifactId>basic</artifactId>
          + <version>0.1-SNAPSHOT</version>
          — End diff –

          This `<vesion>` is redundant unless you want to override parent. Remove.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186173 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/basic/reference/pom.xml — @@ -0,0 +1,32 @@ +<?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. +--><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> + <artifactId>project</artifactId> + <groupId>com.company</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + + <groupId>archetype.it</groupId> + <artifactId>basic</artifactId> + <version>0.1-SNAPSHOT</version> — End diff – This `<vesion>` is redundant unless you want to override parent. Remove.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186161

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/archetype.properties —
          @@ -0,0 +1,4 @@
          +groupId=com.company
          +artifactId=project
          +version=1.0-SNAPSHOT
          +package=com.company.project
          — End diff –

          Please add trailing line break.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186161 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/archetype.properties — @@ -0,0 +1,4 @@ +groupId=com.company +artifactId=project +version=1.0-SNAPSHOT +package=com.company.project — End diff – Please add trailing line break.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186157

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/archetype.pom.properties —
          @@ -0,0 +1,4 @@
          +# https://github.com/mojohaus/pom-root, creates simple pom with packaging pom
          +groupId=org.codehaus.mojo.archetypes
          +artifactId=pom-root
          +version=1.1
          — End diff –

          Please add trailing line break.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186157 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/src/test/resources/projects/archetype.pom.properties — @@ -0,0 +1,4 @@ +# https://github.com/mojohaus/pom-root , creates simple pom with packaging pom +groupId=org.codehaus.mojo.archetypes +artifactId=pom-root +version=1.1 — End diff – Please add trailing line break.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on a diff in the pull request:

          https://github.com/apache/maven-archetype/pull/8#discussion_r70186131

          — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/pom.xml —
          @@ -0,0 +1,63 @@
          +<?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.
          +-->
          +
          +<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>build-archetype-and-run-its-with-existing-parent</artifactId>
          + <version>1.0-SNAPSHOT</version>
          + <packaging>maven-archetype</packaging>
          +
          + <name>build-archetype-with-existing-parent</name>
          + <description>packages an archetype then runs IT (archetype:integration-test) within a Maven Project being created through another archetype</description>
          +
          + <build>
          + <extensions>
          + <extension>
          + <groupId>org.apache.maven.archetype</groupId>
          + <artifactId>archetype-packaging</artifactId>
          + <version>@project.version@</version>
          + </extension>
          + </extensions>
          +
          + <pluginManagement>
          + <plugins>
          + <plugin>
          + <artifactId>maven-archetype-plugin</artifactId>
          + <version>@project.version@</version>
          + <configuration>
          + <settingsFile>$

          {basedir}/test-settings.xml</settingsFile>
          + <localRepositoryPath>${basedir}

          /target/local-repo</localRepositoryPath>
          — End diff –

          Please use the appropriate property for `target` instead of `$

          {basedir}

          /target`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on a diff in the pull request: https://github.com/apache/maven-archetype/pull/8#discussion_r70186131 — Diff: maven-archetype-plugin/src/it/build-archetype-and-run-its-with-existing-parent/pom.xml — @@ -0,0 +1,63 @@ +<?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. +--> + +<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>build-archetype-and-run-its-with-existing-parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>maven-archetype</packaging> + + <name>build-archetype-with-existing-parent</name> + <description>packages an archetype then runs IT (archetype:integration-test) within a Maven Project being created through another archetype</description> + + <build> + <extensions> + <extension> + <groupId>org.apache.maven.archetype</groupId> + <artifactId>archetype-packaging</artifactId> + <version>@project.version@</version> + </extension> + </extensions> + + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-archetype-plugin</artifactId> + <version>@project.version@</version> + <configuration> + <settingsFile>$ {basedir}/test-settings.xml</settingsFile> + <localRepositoryPath>${basedir} /target/local-repo</localRepositoryPath> — End diff – Please use the appropriate property for `target` instead of `$ {basedir} /target`.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user kwin commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          Done

          Show
          githubbot ASF GitHub Bot added a comment - Github user kwin commented on the issue: https://github.com/apache/maven-archetype/pull/8 Done
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          @kwin Please squash your commits.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on the issue: https://github.com/apache/maven-archetype/pull/8 @kwin Please squash your commits.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ptahchiev commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          Hi @michael-o can you have a look at this pull-request. I don't have the rights to have it merged.

          Show
          githubbot ASF GitHub Bot added a comment - Github user ptahchiev commented on the issue: https://github.com/apache/maven-archetype/pull/8 Hi @michael-o can you have a look at this pull-request. I don't have the rights to have it merged.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user kwin commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          Is there anything more missing from this PR to get this merged before the next release?

          Show
          githubbot ASF GitHub Bot added a comment - Github user kwin commented on the issue: https://github.com/apache/maven-archetype/pull/8 Is there anything more missing from this PR to get this merged before the next release?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user kwin commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          I would need to have closer look at the already existing ITs. But that won't happen too soon I fear. Only an IT would make sense for this change.

          Show
          githubbot ASF GitHub Bot added a comment - Github user kwin commented on the issue: https://github.com/apache/maven-archetype/pull/8 I would need to have closer look at the already existing ITs. But that won't happen too soon I fear. Only an IT would make sense for this change.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ptahchiev commented on the issue:

          https://github.com/apache/maven-archetype/pull/8

          Can you also provide some tests with this pull-request?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ptahchiev commented on the issue: https://github.com/apache/maven-archetype/pull/8 Can you also provide some tests with this pull-request?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user kwin commented on the pull request:

          https://github.com/apache/maven-archetype/pull/8#issuecomment-154440343

          Could someone give me some feedback on this PR?

          Show
          githubbot ASF GitHub Bot added a comment - Github user kwin commented on the pull request: https://github.com/apache/maven-archetype/pull/8#issuecomment-154440343 Could someone give me some feedback on this PR?
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user kwin opened a pull request:

          https://github.com/apache/maven-archetype/pull/8

          ARCHETYPE-491

          allow to run integration test with another archetype as parent project

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/kwin/maven-archetype ARCHETYPE-491

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/maven-archetype/pull/8.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #8


          commit d24697a965a9f244b9d3ea36896ff66d34f3f40f
          Author: Konrad Windszus <konrad.windszus@netcentric.biz>
          Date: 2015-10-03T15:47:31Z

          ARCHETYPE-491 allow to run integration test with another archetype as
          parent project


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user kwin opened a pull request: https://github.com/apache/maven-archetype/pull/8 ARCHETYPE-491 allow to run integration test with another archetype as parent project You can merge this pull request into a Git repository by running: $ git pull https://github.com/kwin/maven-archetype ARCHETYPE-491 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/maven-archetype/pull/8.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #8 commit d24697a965a9f244b9d3ea36896ff66d34f3f40f Author: Konrad Windszus <konrad.windszus@netcentric.biz> Date: 2015-10-03T15:47:31Z ARCHETYPE-491 allow to run integration test with another archetype as parent project

            People

            • Assignee:
              michael-o Michael Osipov
              Reporter:
              kwin Konrad Windszus
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development