[
https://jira.codehaus.org/browse/MINVOKER-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=326008#comment-326008
]
Martin Todorov edited comment on MINVOKER-152 at 5/31/13 11:40 AM:
-------------------------------------------------------------------
This is actually working.
However, one must explicitly define a directory pattern matching the names of
the directories containing pomless tests.
The example below illustrates how to have both pom-based and pomless invocation
tests by overriding the pomIncludes (which in my opinion should be handled
internally by default):
{code}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.8</version>
<configuration>
<debug>true</debug>
<preBuildHookScript>clean</preBuildHookScript>
<postBuildHookScript>verify</postBuildHookScript>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
</configuration>
<executions>
<execution>
<id>integration-tests-with-poms</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
<phase>package</phase>
<configuration>
<pomIncludes>
<pomInclude>**/pom.xml</pomInclude>
<pomInclude>**/*-pomless-*</pomInclude>
</pomIncludes>
</configuration>
</execution>
</executions>
</plugin>
{code}
I believe the scanner that locates all the directories containing pom.xml-s
should be further extended to check whether the directory contains an
invoker.properties, which is where you would specify the goals to invoke your
plugin. For example:
{code}
invoker.goals=groupId:plugin-name:${project.version}:goal -Dfoo=bar
{code}
was (Author: carlspring):
This is actually working. However, one must explicitly define a directory
pattern matching the names of the directories containing pomless tests. The
example below illustrates how to have both pom-based and pomless invocation
tests by using two separate executions:
{code}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.8</version>
<configuration>
<debug>true</debug>
<preBuildHookScript>clean</preBuildHookScript>
<postBuildHookScript>verify</postBuildHookScript>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
</configuration>
<executions>
<execution>
<id>integration-tests-with-poms</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
<phase>package</phase>
<configuration>
<pomExcludes>
<pomExclude>**/*-pomless-*</pomExclude>
</pomExcludes>
</configuration>
</execution>
<execution>
<id>integration-tests-without-poms</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
<phase>package</phase>
<configuration>
<pomIncludes>
<pomInclude>**/*-pomless-*</pomInclude>
</pomIncludes>
</configuration>
</execution>
</executions>
</plugin>
{code}
I believe the scanner that locates all the directories containing pom.xml-s
should be further extended to check whether the directory contains an
invoker.properties, which is where you would specify the goals to invoke your
plugin. For example:
{code}
invoker.goals=groupId:plugin-name:${project.version}:goal -Dfoo=bar
{code}
> Support pomless projects
> ------------------------
>
> Key: MINVOKER-152
> URL: https://jira.codehaus.org/browse/MINVOKER-152
> Project: Maven 2.x Invoker Plugin
> Issue Type: New Feature
> Affects Versions: 1.8
> Reporter: Robert Scholte
>
> I must be possible to test goals without a {{pom.xml}}, as in real life,
> because it can have a different behavior.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira