You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/27 12:03:58 UTC

[GitHub] [netbeans-mavenutils-nbm-maven-plugin] ahauschulte opened a new pull request #28: [NETBEANSINFRA-264] Include runtime module libraries

ahauschulte opened a new pull request #28:
URL: https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin/pull/28


   The nbm Maven plugin packs module libraries together with the module.
   These libraries are stored at netbeans\modules\ext within the module's
   nbm file. However, only libraries with scope "compile" are recognized.
   If the module declares dependencies (direct or transitive) with scope
   "runtime" in its pom file, these libraries won't be included in the
   module's nbm file.
   
   Change the creation of the dependency tree so that dependencies with
   scope "compile" as well as "runtime" will be recognized.


-- 
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@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans-mavenutils-nbm-maven-plugin] matthiasblaesing commented on pull request #28: [NETBEANSINFRA-264] Include runtime module libraries

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #28:
URL: https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin/pull/28#issuecomment-1079971368


   > However, only libraries with scope "compile" are recognized. If the module declares dependencies (direct or transitive) with scope "runtime" in its pom file, these libraries won't be included in the module's nbm file.
   
   From my perspective this is correct behavior. What else would you expect from scope "runtime"? "runtime" means, that the environment where the compiled module is deployed to, must supply the corresponding dependencies.
   
   Consider jgit: It is distributed with NetBeans IDE and you might or might not want to bundle the library. If you put the dependency on the runtime classpath, it will have to be provided by the runtime, if you put it onto the compile classpath, it should be bundled.
   


-- 
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@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans-mavenutils-nbm-maven-plugin] ahauschulte commented on pull request #28: [NETBEANSINFRA-264] Include runtime module libraries

Posted by GitBox <gi...@apache.org>.
ahauschulte commented on pull request #28:
URL: https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin/pull/28#issuecomment-1081030849


   I think there are three different cases regarding dependency scopes in maven (https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope) that need to be taken into account here:
   
   - Dependencies with scope "compile" are necessary to compile and run the module. Those dependencies need to be put on the compile and runtime classpaths and they need to be bundled. The current implementation of the nbm maven plugin handles this correctly.
   - Dependencies with scope "provided" are necessary to run the module and might also be necessary to compile it. However, they are indeed supplied by the runtime environment. Thus, there is no need to include them in the module’s nbm file. The current implementation of the nbm maven plugin handles this correctly as well.
   - Dependencies with scope "runtime" need to be on the runtime classpath for the module to work properly but they are not required to compile the module. This might be the case for one reason or another. For example, classes could be loaded manually, which is commonly done for JDBC drivers. (Something like `Class.forName("com.mysql.cj.jdbc.Driver")`) This is where the current implementation of the nbm maven plugin causes me some trouble, since those runtime dependencies are not bundled with the module’s nbm file. If, in this example, the dependency for the MySQL driver has the scope "runtime", and is not, by chance, provided by the runtime environment, the JDBC driver will just be missing, which will cause trouble at runtime.
   
   While the problem described in the simplistic example above could be easily resolved by just changing the scope of the MySQL driver dependency from "runtime" to "compile", there are other constellations where this causes much more trouble. Consider large third-party libraries that make extensive use of scope "runtime" for their own dependencies. This is often the case when these libraries are built using gradle because gradle provides finer-grained control whether a library should "leak" its own dependencies to its client. This is done by making liberate use of the scope "runtime". (https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_separation)
   
   An example is the kafka library (https://github.com/apache/kafka; https://repo1.maven.org/maven2/org/apache/kafka/kafka_2.13/3.1.0/kafka_2.13-3.1.0.pom), which has quite a lot of runtime dependencies. If such a library is a dependency of your Netbeans module, a huge number of libs will be missing in the nbm file. In this case, though, you’ll get warnings from the nbm maven plugin if the verifyRuntime option hasn’t been deactivated. Anyway, with the current implementation, you’ll need to manually add all the missing transitive dependencies to your module’s pom file. 
   


-- 
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@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans-mavenutils-nbm-maven-plugin] ebarboni commented on pull request #28: [NETBEANSINFRA-264] Include runtime module libraries

Posted by GitBox <gi...@apache.org>.
ebarboni commented on pull request #28:
URL: https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin/pull/28#issuecomment-1081886074


   nbm maven plugin has a long history and some design choice to make some bridge between maven and netbeans dependencies concept. 
   In https://bits.netbeans.org/mavenutilities/nbm-maven-plugin/ at this section Maven Dependency vs. Apache NetBeans runtime dependency you may have some information.
   
   If you need this feature you have to propose it as an option in the plugin defaulting to existing "compile" behaviour. 


-- 
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@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans-mavenutils-nbm-maven-plugin] matthiasblaesing commented on pull request #28: [NETBEANSINFRA-264] Include runtime module libraries

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #28:
URL: https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin/pull/28#issuecomment-1082343094


   @ahauschulte sorry I indeed confused `provided` and `runtime`.


-- 
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@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans-mavenutils-nbm-maven-plugin] ahauschulte commented on pull request #28: [NETBEANSINFRA-264] Include runtime module libraries

Posted by GitBox <gi...@apache.org>.
ahauschulte commented on pull request #28:
URL: https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin/pull/28#issuecomment-1083570204


   This feature would indeed be very handy for my use case. I like the idea of making the extended behaviour (compile+runtime) optional and default set to the existing behaviour (compile only).
   
   I'll update the PR in the next few days.


-- 
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@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans-mavenutils-nbm-maven-plugin] ahauschulte commented on pull request #28: [NETBEANSINFRA-264] Include runtime module libraries

Posted by GitBox <gi...@apache.org>.
ahauschulte commented on pull request #28:
URL: https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin/pull/28#issuecomment-1086704189


   I introduced a new parameter (`includeRuntimeModuleLibraries`) to NetBeansManifestUpdateMojo. With the default setting the existing behaviour (compile only) is kept. If you set the parameter to true, the extended (compile+runtime) behaviour is triggered.


-- 
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@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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