You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/10/14 22:09:52 UTC
[GitHub] [maven-ear-plugin] mabrarov opened a new pull request #24: MEAR-153 skinnyWars or SAR and HAR modules
mabrarov opened a new pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24
Changes:
* [MEAR-153] - Support of skinnyWars for SAR modules
* [MEAR-153] - Support of skinnyWars for HAR modules
Note that this pull request yet doesn't cover all types of EAR modules supported by Maven EAR Plugin. These types need to be investigated and support for them needs to be implemented if required:
* WSR (I failed to find information about this type of EAR modules)
* RAR (it looks like this type can have JARs bundled within it)
There are EAR module types (like AOP and ESB) which:
* are supported by [JBoss Packaging Maven Plugin](https://github.com/mojohaus/jboss-packaging-maven-plugin)
* may have bundled JARs
* are not supported by Maven EAR Plugin 3.1.0
I don't think that MEAR-153 covers these EAR module types, so I have no plans to implement support of skinnyWars options for this types.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739535717
I fixed [that issue](https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739500692) with not empty diff by merge master branch into the source branch of this pull request. No this pull request has empty diff. @hboutemy, it looks like you merged source branch of this pull request into the master branch in 954b7363f7d522c0477207ca16b13b64272650fd, so I request you to take decision on this pull request - whether to merge it for correct history, or decline it (because all changes were merged somehow without this PR).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-733909141
Hey guy, is it possible to release EAR plugin 3.2.0 with #24 and #22 this year? It would be a nice New Year's gift :) Thank you for your patience and work.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] hboutemy closed pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
hboutemy closed pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required (`skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny).
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-712134089
> https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven-ear-plugin/job/mear-153/
It looks like smth wrong with Jenkins - build looks hanged on checkout phase:

----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] rfscholte commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-728278651
I had a look at https://maven.apache.org/plugins/maven-ear-plugin/examples/skinny-wars.html to understand the current implementation. It is a little bit different to what I was expecting, but it makes sense.
Your last proposal with the sharedLibs per modules combined with includes/excludes is what I was expecting and give maximum control.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507837865
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
Review comment:
Addressed in 83a46e0
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration and perform fine tuning when required.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of ER module, but this looks more complicated (to understand and to implement).
But I'm not sure if this feature is really wanted by users of Maven EAR Plugin... I never had a need:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-730289313
@hboutemy,
The ["Maven EAR Plugin 3.2.0 with skinnyModules option"](https://lists.apache.org/thread.html/rbcf8c12948893ff80483e2456fb6bdd78a20c94720746a94ad474741%40%3Cusers.maven.apache.org%3E) topic I started in the users@maven.apache.org mailing list has no answers for a week. It looks like we won't get any feedback except [the one](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385) which we got here from @rfscholte. Maybe it's time to complete with this pull request and pull request #22 (these 2 pull request will produce merge conflicts which I resolved in [merge/MEAR-153_into_MEAR-216](/mabrarov/maven-ear-plugin/tree/merge/MEAR-153_into_MEAR-216) branch) and then release Maven EAR Plugin 3.2.0. Thank you for your help.
@rfscholte,
If you agree with [my proposal](/apache/maven-ear-plugin/pull/24#issuecomment-727590153) and with my suggestion to implement the proposal in a dedicated (new) feature request (pull request), then please confirm that here (approval of this pull request is appreciated too). Please note that this pull request doesn't prevent implementation of that proposal in a backward compatible way - this is the thing which I care about, because I'd prefer to not implement `skinnyModules` feature at all if it will make impossible giving later the maximum control you suggested. Thank you for sharing this idea. I'll open Jira ticket for `sharedLibs` property of EAR module. Maybe I'll be able to work on it this year.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725337460
Hi @hboutemy,
> the new feature is triggered by a specific parameter: then can't break existing users configuration?
Yes. That's one of my intentions - changes should not impact existing projects and the new behavior should work only for users who want / need and explicitly requested it through configuration.
> shouldn't we update the version to 3.2.0?
I believe version needs to be changed (3.2.0 looks like a good candidate), but I don't know how it is performed in this project. I thought version change is performed by maintainers when decision on new release is made.
> I'm not a EAR user either
I am :( Just curious who else can help. dev@maven.apache.org keeps silent. Maybe I need to try users@maven.apache.org ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727577039
> Just as an example: suppose you have several wars in an EAR and you know that they all use the same logging framework, so these artifacts are the once you want to extract from the WAR and put it in the lib of the EAR. it might also another set of artifacts. The choice of doing a subset and not all might have to do with the classloading strategies.
Just don't add non-shared libraries into EAR dependencies - refer to the note at the end of [my previous comment](/apache/maven-ear-plugin/pull/24#issuecomment-727563337).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and to keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note** that if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating the need in `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required (`skinnyModules == true` in configuration and `skinny = false` for some modules or default / omited `skinnyModules` and `skinny == true` for some modules).
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of ER module, but this looks more complicated (to understand and to implement).
But I'm not sure if this feature is really wanted by users of Maven EAR Plugin... I never had a need:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module, but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement then right here - in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727590153
Just a case / proposal for the further work on design of inclusion / exclusion:
```text
eartest-war-xxx.war
└───WEB-INF/lib/
├─── lib1-lib11-xxx.jar
├─── lib1-lib12-xxx.jar
├─── lib2-lib21-xxx.jar
├─── lib2-lib22-xxx.jar
└─── lib2-lib23-xxx.jar
eartest-rar-xxx.rar
├─── lib1-lib11-xxx.jar
├─── lib1-lib12-xxx.jar
├─── lib2-lib21-xxx.jar
├─── lib2-lib22-xxx.jar
└─── lib2-lib23-xxx.jar
```
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eartest</groupId>
<artifactId>ear</artifactId>
<version>xxx</version>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyModules -->
<exclusion>
<groupId>lib2</groupId>
<artifactId>lib23</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyModules -->
<exclusion>
<groupId>lib2</groupId>
<artifactId>lib23</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<skinnyModules>true</skinnyModules>
<modules>
<webModule>
<groupId>eartest</groupId>
<artifactId>war</artifactId>
<sharedLibs>
<inlcusions>
<inclusion>
<groupId>lib1</groupId>
<artifactId>lib11</artifactId>
</inclusion>
</inlcusions>
</sharedLibs>
</webModule>
<rarModule>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<sharedLibs>
<exclusions>
<exclusion>
<groupId>lib2</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</rarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
```text
eartest-ear-xxx.ear
├─── lib
│ ├─── lib1-lib11-xxx.jar
│ ├─── lib1-lib12-xxx.jar
│ ├─── lib2-lib21-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│ └─── lib2-lib22-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│
├─── eartest-war-xxx.war
│ └─── WEB-INF/lib/
│ ├─── lib1-lib12-xxx.jar
│ ├─── lib2-lib21-xxx.jar
│ ├─── lib2-lib22-xxx.jar
│ └─── lib2-lib23-xxx.jar
│
└─── eartest-rar-xxx.rar
├─── lib2-lib21-xxx.jar
├─── lib2-lib22-xxx.jar
└─── lib2-lib23-xxx.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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r523751706
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
Sorry, but I didn't get your note. `libDirectory` here is a property of EAR module. It's not the place where shared libraries are moved (refer to `defaultLibBundleDir` option of plugin configuration). It's the place inside EAR module from which shared libraries (libraries of EAR module which are among EAR dependencies) are moved.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727581338
> But that's only an instruction for Maven to download, it is not an instruction for the maven-ear-plugin what not to include.
I agree, but it's the way Maven EAR Plugin is implemented at the moment. Library is not considered "shared" until it is found among dependencies of EAR. It looks like implementer of skinnyWars option cut corners.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and to keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note** that if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating the need of `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required (`skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny).
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
My main concern for making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your qustion](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module).
That way we can use global configuration and perform fine tuning when required. But I'm not sure if this feature is really wanted by users of Maven EAR Plugin... I never had a need:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r523751706
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
Sorry, but I didn't get your note. `libDirectory` here is a property of EAR module. It's not the place where shared libraries are moved - it's the place inside EAR module from which shared libraries are moved.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507722777
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+ ...
+ <dependencies>
+ <!-- This is the JAR we want to share -->
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>shared-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>war</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>rar</artifactId>
+ <version>1.0.0</version>
+ <type>rar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>sar</artifactId>
+ <version>1.0.0</version>
+ <type>sar</type>
+ </dependency>
+ </dependencies>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+ <defaultLibBundleDir>libs/</defaultLibBundleDir>
+ <skinnyModules>true</skinnyModules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ | `-- application.xml
+ |-- libs
+ | `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then
+ this location can be configured using <<<libDirectory>>> property.
+
+ Here is example for SAR which contains libraries at the root of archive
Review comment:
Addressed in 83a46e0
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+ ...
+ <dependencies>
+ <!-- This is the JAR we want to share -->
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>shared-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>war</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>rar</artifactId>
+ <version>1.0.0</version>
+ <type>rar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>sar</artifactId>
+ <version>1.0.0</version>
+ <type>sar</type>
+ </dependency>
+ </dependencies>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+ <defaultLibBundleDir>libs/</defaultLibBundleDir>
+ <skinnyModules>true</skinnyModules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ | `-- application.xml
+ |-- libs
+ | `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
What, one more thing - if I need to keep just specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating a need of `non-skinny-lib.jar`) then I just do the following: I don't add `non-skinny-lib.jar` into EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-709352543
We may need to update documentation of Maven EAR Plugin with detailed description of skinnyModules option, its connection with skinnyWars option and with examples for skinnyModules option and libDirectory property of EAR module. All these things are visible in the new integration tests added in this PR.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-712134089
> https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven-ear-plugin/job/mear-153/
@elharo, it looks like smth is wrong with Jenkins - build looks hanged on checkout phase:

----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-721012822
What needs to be done for merging this pull request or what is missing / pending in this pull request? Is there something I have to add to pass review and merge this pull request?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] rfscholte commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727580442
> Just don't add non-shared libraries into EAR dependencies
The world isn't that perfect, you can't always control that, especially when working with third party artifacts. There is a reason why this part of the spec isn't implemented for the plugin, it is very difficult to do it right. And Maven is missing some optimizations. Most ear dependencies shouldn't download transitive dependencies. The work around is adding exclusions with wildcards. But that's only an instruction for Maven to download, it is not an instruction for the maven-ear-plugin what not to include.
I'll need some time to see if there is a better way to solve this.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739535717
I fixed [that issue](https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739500692) with not empty diff by merging the master branch into the source branch of this pull request. Now this pull request has empty diff.
@hboutemy, it looks like you merged source branch of this pull request into the master branch in 954b7363f7d522c0477207ca16b13b64272650fd, so I request you to take decision on this pull request - whether to merge this PR for correct history, or to decline this PR (because all changes were merged somehow without this PR).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739538879
Hi @hboutemy,
> Did I miss something?
No you didn't. It looks like you merged all changed I proposed in this PR. I'm just confused what to do with this PR.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] elharo commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
elharo commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507647064
##########
File path: src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
##########
@@ -360,34 +374,34 @@ public String toString()
}
/**
- * Cleans the bundle directory so that it might be used properly.
+ * Cleans the path pointing to resource inside archive so that it might be used properly.
Review comment:
the resource inside the archive
##########
File path: src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
##########
@@ -91,6 +91,14 @@
private String moduleId;
+ /**
+ * Directory of module which contains libraries packaged into module. {@code null} value means that module
+ * doesn't contain any library. Each module type can provide default value for this directory and this option
+ * can be used to override that default value. If module libraries are located at the root of module then use
+ * single slash (/) to configure that in POM, i.e. single slash is treated as empty string.
Review comment:
single slash (/) to configure that in POM. That is, a single slash is treated as an empty string.
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarModule.java
##########
@@ -114,7 +114,8 @@ void resolveArtifact( Set<Artifact> artifacts )
boolean changeManifestClasspath();
/**
- * @return The libDir.
+ * @return The directory of module which contains JAR libraries packaged within module. Can be {@code null},
Review comment:
the directory of the module which contains the JAR files packages within the module
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
Review comment:
3.1.1., the
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
Review comment:
the Maven EAR
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
Review comment:
delete "just"
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -211,6 +211,18 @@
@Parameter( defaultValue = "false" )
private boolean skinnyWars;
+ /**
+ * Whether to create skinny EAR modules or not. A skinny EAR module is a WAR, SAR, HAR, RAR or WSR module that
+ * does not have all of its dependencies in it. Instead those dependencies are shared between the WARs, SARs, HARs,
+ * RARs and WSRs through the EAR. This option takes precedence over {@link #skinnyWars} option, i.e. if
Review comment:
over the
. i.e. --> . That is,
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -739,6 +751,11 @@ public boolean isNonFilteredExtension( String fileName )
private void changeManifestClasspath( EarModule module, File original, JavaEEVersion javaEEVersion )
throws MojoFailureException
{
+ final String moduleLibDir = module.getLibDir();
+ if ( !( moduleLibDir == null || skinnyModules || skinnyWars && module instanceof WebModule ) )
Review comment:
Please add some extra parentheses for those of us who don't immediately the exact precedence of || and &&
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -211,6 +211,18 @@
@Parameter( defaultValue = "false" )
private boolean skinnyWars;
+ /**
+ * Whether to create skinny EAR modules or not. A skinny EAR module is a WAR, SAR, HAR, RAR or WSR module that
+ * does not have all of its dependencies in it. Instead those dependencies are shared between the WARs, SARs, HARs,
Review comment:
"have all of its dependencies in it" --> contain all of its dependencies.
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -799,16 +816,16 @@ private void changeManifestClasspath( EarModule module, File original, JavaEEVer
classPath = new Attribute( "Class-Path", "" );
}
- // Remove JAR modules
- for ( JarModule jm : getAllJarModules() )
+ if ( moduleLibDir != null && ( skinnyModules || skinnyWars && module instanceof WebModule ) )
Review comment:
more parentheses please
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+ ...
+ <dependencies>
+ <!-- This is the JAR we want to share -->
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>shared-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>war</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>rar</artifactId>
+ <version>1.0.0</version>
+ <type>rar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>sar</artifactId>
+ <version>1.0.0</version>
+ <type>sar</type>
+ </dependency>
+ </dependencies>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+ <defaultLibBundleDir>libs/</defaultLibBundleDir>
+ <skinnyModules>true</skinnyModules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ | `-- application.xml
+ |-- libs
+ | `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then
+ this location can be configured using <<<libDirectory>>> property.
Review comment:
using the
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+ ...
+ <dependencies>
+ <!-- This is the JAR we want to share -->
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>shared-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>war</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>rar</artifactId>
+ <version>1.0.0</version>
+ <type>rar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>sar</artifactId>
+ <version>1.0.0</version>
+ <type>sar</type>
+ </dependency>
+ </dependencies>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+ <defaultLibBundleDir>libs/</defaultLibBundleDir>
+ <skinnyModules>true</skinnyModules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ | `-- application.xml
+ |-- libs
+ | `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then
+ this location can be configured using <<<libDirectory>>> property.
+
+ Here is example for SAR which contains libraries at the root of archive
Review comment:
the archive. (Refer
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+ ...
+ <dependencies>
+ <!-- This is the JAR we want to share -->
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>shared-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>war</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>rar</artifactId>
+ <version>1.0.0</version>
+ <type>rar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>sar</artifactId>
+ <version>1.0.0</version>
+ <type>sar</type>
+ </dependency>
+ </dependencies>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+ <defaultLibBundleDir>libs/</defaultLibBundleDir>
+ <skinnyModules>true</skinnyModules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ | `-- application.xml
+ |-- libs
+ | `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
Review comment:
This is good. In general, stick to third person or second if necessary. That is, I suggest rewriting the "We" in these docs as "You".
##########
File path: src/site/apt/index.apt.vm
##########
@@ -63,13 +63,18 @@ ${project.name}
For more information about the Java EE technology, please visit
{{http://www.oracle.com/us/technologies/java/enterprise-edition/overview/index.html}}.
+* Version 3.1.1
+
+ Starting with version 3.1.1 {{{./ear-mojo.html#skinnyModules}skinnyModules}} parameter
Review comment:
Delete "Starting with version 3.1.1" as it's redundant with the header.
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+ ...
+ <dependencies>
+ <!-- This is the JAR we want to share -->
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>shared-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>war</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>rar</artifactId>
+ <version>1.0.0</version>
+ <type>rar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>sar</artifactId>
+ <version>1.0.0</version>
+ <type>sar</type>
+ </dependency>
+ </dependencies>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+ <defaultLibBundleDir>libs/</defaultLibBundleDir>
+ <skinnyModules>true</skinnyModules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ | `-- application.xml
+ |-- libs
+ | `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then
Review comment:
an archive representing the EAR module has a non-standard location of libraries, then
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725337460
Hi @hboutemy,
> the new feature is triggered by a specific parameter: then can't break existing users configuration?
Yes. That's one of my intentions - changes should not impact existing projects and the new behavior should work only for users who want / need and explicitly requested it through configuration.
> shouldn't we update the version to 3.2.0?
I believe version needs to be changed (3.2.0 looks like a good candidate), but I don't know how it is performed in this project. I thought version change is performed by maintainers when decision on new release is made.
> I'm not a EAR user either
I am still an EAR user due to my company legacy tasks which will keep using EARs for at least next 10 years :( Just curious who else can help. dev@maven.apache.org keeps silent. Maybe I need to try users@maven.apache.org ?
Waiting for the results of Roland Asmann's [testing](https://issues.apache.org/jira/browse/MEAR-153?focusedCommentId=17218596&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17218596), but I doubt we will get them soon.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can add them as a new feature request and implement separately (based on this PR) - IMHO, that depends on how often this use case is needed (I won't use this feature in all known to me projects building EARs - I just don't need smth to be non-skinny are partially skinny).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r523751706
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
Sorry, but I didn't get your note. `libDirectory` here is a property of EAR module. It's not the place where shared libraries of skinny EAR module are moved (refer to `defaultLibBundleDir` option of plugin configuration). It's the place inside EAR module from which shared libraries (libraries of EAR module which are among EAR dependencies) are moved.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-710698558
@elharo, could you please trigger Jenkins build for this pull request?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r523751706
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
Sorry, but I didn't get your note. `libDirectory` here is a property of EAR module. It's not the target location where the shared libraries of skinny EAR module are moved (refer to `defaultLibBundleDir` option of plugin configuration). It's the source location inside EAR module from which shared libraries (libraries of EAR module which are among EAR dependencies) are moved.
`libDirectory` has default value depending on type of EAR module, so it's not always `null`. The need of `libDirectory` property comes from modules with non-standard layout. For example, JBoss Packaging Packaging Maven Plugin can package SAR putting libraries into a user defined directory of SAR (i.e. not into the default root of SAR).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] hboutemy commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
hboutemy commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739540158
It has been merged, even if GitHub can't really get it because of the last commit I amended...
let's close
and more importantly enjoy and say a big thank you for this nice new feature
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyWars or SAR and HAR modules
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-708724233
Maybe we need to revisit approach for MEAR-153 and:
* keep using skinnyWars option just for WARs
* introduce skinnyModules option with `false` default value to handle all supported types of modules (including WARs)
That way we could stay backward compatible.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725362303
@hboutemy
> then also to start a release
Please take a look at pull request #22 before that.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and to keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note** that if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating the need of `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement then right here - in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725337460
Hi @hboutemy,
> the new feature is triggered by a specific parameter: then can't break existing users configuration?
Yes. That's one of my intentions - changes should not impact existing projects and the new behavior should work only for users who explicitly want / need it.
> shouldn't we update the version to 3.2.0?
I believe version needs to be changed (3.2.0 looks like a good candidate), but I don't know how it is performed in this project. I thought version change is performed by maintainers when decision on new release is made.
> I'm not a EAR user either
I am :( Just curious who else can help. dev@maven.apache.org keeps silent. Maybe I need to try users@maven.apache.org ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-708724233
Maybe we need to revisit approach for MEAR-153 and:
* keep using skinnyWars option just for WARs
* introduce skinnyModules option with `false` default value to handle all supported types of modules (including WARs)
That way we could stay backward compatible.
Update: implemented skinnyModules option in d651844
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r523751706
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
Sorry, but I didn't get your note. `libDirectory` here is a property of EAR module. It's not the place where shared libraries of skinny EAR module are moved (refer to `defaultLibBundleDir` option of plugin configuration). It's the place inside EAR module from which shared libraries (libraries of EAR module which are among EAR dependencies) are moved.
`libDirectory` has default value depending on type of EAR module, so it's not always `null`. The need of `libDirectory` property comes from modules with non-standard layout. For example, JBoss Packaging Packaging Maven Plugin can package SAR putting libraries into a user defined directory of SAR (i.e. not into the default root of SAR).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727577039
> suppose you have several wars in an EAR and you know that they all use the same logging framework, so these artifacts are the once you want to extract from the WAR and put it in the lib of the EAR. it might also another set of artifacts.
Just don't add non-shared libraries into EAR dependencies - refer to the note at the end of [my previous comment](/apache/maven-ear-plugin/pull/24#issuecomment-727563337).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-709182701
We need smbd to test skinny RAR, HAR and SAR - I have no code with this kind of EAR modules to ensure that skinny RAR, HAR and SAR works correctly, i.e. are deployed with the same success level as non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required (`skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny).
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and to keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note**, if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating a need of `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
What, one more thing - if I need to keep just specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating a need of `non-skinny-lib.jar`) then I just do the following: I don't add `non-skinny-lib.jar` into EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov removed a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov removed a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-708895192
Support of RAR is implemented. Support of WSR is implemented as part of RAR support. I cannot test it yet, because I still have no information about WSR packaging / module type.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-709182701
We need smbd to test skinny RAR, HAR and SAR - I have no code with this kind of EAR modules to ensure that skinny RAR, HAR and SAR works correctly, i.e. are deployed with the same success state as non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r505737237
##########
File path: src/test/resources/projects/project-094/ear/pom.xml
##########
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>ear</groupId>
+ <artifactId>maven-ear-plugin-test-project-094-parent</artifactId>
+ <version>99.0</version>
+ </parent>
+ <artifactId>maven-ear-plugin-test-project-094</artifactId>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>jar-sample-three-with-deps</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>sar-sample-two</artifactId>
+ <type>sar</type>
+ <!--
+ By some reason dependencies of SAR come into EAR as transitive dependencies while they should not,
+ because SAR contains its dependencies packaged as libraries (like WAR).
+ Looks like a bug of SAR packaging, i.e. bug of JBoss Packaging Maven Plugin where
+ includesDependencies should be explicitly set to true for
Review comment:
Refer to [that comment](https://github.com/mojohaus/jboss-packaging-maven-plugin/commit/bf85249a7514aff3729c862faf7bcfed274a522b#r43279570) in [jboss-packaging-maven-plugin](https://github.com/mojohaus/jboss-packaging-maven-plugin) GitHub project.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] hboutemy commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
hboutemy commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739538449
Hi Marat,
yes, I merged this PR but amended the last commit message because it was written against MEAR-216 instead of MEAR-153: I was waiting for Apache Jenkins job to finish before closing PR, Jira, and thanking you much for your hard work.
Did I miss something?
Regards,
Hervé
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507838067
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727590153
Proposal for the further work on design of shared libraries inclusion / exclusion (i.e. this comment is not directly related to this pull request). Backward compatible with this pull request and `skinnyWars` option.
```text
eartest-war1-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-war2-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-rar1-xxx.rar
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-rar2-xxx.rar
├─── group1-lib1-xxx.jar
└─── group1-lib2-xxx.jar
```
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eartest</groupId>
<artifactId>ear</artifactId>
<version>xxx</version>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar2</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar2</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<skinnyModules>true</skinnyModules>
<modules>
<webModule>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<sharedLibs>
<!-- Used only if skinnyWars or skinnyModules is turned on -->
<inlcusions>
<inclusion>
<groupId>group1</groupId>
<artifactId>lib1</artifactId>
</inclusion>
</inlcusions>
</sharedLibs>
</webModule>
<webModule>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<sharedLibs>
<!-- Should by non-skinny -->
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</webModule>
<rarModule>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<sharedLibs>
<!-- Used only if skinnyModules is turned on -->
<exclusions>
<exclusion>
<groupId>group2</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</rarModule>
<rarModule>
<groupId>eartest</groupId>
<artifactId>rar2</artifactId>
</rarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
```text
eartest-ear-xxx.ear
├─── lib
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│ └─── group2-lib2-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│
├─── eartest-war1-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
├─── eartest-war2-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
├─── eartest-rar1-xxx.rar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
└─── eartest-rar2-xxx.rar
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] elharo commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
elharo commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-723132125
At this point, you need to locate a Java EE savvy committer who understands the details of the EAR format and what this plugin is used for to review and approve. I don't use this plugin or Java EE so I can't help with that part.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] hboutemy commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
hboutemy commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725328892
sorry, I have been away these times...
FYI, I'm not a EAR user either, then I don't have strong opinion on use cases, sorry. But I want to help people doing hard and good work like this one.
I have 2 questions to evaluate before merging:
1. IIUC, the new feature is triggered by a specific parameter: then can't break existing users configuration?
2. shouldn't we update the version to 3.2.0?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can add them as a new feature request and implement separately (based on this PR). IMHO, depending on how often this use case is needed we can implement it here or in a new PR (feature request). I won't use this feature in all known to me projects building EARs - I just don't need smth to be non-skinny or "partially skinny".
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] hboutemy edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
hboutemy edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725328892
sorry, I have been away these times...
FYI, I'm not a EAR user either, then I don't have strong opinion on use cases, sorry. But I want to help people doing hard and good work like this one (unit tests, integration tests, documentation).
I have 2 questions to evaluate before merging:
1. IIUC, the new feature is triggered by a specific parameter: then can't break existing users configuration?
2. shouldn't we update the version to 3.2.0?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739500692
It looks like this pull request was partially merged, because the diff has reduced but is still not empty:
https://github.com/apache/maven-ear-plugin/compare/master...mabrarov:MEAR-153

----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
What, one more thing - if I need to keep just specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating a need of `non-skinny-lib.jar`) then I just do the following: I don't add `non-skinny-lib.jar` into EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507723769
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarModule.java
##########
@@ -114,7 +114,8 @@ void resolveArtifact( Set<Artifact> artifacts )
boolean changeManifestClasspath();
/**
- * @return The libDir.
+ * @return The directory of module which contains JAR libraries packaged within module. Can be {@code null},
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement then right here - in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] rfscholte commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727576290
Just as an example: suppose you have several wars in an EAR and you know that they all use the same logging framework, so these artifacts are the once you want to extract from the WAR and put it in the lib of the EAR. it might also another set of artifacts. The choice of doing a subset and not all might have to do with the classloading strategies.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727577039
> suppose you have several wars in an EAR and you know that they all use the same logging framework, so these artifacts are the once you want to extract from the WAR and put it in the lib of the EAR. it might also another set of artifacts.
Just don't add non-shared libraries into EAR dependencies - refer to the note at the end of [my previous comment](/apache/maven-ear-plugin/pull/24#issuecomment-727563337). I understand that it looks like a workaround, so if it's a real case with existing workaround, then I'd prefer to work on it in a dedicated feature request / pull request. It seems to be complicated for me to implement filtering of dependencies of EAR modules (should be moved our of EAR module or not in case of skinnyModules).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727590153
Proposal for the further work on design of shared libraries inclusion / exclusion (i.e. this comment is not directly related to this pull request). Backward compatible with this pull request and `skinnyWars` option.
```text
eartest-war1-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-war2-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-rar1-xxx.rar
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-rar2-xxx.rar
├─── group1-lib1-xxx.jar
└─── group1-lib2-xxx.jar
```
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eartest</groupId>
<artifactId>ear</artifactId>
<version>xxx</version>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar2</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar2</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<skinnyModules>true</skinnyModules>
<modules>
<webModule>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<sharedLibs>
<!-- Used only if skinnyWars or skinnyModules is turned on -->
<inlcusions>
<inclusion>
<groupId>group1</groupId>
<artifactId>lib1</artifactId>
</inclusion>
</inlcusions>
</sharedLibs>
</webModule>
<webModule>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<sharedLibs>
<!-- Should by non-skinny -->
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</webModule>
<rarModule>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<sharedLibs>
<!-- Used only if skinnyModules is turned on -->
<exclusions>
<exclusion>
<groupId>group2</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</rarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
```text
eartest-ear-xxx.ear
├─── lib
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│ └─── group2-lib2-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│
├─── eartest-war1-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
├─── eartest-war2-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
├─── eartest-rar1-xxx.rar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
└─── eartest-rar2-xxx.rar (all libraries matching EAR dependencies are consider shared by default if sharedLibs property is not specified)
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and to keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note** that if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating the need of `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-708895192
Support of RAR is implemented. Support of WSR is implemented as part of RAR support. I cannot test it yet, because I still have no information about WSR packaging / module type.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r523751706
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
Sorry, but I didn't get your note. `libDirectory` here is a property of EAR module. If it's used (if it's not `null`, by default or by explicit setting) when `skinnyModules` option is tuned **off** (default value of `skinnyModules` option) then modification of `Class-Path` entry of MANIFEST.MF is **not performed**. This is what this part of documentation tries to say.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] rfscholte commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-731558755
Looks good to me
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725337460
Hi @hboutemy,
> the new feature is triggered by a specific parameter: then can't break existing users configuration?
Yes. That's one of my intentions - changes should not impact existing projects and the new behavior should work only for users who explicitly want / need it.
> shouldn't we update the version to 3.2.0?
I believe version needs to be changed (3.2.0 looks like a good candidate), but I don't know how it is performed in this project. I thought version change is performed by maintainers when decision on new release is made.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required (`skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny).
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of ER module, but this looks more complicated (to understand and to implement).
But I'm not sure if this feature is really wanted by users of Maven EAR Plugin... I never had a need:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727590153
Proposal for the further work on design of shared libraries inclusion / exclusion (i.e. this comment is not directly related to this pull request). Backward compatible with this pull request and `skinnyWars` option.
```text
eartest-war1-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-war2-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-rar1-xxx.rar
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-rar2-xxx.rar
├─── group1-lib1-xxx.jar
└─── group1-lib2-xxx.jar
```
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eartest</groupId>
<artifactId>ear</artifactId>
<version>xxx</version>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar2</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar2</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<skinnyModules>true</skinnyModules>
<modules>
<webModule>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<sharedLibs>
<!-- Used only if skinnyWars or skinnyModules is turned on -->
<inlcusions>
<inclusion>
<groupId>group1</groupId>
<artifactId>lib1</artifactId>
</inclusion>
</inlcusions>
</sharedLibs>
</webModule>
<webModule>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<sharedLibs>
<!-- Should by non-skinny -->
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</webModule>
<rarModule>
<groupId>eartest</groupId>
<artifactId>rar1</artifactId>
<sharedLibs>
<!-- Used only if skinnyModules is turned on -->
<exclusions>
<exclusion>
<groupId>group2</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</rarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
```text
eartest-ear-xxx.ear
├─── lib
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│ └─── group2-lib2-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│
├─── eartest-war1-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
├─── eartest-war2-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
├─── eartest-rar1-xxx.rar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
└─── eartest-rar2-xxx.rar
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] hboutemy edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
hboutemy edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739538449
Hi Marat,
yes, I merged this PR but amended the last commit message in 30395beebffb0232d8ad7ffb03af57d919c1e89e because it was written against MEAR-216 instead of MEAR-153: I was waiting for Apache Jenkins job to finish before closing PR, Jira, and thanking you much for your hard work.
Did I miss something?
Regards,
Hervé
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727581338
> But that's only an instruction for Maven to download, it is not an instruction for the maven-ear-plugin what not to include.
I agree, but it's the way Maven EAR Plugin is implemented at the moment. Library is not considered "shared" until it is found among dependencies of EAR. It looks like implementer of skinnyWars option cut corners.
Note that we have [MEAR-166](https://issues.apache.org/jira/projects/MEAR/issues/MEAR-166) which implementation can be connected with (impacted by) your suggestion.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727590153
Proposal for the further work on design of shared libraries inclusion / exclusion (i.e. this comment is not directly related to this pull request). Backward compatible with this pull request and `skinnyWars` option.
Proposal for the further work on design of shared libraries inclusion / exclusion (i.e. this comment is not directly related to this pull request). Backward compatible with this pull request and `skinnyWars` option.
Proposal for the further work on design of shared libraries inclusion / exclusion (i.e. this comment is not directly related to this pull request). Backward compatible with this pull request and `skinnyWars` option.
```text
eartest-war1-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-war2-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-rar-xxx.rar
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
```
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eartest</groupId>
<artifactId>ear</artifactId>
<version>xxx</version>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<skinnyModules>true</skinnyModules>
<modules>
<webModule>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<sharedLibs>
<!-- Used only if skinnyWars or skinnyModules is turned on -->
<inlcusions>
<inclusion>
<groupId>group1</groupId>
<artifactId>lib1</artifactId>
</inclusion>
</inlcusions>
</sharedLibs>
</webModule>
<webModule>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<sharedLibs>
<!-- Should by non-skinny -->
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</webModule>
<rarModule>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<sharedLibs>
<!-- Used only if skinnyModules is turned on -->
<exclusions>
<exclusion>
<groupId>group2</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</rarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
```text
eartest-ear-xxx.ear
├─── lib
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│ └─── group2-lib2-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│
├─── eartest-war1-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
├─── eartest-war2-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
└─── eartest-rar-xxx.rar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and to keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note** that if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating the need of `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required (`skinnyModules == true` in configuration and `skinny = false` for some modules or default / omitted `skinnyModules` and `skinny == true` for some modules).
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of ER module, but this looks more complicated (to understand and to implement).
But I'm not sure if this feature is really wanted by users of Maven EAR Plugin... I never had a need:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] rfscholte commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
rfscholte commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r523746626
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
This makes we wonder if the explicit skinnyModules parameter is required. Setting the libDirectory seems enough to understand that artifacts from the modules are moved here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507721671
##########
File path: src/site/apt/index.apt.vm
##########
@@ -63,13 +63,18 @@ ${project.name}
For more information about the Java EE technology, please visit
{{http://www.oracle.com/us/technologies/java/enterprise-edition/overview/index.html}}.
+* Version 3.1.1
+
+ Starting with version 3.1.1 {{{./ear-mojo.html#skinnyModules}skinnyModules}} parameter
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required (`skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny).
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
But I'm not sure if this feature is really wanted by users of Maven EAR Plugin... I never had a need:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and to keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note** that if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating a need of `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507723262
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -211,6 +211,18 @@
@Parameter( defaultValue = "false" )
private boolean skinnyWars;
+ /**
+ * Whether to create skinny EAR modules or not. A skinny EAR module is a WAR, SAR, HAR, RAR or WSR module that
+ * does not have all of its dependencies in it. Instead those dependencies are shared between the WARs, SARs, HARs,
+ * RARs and WSRs through the EAR. This option takes precedence over {@link #skinnyWars} option, i.e. if
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] hboutemy commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
hboutemy commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725359072
great: yes, questioning on users@maven.apache.org seems a good option
defining the next version happens when working on an issue where it becomes clear that we're beyond bugfix: yours is like this
Please update your PR with that 3.2.0-SNAPSHOT, I'll do the Jira part
I'm waiting for your feedback to merge this PR, then also to start a release
Thanks a lot, it's great to get such contribution
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-731445940
@hboutemy,
> I'm waiting for your feedback to merge this PR, then also to start a release
Let's start working on this if nobody has concerns.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
What, one more thing - if I need to keep just specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating a need of `non-skinny-lib.jar`) then I just do the following: I don't add `non-skinny-lib.jar` into EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>jar-sample-one</artifactId>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny and keep other modules non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r523751706
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
Sorry, but I didn't get your note.
`libDirectory` here is a property of EAR module. It's not the target location where the shared libraries of skinny EAR module are moved (refer to `defaultLibBundleDir` option of plugin configuration). It's the source location inside EAR module from which shared libraries (libraries of EAR module which are among EAR dependencies) are moved.
`libDirectory` has default value depending on type of EAR module, so it's not always `null`. The need of `libDirectory` property comes from modules with non-standard layout. For example, JBoss Packaging Maven Plugin can package SAR putting libraries into a user defined directory of SAR (i.e. not into the default root of SAR).
##########
File path: src/site/apt/modules.apt.vm
##########
@@ -116,6 +116,30 @@ EAR Modules
* <<moduleId>> - sets the id of the module in the generated application.xml.
+ * <<libDirectory>> - sets archive directory which contains Java libraries (JARs)
+ packaged into archive. Default is <<<null>>> meaning that archive doesn't
+ contain packaged libraries.
+ If libraries are located at the root of archive then use single slash ('/')
+ to configure that.
+ If <<<libDirectory>>> is <<<null>>> then <<<Class-Path>>> setting of module
+ <<<MANIFEST.MF>>> is modified to reference libraries which are packaged in EAR.
+ Modification here means:
+
+ * If <<<MANIFEST.MF>>> has no <<<Class-Path>>> setting then it is added.
+
+ * Existing elements of <<<Class-Path>>> setting which match libraries packaged
+ in EAR are replaced with references to the matching libraries in EAR.
+
+ * Other libraries packaged in EAR are appended to <<<Class-Path>>> setting in order
+ of EAR dependency on library if
+ {{{./ear-mojo.html#skipClassPathModification}skipClassPathModification}} parameter
+ is false.
+
+ If <<<libDirectory>>> is not <<<null>>> and if
Review comment:
Sorry, but I didn't get your note.
`libDirectory` here is a property of EAR module. It's not the target location where the shared libraries of skinny EAR module are moved (refer to `defaultLibBundleDir` option of plugin configuration). It's the source location inside EAR module from which shared libraries (libraries of EAR module which are among EAR dependencies) are moved.
`libDirectory` has default value depending on type of EAR module, so it's not always `null`. The need of `libDirectory` property comes from modules with non-standard layout. For example, JBoss Packaging Maven Plugin can package SAR putting libraries into a user defined directory of SAR (i.e. not into the default root of SAR).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727577039
> suppose you have several wars in an EAR and you know that they all use the same logging framework, so these artifacts are the once you want to extract from the WAR and put it in the lib of the EAR. it might also another set of artifacts.
Just don't add non-shared libraries into EAR dependencies - refer to the note at the end of [my previous comment](/apache/maven-ear-plugin/pull/24#issuecomment-727563337). I understand that it looks like a workaround, so if it's a real case with existing workaround, then I'd prefer to work on it in a dedicated feature request / pull request. It seems to be complicated for me to implement filtering of dependencies of EAR modules (if specific dependency should be moved out of the EAR module or not in case of skinnyModules).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and to keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note** that if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating the need of `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-709352543
We may need to update documentation of Maven EAR Plugin with detailed description of skinnyModules option, its connection with skinnyWars option and with examples for skinnyModules option and libDirectory property of EAR module.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507722346
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+ ...
+ <dependencies>
+ <!-- This is the JAR we want to share -->
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>shared-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>war</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>rar</artifactId>
+ <version>1.0.0</version>
+ <type>rar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>sar</artifactId>
+ <version>1.0.0</version>
+ <type>sar</type>
+ </dependency>
+ </dependencies>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+ <defaultLibBundleDir>libs/</defaultLibBundleDir>
+ <skinnyModules>true</skinnyModules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ | `-- application.xml
+ |-- libs
+ | `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then
+ this location can be configured using <<<libDirectory>>> property.
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov removed a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov removed a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-708724233
Maybe we need to revisit approach for MEAR-153 and:
* keep using skinnyWars option just for WARs
* introduce skinnyModules option with `false` default value to handle all supported types of modules (including WARs)
That way we could stay backward compatible.
Update: implemented skinnyModules option in d651844
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-709352543
We may need to update documentation of Maven EAR Plugin with detail description of skinnyModules option, its connection with skinnyWars option and with examples for skinnyModules option and libDirectory property of EAR module.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] rfscholte commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-735182188
Let's see what I can do, not sure if I have enough time to do it this year.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov removed a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov removed a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-709352543
We may need to update documentation of Maven EAR Plugin with detailed description of skinnyModules option, its connection with skinnyWars option and with examples for skinnyModules option and libDirectory property of EAR module. All these things are visible in the new integration tests added in this PR.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507722576
##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+ * {{{../modules.html#webModule}WAR}}
+
+ * {{{../modules.html#rarModule}RAR}}
+
+ * {{{../modules.html#wsrModule}WSR}}
+
+ * {{{../modules.html#sarModule}SAR}}
+
+ * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+ ...
+ <dependencies>
+ <!-- This is the JAR we want to share -->
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>shared-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>war</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>rar</artifactId>
+ <version>1.0.0</version>
+ <type>rar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.acme</groupId>
+ <artifactId>sar</artifactId>
+ <version>1.0.0</version>
+ <type>sar</type>
+ </dependency>
+ </dependencies>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+ <defaultLibBundleDir>libs/</defaultLibBundleDir>
+ <skinnyModules>true</skinnyModules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ | `-- application.xml
+ |-- libs
+ | `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-709345711
@elharo, I do not plan any further work on or testing of these changes. Could you please trigger Jenkins build and review this pull request? Please note that these changes also fix backward incompatibility introduced by MEAR-267 (by pull request #19 )
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r510208486
##########
File path: src/test/resources/projects/project-094/ear/pom.xml
##########
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>ear</groupId>
+ <artifactId>maven-ear-plugin-test-project-094-parent</artifactId>
+ <version>99.0</version>
+ </parent>
+ <artifactId>maven-ear-plugin-test-project-094</artifactId>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>jar-sample-three-with-deps</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>war-sample-three</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>sar-sample-two</artifactId>
+ <type>sar</type>
+ <!--
+ By some reason dependencies of SAR come into EAR as transitive dependencies while they should not,
+ because SAR contains its dependencies packaged as libraries (like WAR).
+ Looks like a bug of SAR packaging, i.e. bug of JBoss Packaging Maven Plugin where
+ includesDependencies should be explicitly set to true for
Review comment:
Refer to https://github.com/mojohaus/jboss-packaging-maven-plugin/pull/3
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507723416
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -211,6 +211,18 @@
@Parameter( defaultValue = "false" )
private boolean skinnyWars;
+ /**
+ * Whether to create skinny EAR modules or not. A skinny EAR module is a WAR, SAR, HAR, RAR or WSR module that
+ * does not have all of its dependencies in it. Instead those dependencies are shared between the WARs, SARs, HARs,
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required:
* `skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny,
* or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as a new property of EAR module (`skinnyLibFilter` property could even eliminate need of `skinny` property), but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by the users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries (refer to the note at the end of this comment)
1. to make some modules of EAR skinny and keep other modules non-skinny.
Please, share more details about your thoughts and use cases. Maybe we can implement them as a new feature request in a separate pull request based on this pull request. Maybe - it depends on how often these use cases are needed - we can implement them right here, in this pull request. All known to me projects building EARs don't need some EAR modules to be non-skinny or "partially skinny" - all of them need all modules to be just skinny.
**Note**, if I need to keep just a specific library (`non-skinny-lib.jar`) in my skinny EAR modules (rare case, but I know at least one of them - we workaround that case by eliminating a need of `non-skinny-lib.jar`) then I just don't add the `non-skinny-lib.jar` into the EAR dependencies:
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ear</groupId>
<artifactId>maven-ear-plugin-test-project-092-parent</artifactId>
<version>99.0</version>
</parent>
<artifactId>maven-ear-plugin-test-project-092</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war-sample-three</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>sar-sample-two</artifactId>
<type>sar</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar-sample-one</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>non-skinny-lib</groupId>
<artifactId>non-skinny-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>libs</defaultLibBundleDir>
<skinnyModules>true</skinnyModules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507723916
##########
File path: src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
##########
@@ -360,34 +374,34 @@ public String toString()
}
/**
- * Cleans the bundle directory so that it might be used properly.
+ * Cleans the path pointing to resource inside archive so that it might be used properly.
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507724100
##########
File path: src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
##########
@@ -91,6 +91,14 @@
private String moduleId;
+ /**
+ * Directory of module which contains libraries packaged into module. {@code null} value means that module
+ * doesn't contain any library. Each module type can provide default value for this directory and this option
+ * can be used to override that default value. If module libraries are located at the root of module then use
+ * single slash (/) to configure that in POM, i.e. single slash is treated as empty string.
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507837640
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -739,6 +751,11 @@ public boolean isNonFilteredExtension( String fileName )
private void changeManifestClasspath( EarModule module, File original, JavaEEVersion javaEEVersion )
throws MojoFailureException
{
+ final String moduleLibDir = module.getLibDir();
+ if ( !( moduleLibDir == null || skinnyModules || skinnyWars && module instanceof WebModule ) )
Review comment:
Addressed in 83a46e0
##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -799,16 +816,16 @@ private void changeManifestClasspath( EarModule module, File original, JavaEEVer
classPath = new Attribute( "Class-Path", "" );
}
- // Remove JAR modules
- for ( JarModule jm : getAllJarModules() )
+ if ( moduleLibDir != null && ( skinnyModules || skinnyWars && module instanceof WebModule ) )
Review comment:
Addressed in 83a46e0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module).
That way we can use global configuration and perform fine tuning when required. But I'm not sure if this feature is really wanted by users of Maven EAR Plugin... I never had a need:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov commented on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov commented on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725395427
@hboutemy,
> Please update your PR with that 3.2.0-SNAPSHOT, I'll do the Jira part
PR updated as requested.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required.
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of ER module, but this looks more complicated (to understand and to implement).
But I'm not sure if this feature is really wanted by users of Maven EAR Plugin... I never had a need:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727563337
@ rfscholte,
Regarding [your question](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385).
> there will be a request to select per module which artifacts should be moved to the (shared) lib directory.
Do you mean "select skinny mode (move all or nothing) per module and not for all modules"?
If yes, then here are my thoughts:
I thought about the same but then decided that `skinnyWars` option doesn't provide such ability so that `skinnyModules` option can follow the same approach.
> Would such a change fit in this PR without adjusting the new parameters?
We can add both:
1. `skinnyModules` option of plugin configuration (implemented)
1. `skinny` property of EAR module which default value is equal to `skinnyModules` option of plugin configuration (`skinnyModules || skinnyWars` for web module). `skinny == false` will work the same way (will lead to the same) as when `libDirectory == null` (it's not possible to specify `null` value for `libDirectory` property of EAR module at the moment).
That way we can use global configuration (when we need just all modules) and choose what modules to make "skinny / non-skinny" when required (`skinnyModules == true` in configuration and `skinny == false` for the modules which need to be non-skinny or default / omitted `skinnyModules` and `skinny == true` for the modules which need to be skinny).
If you mean choosing subset of EAR module libraries to move into EAR shared lib directory, then we can add this feature too by implementing some artifact filter (`skinnyLibFilter`) as property of EAR module, but this looks more complicated (to understand and to implement).
My main concern against making all these changes (which complicate implementation and understanding) is that I'm not sure if this feature is really wanted by users of Maven EAR Plugin - I never had a need of anything like that:
1. to move into shared EAR lib directory just a part of EAR module libraries
1. to make some modules of EAR skinny while other - non-skinny.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727590153
Proposal for the further work on design of shared libraries inclusion / exclusion (i.e. this comment is not directly related to this pull request). Backward compatible with this pull request and `skinnyWars` option.
```text
eartest-war1-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-war2-xxx.war
└───WEB-INF/lib/
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
eartest-rar-xxx.rar
├─── group1-lib1-xxx.jar
├─── group1-lib2-xxx.jar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.jar
```
```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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eartest</groupId>
<artifactId>ear</artifactId>
<version>xxx</version>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<version>xxx</version>
<type>war</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<version>xxx</version>
<type>rar</type>
</dependency>
<dependency>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<version>xxx</version>
<type>pom</type>
<exclusions>
<!-- Global exclusion for skinnyWars and skinnyModules -->
<exclusion>
<groupId>group2</groupId>
<artifactId>lib3</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<skinnyModules>true</skinnyModules>
<modules>
<webModule>
<groupId>eartest</groupId>
<artifactId>war1</artifactId>
<sharedLibs>
<!-- Used only if skinnyWars or skinnyModules is turned on -->
<inlcusions>
<inclusion>
<groupId>group1</groupId>
<artifactId>lib1</artifactId>
</inclusion>
</inlcusions>
</sharedLibs>
</webModule>
<webModule>
<groupId>eartest</groupId>
<artifactId>war2</artifactId>
<sharedLibs>
<!-- Should by non-skinny -->
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</webModule>
<rarModule>
<groupId>eartest</groupId>
<artifactId>rar</artifactId>
<sharedLibs>
<!-- Used only if skinnyModules is turned on -->
<exclusions>
<exclusion>
<groupId>group2</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</sharedLibs>
</rarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
```text
eartest-ear-xxx.ear
├─── lib
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│ └─── group2-lib2-xxx.jar (Why? Because it's among dependencies of eartest:ear)
│
├─── eartest-war1-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
├─── eartest-war2-xxx.war
│ └─── WEB-INF/lib/
│ ├─── group1-lib1-xxx.jar
│ ├─── group1-lib2-xxx.jar
│ ├─── group2-lib1-xxx.jar
│ ├─── group2-lib2-xxx.jar
│ └─── group2-lib3-xxx.jar
│
└─── eartest-rar-xxx.rar
├─── group2-lib1-xxx.jar
├─── group2-lib2-xxx.jar
└─── group2-lib3-xxx.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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-730289313
@hboutemy,
The ["Maven EAR Plugin 3.2.0 with skinnyModules option"](https://lists.apache.org/thread.html/rbcf8c12948893ff80483e2456fb6bdd78a20c94720746a94ad474741%40%3Cusers.maven.apache.org%3E) topic I started in the users@maven.apache.org mailing list has no answers for a week. It looks like we won't get any feedback except [the one](/apache/maven-ear-plugin/pull/24#pullrequestreview-530790385) which we got here from @rfscholte. Maybe it's time to complete with this pull request and with pull request #22 (these 2 pull request will produce merge conflicts which I resolved in [merge/MEAR-153_into_MEAR-216](/mabrarov/maven-ear-plugin/tree/merge/MEAR-153_into_MEAR-216) branch) and then release Maven EAR Plugin 3.2.0. Thank you for your help.
@rfscholte,
If you agree with [my proposal](/apache/maven-ear-plugin/pull/24#issuecomment-727590153) **and** with my suggestion to implement the proposal in a dedicated (new) feature request (pull request), then please confirm that here (approval of this pull request is appreciated too). Please note that this pull request doesn't prevent implementation of that proposal in a backward compatible way - this is the thing which I care about, because I'd prefer to not implement `skinnyModules` feature at all if it will make impossible giving later the maximum control you suggested. Thank you for sharing this idea. I'll open Jira ticket for `sharedLibs` property of EAR module. Maybe I'll be able to work on it this year.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739535717
I fixed [that issue](https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-739500692) with not empty diff by merging the master branch into the source branch of this pull request. Now this pull request has empty diff.
@hboutemy, it looks like you merged source branch of this pull request into the master branch in 954b7363f7d522c0477207ca16b13b64272650fd, so I request you to take decision on this pull request - whether to merge it for correct history, or decline it (because all changes were merged somehow without this PR).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-725337460
Hi @hboutemy,
> the new feature is triggered by a specific parameter: then can't break existing users configuration?
Yes. That's one of my intentions - changes should not impact existing projects and the new behavior should work only for users who want / need and explicitly requested it through configuration.
> shouldn't we update the version to 3.2.0?
I believe version needs to be changed (3.2.0 looks like a good candidate), but I don't know how it is performed in this project. I thought version change is performed by maintainers when decision on new release is made.
> I'm not a EAR user either
I am still an EAR user due to my company legacy tasks which will keep using EARs for at least next 10 years :( Just curious who else can help. dev@maven.apache.org keeps silent. Maybe I need to try users@maven.apache.org ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-ear-plugin] mabrarov edited a comment on pull request #24: [MEAR-153] skinnyModules option
Posted by GitBox <gi...@apache.org>.
mabrarov edited a comment on pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727581338
> But that's only an instruction for Maven to download, it is not an instruction for the maven-ear-plugin what not to include.
I agree, but it's the way Maven EAR Plugin is implemented at the moment. Library is not considered "shared" until it is found among dependencies of EAR. It looks like implementer of skinnyWars option cut corners.
Note that we have MEAR-166 which implementation can be connected with (impacted by) your suggestion.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org