question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

configuration inside execution not working

See original GitHub issue

For some weird reason, I am encountering the same problem as mentioned below using 0.0.28, 1.3 and 1.4 versions of this plugin (possibly all versions, not checked)

When I declare execution level configuration it is ignored.

<execution>
	<id>Install node and npm</id>
	<goals>
		<goal>install-node-and-npm</goal>
	</goals>
	<configuration>
		<nodeVersion>v7.4.0</nodeVersion>
		<npmVersion>4.0.5</npmVersion>
		<installDirectory>target</installDirectory>
		<workingDirectory>./</workingDirectory>
	</configuration>
</execution>

The above block will not work.

When I give the configuration in a global configuration block under plugin it works fine.

<plugin>
			        <groupId>com.github.eirslett</groupId>
			        <artifactId>frontend-maven-plugin</artifactId>
			        <!-- Use the latest released version:
			        https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
			        <version>1.4</version>
			        <configuration>
		    			<nodeVersion>v7.4.0</nodeVersion>
		    			<npmVersion>4.0.5</npmVersion>
		    			<installDirectory>target</installDirectory>
		    			<workingDirectory>./</workingDirectory>
		    			<arguments>-p --config config/webpack.config.prod.js</arguments>
            		</configuration>
                        ...
</plugin>

The above works just fine.

The problem arises when I want to use two npm executions, or an npm execution along with webpack or something else. They do not pick arguments configuration from their own execution block. But work when an arguments config block is given globally. Problem is that all of the goals pick up the last arguments config block from global configuration.

Following is my environment information- Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T22:11:47+05:30) Maven home: /usr/local/Cellar/maven/3.3.9/libexec Java version: 1.8.0_121, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: “mac os x”, version: “10.12.3”, arch: “x86_64”, family: “mac”

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tonicsoftcommented, Feb 23, 2018

A colleague of mine fixed it for me: if you run “mvn plugin-name:goal-name”, it doesn’t actually run your executions at all, it just runs whatever the default goals are for the plugin. In the example above where the execution is bound to the generate-sources phase, if you run “mvn generate-sources” then the executions should run with their respective configurations. Hope this helps.

0reactions
arunkjncommented, Feb 23, 2018

weirdly enough, a coworker setup the exact same config with same maven version in their system and it worked!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does maven execution configuration don't work for the ...
I have problems to understand how failsave execution configuration ... I can't understand why this execution configuration doesn't work.
Read more >
Guide to Configuring Plug-ins - Apache Maven
In Maven, there are two kinds of plugins, build and reporting: Build plugins are executed during the build and configured in the <build/>...
Read more >
IntelliJ IDEA - Troubleshooting common Maven issues
In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Build, Execution, Deployment | Compiler | Java Compiler. · On the page that opens,...
Read more >
Plugin execution not covered by lifecycle configuration
but eclipse shows error Plugin execution not covered by lifecycle configuration: : org.javalite:activejdbc-instrumentation:1.4.3:instrument (execution: default,.
Read more >
Plugin Management in Maven - Baeldung
This can lead to problems of complex POM files with redundant or duplicate plugin artifacts as well as configurations scattered across ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found