lcavallari-642 opened a new issue, #108:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/108

   In our Maven project we have an assembler submodule that uses the MOJO exec 
plugin to run the migration tool on a set of dependencies. When we build the 
project with mvn, it successfully builds, but with mvnd the following exception 
occurs:
   
   ```
   [DEBUG] joining on thread 
Thread[#1733,org.apache.tomcat.jakartaee.MigrationCLI.main(),5,org.apache.tomcat.jakartaee.MigrationCLI]
   [WARNING]
   java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
       at org.apache.tomcat.jakartaee.MigrationCLI.main (MigrationCLI.java:88)
       at org.codehaus.mojo.exec.ExecJavaMojo.doMain (ExecJavaMojo.java:375)
       at org.codehaus.mojo.exec.ExecJavaMojo.doExec (ExecJavaMojo.java:364)
       at org.codehaus.mojo.exec.ExecJavaMojo.lambda$execute$0 
(ExecJavaMojo.java:286)
       at java.lang.Thread.run (Thread.java:1570)
   ```
   
   The execution is simple: `mvnd clean install -DskipTests`.
   
   Quickly looking at the code it seems that we take for granted that there's 
always going to be a logger handler:
   
   ```java
   // Configure the explicit level
   Logger.getGlobal().getParent().getHandlers()[0].setLevel(level);
   ```
   
   but it doesn't seem to be the case.
   
   ---
   
   This is the definition of our plugin:
   
   ```xml
               <plugin>
                   <groupId>org.codehaus.mojo</groupId>
                   <artifactId>exec-maven-plugin</artifactId>
                   <version>3.5.0</version>
                   <executions>
                       <execution>
                           <id>migrate-java-ee-to-jakarta-ee-dependencies</id>
                           <phase>prepare-package</phase>
                           <goals>
                               <goal>java</goal>
                           </goals>
                           <configuration>
                               
<mainClass>org.apache.tomcat.jakartaee.MigrationCLI</mainClass>
                               <arguments>
                                   <argument>-profile=EE</argument>
                                   <argument>-logLevel=INFO</argument>
                                   
<argument>${project.build.directory}/original-dependencies</argument>
                                   
<argument>${project.build.directory}/migrated-dependencies</argument>
                               </arguments>
                           </configuration>
                       </execution>
                   </executions>
               </plugin>
   ```


-- 
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]

Reply via email to