-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-8395] Add a <Source> element in the model. #1936
base: master
Are you sure you want to change the base?
Conversation
- directory (inherited from FileSet) - includes (inherited from PatternSet) - excludes (inherited from PatternSet) - scope - lang - module - targetVersion - targetPath (taken from <Resource>) - filtering (taken from <Resource>) - enabled This commit also renames `source` parameter value in `reader-stax.vm` for avoiding name collision with the new `Source` model element. apache#1936
520d873
to
4f2aae0
Compare
<p>If a module name is specified for resources or script files, | ||
then this value modifies the directory where the files will be copied. | ||
For example, if a Java module name is "foo.biz", then the {@code foo/bar.properties} | ||
resource file will be copied as {@code foo.biz/foo/bar.properties}.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a Maven convention, a Java convention, or something imposed by the JVM ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a Java compiler convention. In a multi-modules project, javac
automatically inserts module names at the root of class directories. For example, if a module named my.foo.module
contains a foo.bar.biz.Bla
class, then in single-module project (as today), javac
generates the following file in the Maven target/classes/
directory:
foo/bar/biz/Bla.class
But in a multi-modules project (would be optional and not the default), javac
generates the same file at the following location instead:
my.foo.module/foo/bar/biz/Bla.class
Other Java tools such as java
understand this directory hierarchy. I.e. the --module-path
can be a directory of modules, with no need to enumerate on the path each module found in the directory. I'm not sure if it is a requirement that the directory names match module names, but this is what javac
does at least by default.
Above documentation of module
element tries to match what javac
does. It could be rephrased as "During Java compilation, we let javac
do whatever it wants. For resources, we try to copy them in the same directory as javac
". The current wording tries to be more specific about what happens, but the goal is to match javac
and the documentation would be updated if we find mismatches.
<version>4.1.0+</version> | ||
<description> | ||
<![CDATA[ | ||
Whether the directory described by this source element should be included in the build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to reuse the new condition syntax here ?
https://maven.apache.org/ref/4-LATEST/apidocs/org/apache/maven/api/model/Activation.html#condition-syntax-heading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so. I wasn't aware of that. How should we express that?
I like it a lot, this would solve a number of problems. |
Rename `filtering` as `stringFiltering` for avoiding confusion with file filtering.
JIRA issue: MNG-8395
Add a
<Source>
element in the model. Properties are:directory
(inherited fromFileSet
)includes
(inherited fromPatternSet
)excludes
(inherited fromPatternSet
)scope
lang
module
targetVersion
targetPath
(taken from<Resource>
)filtering
(taken from<Resource>
)enabled
This commit also renames
source
parameter value inreader-stax.vm
for avoiding name collision with the newSource
model element.