matthiasblaesing commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1126773022

   I checked with NB 13 and the TL;DR version is: It only looked as if you 
could integration tests with it. In reality they were run with surefire, in the 
wrong phase, without preparation. You may claim that the change in the NB14 
cycle broke thinks, but this is not the case, it just showed, that the project 
setup is broken.
   
   Here is a sample, starting with a broken (unprepared) project:
   
   ```xml
   <?xml version="1.0" encoding="UTF-8"?>
   <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>com.mycompany</groupId>
       <artifactId>mavenproject1</artifactId>
       <version>1.0-SNAPSHOT</version>
       <properties>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           <maven.compiler.source>11</maven.compiler.source>
           <maven.compiler.target>11</maven.compiler.target>
           
<exec.mainClass>com.mycompany.mavenproject1.Mavenproject1</exec.mainClass>
       </properties>
       <dependencies>
           <dependency>
               <groupId>junit</groupId>
               <artifactId>junit</artifactId>
               <version>4.12</version>
               <scope>test</scope>
           </dependency>
       </dependencies>
   </project>
   ```
   
   Integration tests can be enabled with (the added lines are a verbatim copy 
from the maven failsafe usage page):
   
   ```xml
   <?xml version="1.0" encoding="UTF-8"?>
   <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>com.mycompany</groupId>
       <artifactId>mavenproject1</artifactId>
       <version>1.0-SNAPSHOT</version>
       <properties>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           <maven.compiler.source>11</maven.compiler.source>
           <maven.compiler.target>11</maven.compiler.target>
           
<exec.mainClass>com.mycompany.mavenproject1.Mavenproject1</exec.mainClass>
       </properties>
       <dependencies>
           <dependency>
               <groupId>junit</groupId>
               <artifactId>junit</artifactId>
               <version>4.12</version>
               <scope>test</scope>
           </dependency>
       </dependencies>
       <build>
           <plugins>
               <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-failsafe-plugin</artifactId>
                   <version>3.0.0-M6</version>
                   <executions>
                       <execution>
                           <goals>
                               <goal>integration-test</goal>
                               <goal>verify</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
           </plugins>
       </build>
   </project>
   ```
   
   I don't buy the argument "But this is not helpful for beginners". True, but:
   
   - beginners don't use integration tests
   - an integration test by definition requires setup and this thinking about 
how it should be executed
   - without the setup step, integration will not be run as part of the maven 
lifecycle and thus the build will be unstable/invalid. You need to setup 
failsafe
   
   And a final point failsafe might be most used plugin, but there might be 
others (maybe inhouse developed), that tie into the global `integration-test` 
and `verify`  goals and these can now still be used (if the same property to 
select the method to run).
   
   The only thing that might be a real issue is, that the user is not informed 
about the fact, the project is broken (i.e. that there is no plugin tied to the 
`integration-test` goal), that might be a worthy enhancement.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to