How to disable certain enforcer rules in a child module in a multi-module maven project?

2020-08-13 Thread Falko Modler
You could split your config into multiple executions and define a custom skip 
property for each execution.
In a submodule you could then skip the executions you don't want (or vice 
versa) by adding the respective properties.
Skipping all enforcer rules (e.g. for a "quick" local run) is more complicated, 
but could be achieved if everything ia put in a profile that is activated by 
default. You could then opt-out of it via -P!my-profile or introduce yet 
another property for that.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Resource plugin - LifecycleExecutionException - Input length = 1

2020-08-13 Thread Karl Heinz Marbaise

Hi,

On 12.08.20 21:44, Tobias wrote:

Hi,

a new version of the maven-resources-plugin (3.2.0) has been released
recently.

Trying to take advantage of this I added


org.apache.maven.plugins
maven-resources-plugin
3.2.0


org.apache.maven.shared
maven-filtering
3.2.0


org.apache.maven.shared
maven-shared-utils
3.3.3


to the pom.xml file (the version of maven-resources-plugin had not been
specified before).


This is the most important thing you should always define the versions
of all your plugins.

I don't understand why you have defined maven-shared-utils, and
maven-filtering as plugins? Cause they are no plugins. And not needed by
usual project...

Apart from I recommend to make a directory where the filtered resources
can be put into. I use the usual resources directory. A separate
directory which contains the files which should not being filtered like
`non-filtered-resources` that makes the configuration easier and makes
very clear for users what is being done.

Kind regards
Karl Heinz Marbaise


When running maven I see in the output that now version 3.2.0 of the
resource plugin is used (before it was 2.x). However, it now results in
the following error :

Failed to execute goal 
org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources 
(default-testResources) on project XXX: Input length = 1

See [2] below for a more detailed stack trace.

Do you know what goes wrong and how this can be fixed?

[Help1] says that "The concrete meaning of the exception depends on the
plugin so please have a look at its documentation."

I took at look at [1] but didn't find "Input length = 1" mentioned
somewhere - could you maybe point me to the right direction?

Unfortunately, I can't share the the full pom. I hope this information
is sufficient.

Best regards
Tobias

[1] https://maven.apache.org/plugins/maven-resources-plugin/index.html

[2]

11:46:07,007 [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources 
(default-testResources) on project XXX: Input length = 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources 
(default-testResources) on project XXX: Input length = 1
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:218)
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:159)
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:151)
 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:115)
 at 
org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.lambda$createBuildCallable$0
 (MultiThreadedBuilder.java:191)
 at java.util.concurrent.FutureTask.run (FutureTask.java:266)
 at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
 at java.util.concurrent.FutureTask.run (FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker 
(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run 
(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run (Thread.java:748)
Caused by: org.apache.maven.plugin.MojoExecutionException: Input length = 1
 at org.apache.maven.plugins.resources.ResourcesMojo.execute 
(ResourcesMojo.java:362)
 at org.apache.maven.plugins.resources.TestResourcesMojo.execute 
(TestResourcesMojo.java:75)
 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
(DefaultBuildPluginManager.java:136)
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:213)
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:159)
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:151)
 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:115)
 at 
org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.lambda$createBuildCallable$0
 (MultiThreadedBuilder.java:191)
 at java.util.concurrent.FutureTask.run (FutureTask.java:266)
 at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
 at java.util.concurrent.FutureTask.run (FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker 
(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run 
(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run (Thread.java:748)
Caused by: org.apache.maven.shared.filtering.MavenFilteringException: Input 
length = 1
 at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile 
(DefaultMavenFileFilter.java:113)
 at 

How to disable certain enforcer rules in a child module in a multi-module maven project?

2020-08-13 Thread Debraj Manna
I am using a maven-enforcer plugin in a multi-module maven project. Let's
say my project structure is like below

main
  - query
  - storage

My enforcer plugin in main pom looks like below



org.apache.maven.plugins
maven-enforcer-plugin
3.0.0-M2


default

enforce





[1.8,)
*** This project requires
JDK 1.8/J2SE 8 or later. ***


true





In a child module (query) if I need to disable one of the enforcer rules
(let's say DependencyConvergence) can someone let me know how can this be
done?

Maven Version - 3.6.1


Re: Resource plugin - LifecycleExecutionException - Input length = 1

2020-08-13 Thread Mark Prins
Op wo 12 aug. 2020 om 21:47 schreef Tobias :

>
>
> Failed to execute goal
> org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources
> (default-testResources) on project XXX: Input length = 1
>
> See [2] below for a more detailed stack trace.
>
> Do you know what goes wrong and how this can be fixed?
>
>
I ran into this as well, after updating the list of "
nonFilteredFileExtensions" this seems to be fixed, see eg.
https://github.com/B3Partners/brmo/pull/901/files

run "mvn -X process-test-resources" to get the list of filtered files


-- 
Disclaimer;
This message is just a reflection of what I thought at the time of sending.
The message may contain information that is not intended for you or that
you don't understand.