You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2023/12/01 09:30:21 UTC

[I] Switch from `bnd:jar` to `bnd:bnd-process` [logging-parent]

ppkarwasz opened a new issue, #69:
URL: https://github.com/apache/logging-parent/issues/69

   Currently we are using the [`jar` goal](https://github.com/bndtools/bnd/tree/master/maven-plugins/bnd-maven-plugin#jar-goal) of the BND plugin to generate:
   
   - an OSGi manifest,
   - a JPMS module descriptor,
   - a set of `META-INF/services` files.
   
   All this happens in the `package` phase of the [Maven Lifecycle](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference) and is therefore available only for integration tests.
   
   We should consider using the [`bnd-process` goal](https://github.com/bndtools/bnd/tree/master/maven-plugins/bnd-maven-plugin#bnd-process-goal), which produces the same files in the `process-classes` phase and makes them available to unit tests.
   
   Such a change would require:
   
   - [ ] changing the BND goal from `jar` to `bnd-process`. Since the `bnd-process` goal does not require `<extension>true</extension>`, it would also solve #34,
   - [ ] check the configuration of the Maven Jar Plugin that will automatically activate,
   - [ ] check the configuration of the Maven Surefire Plugin: IIRC the plugin detects the presence of `module-info.class` file (not a `module-info.java` file as documented), so we _might_ need to use [<useModulePath>false</useModulePath](https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#useModulePath),
   - [ ] checking how IDEs react to the presence of `module-info.class` and if they can integrate BND as part of their build (Eclipse M2E can integrate Maven plugins in its build, I am not sure about IDEA).
   
   **Remark**: switching from `jar` to `bnd-process` might have another beneficial effect. Currently if the `package` phase has multiple plugin executions, BND removes the Maven Jar plugin execution and adds its own **at the end** (not sure if that is fixable). E.g.: adding `spring-boot:repackage` in a naive way, causes `spring-boot:repackage` to be executed before `bnd:jar`.


-- 
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: notifications-unsubscribe@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Switch from `bnd:jar` to `bnd:bnd-process` [logging-parent]

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on issue #69:
URL: https://github.com/apache/logging-parent/issues/69#issuecomment-1845463970

   @ppkarwasz, thanks for the update. I am right now busy with testing various configurations against both `2.x` and `main` branches of Log4j.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Switch from `bnd:jar` to `bnd:bnd-process` [logging-parent]

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #69:
URL: https://github.com/apache/logging-parent/issues/69#issuecomment-1845373576

   This issue seems to be a little bit more complicated: if we simply switch from `jar` to `bnd-process`, not only IDEs will be confused by `target/classes/module-info.class` files, but Maven plugins too.
   
   For example Maven Compiler Plugin starts using the module path if it finds such a file (and AFAIK this is not switchable). So a `./mvnw compile` might fail if it is not used together with `clean`.
   
   A solution to this _conundrum_ might be offered by the [`-plugin`](https://bnd.bndtools.org/instructions/plugin.html) instruction in BND. We could run both BND goals:
   
   - in the `bnd-process` goal we only activate the [`SPIDescriptorGenerator`](https://github.com/bndtools/bnd/blob/master/biz.aQute.bndlib/src/aQute/bnd/plugin/spi/SPIDescriptorGenerator.java) plugin,
   - in the `jar` goal we activate all plugins.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Switch from `bnd:jar` to `bnd:bnd-process` [logging-parent]

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy closed issue #69: Switch from `bnd:jar` to `bnd:bnd-process`
URL: https://github.com/apache/logging-parent/issues/69


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org