0

I am doing a maven smartbear soapui project. I have dependency for two plugins. `

<build>
    <plugins>
      <plugin>
        <groupId>com.smartbear.soapui</groupId>
        <artifactId>soapui-pro-maven-plugin</artifactId>
        <version>5.1.2</version>
        <executions>
          <execution>
            <id>pro</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <projectFile>${projectFile}</projectFile>
              <outputFolder>${basedir}/target/surefire-reports</outputFolder>
              <junitReport>true</junitReport>
              <exportAll>true</exportAll>
              <printReport>true</printReport>
              <testFailIgnore>true</testFailIgnore>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <soapuiProperties>
            <property>
              <name>soapui.logroot</name>
              <value>${project.build.directory}/surefire-reports/</value>
            </property>
            <property>
              <name>soapui.https.protocols</name>
              <value>TLSv1.2,SSLv3</value>
            </property>
          </soapuiProperties>
        </configuration>

        <dependencies>
          <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
          </dependency>
          <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.9.9-RC1</version>
          </dependency>
          <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.9.9-RC1</version>
          </dependency>
          <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.19.1</version>
            <type>maven-plugin</type>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>com.github.redfish4ktc.soapui</groupId>
        <artifactId>maven-soapui-extension-plugin</artifactId>
        <version>4.6.4.2</version>
        <executions>
          <execution>
            <id>redfish</id>
            <phase>test</phase>
            <configuration>
              <testSuiteProperties>
                <properties>
                  <property>PropertyCode=${propertyCode}</property>
                  <property>Environment=${environment}</property>
                  <Gateway>Gateway=${gateway}</Gateway>
                </properties>
              </testSuiteProperties>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>`

My tests need to have dependency plugin redfish as it supports soapuiTestSuite properties configuration.

Now when I tried to run this mvn install test, the build starts to run with first plugin and fails as it doesn't have second plugin downloaded and later runs again downloading second but fails. I need to have both the plugins and whole configuration setup before I run the goal.

I am new to Maven structure.

halfer
  • 19,824
  • 17
  • 99
  • 186
ChanChow
  • 1,346
  • 7
  • 28
  • 57

1 Answers1

0
  1. Add execute at the second plugin.
  2. For example, if you want to execute maven-soapui-extension-plugin before soapui-pro-maven-plugin you can add this execution:

        <executions>
                  <execution>
                      <id>soapui-tests</id>
                      <phase>verify</phase>
                      <goals>
                       <goal>test</goal>
                      </goals>
              </execution>
            </executions>
    
  3. And just do 'mvn install', because you have executions attached to default Maven lifecycle.

Look at the list of default Maven Lifecycle in the execution order: validate, initialize, .. deploy (docs here).

halfer
  • 19,824
  • 17
  • 99
  • 186
question_maven_com
  • 2,457
  • 16
  • 21