Skip to content
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

npx goal causes "Plugin execution not covered by lifecycle configuration" warning in VS Code #1150

Closed
heathharrelson opened this issue Jun 5, 2024 · 0 comments · Fixed by #1151

Comments

@heathharrelson
Copy link
Contributor

Do you want to request a feature or report a bug?

Report a bug

What is the current behavior?

VS Code warns that "Plugin execution not covered by lifecycle configuration" when there is an npx execution in pom.xml.

Screenshot 2024-06-05 at 11 34 30 AM

Full error:

Plugin execution not covered by lifecycle configuration: com.github.eirslett:frontend-maven-plugin:1.15.0:npx (execution: sass, phase: generate-resources)Java(0)

There are no errors or warning when I compile on the command line. This is similar to the behavior in #531, and I was able to fix the issue locally by adding npx to lifecycle-mapping-metadata.xml. I can submit a PR if that's desirable.

If the current behavior is a bug, please provide the steps to reproduce.

Add an <execution> that uses the npx goal to pom.xml. In my case, the <build> section of pom.xml looks like this:

	<build>
		<!-- Build without version number; only affects JAR file in /target. -->
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<version>1.15.0</version>
				<executions>
					<execution>
						<id>install-node-and-npm</id>
						<goals>
							<goal>install-node-and-npm</goal>
						</goals>
					</execution>
					<execution>
						<id>npm-install</id>
						<goals>
							<goal>npm</goal>
						</goals>
					</execution>
					<execution>
						<id>webpack</id>
						<goals>
							<goal>webpack</goal>
						</goals>
						<configuration>
							<arguments>${webpack.args}</arguments>
						</configuration>
					</execution>
					<execution>
						<id>sass</id>
						<goals>
							<goal>npx</goal>
						</goals>
						<configuration>
							<arguments>sass --load-path ${project.basedir}/node_modules ${project.basedir}/src/main/resources/frontend/scss/app.scss ${project.build.directory}/classes/static/assets/css/app.css</arguments>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<nodeVersion>${node.version}</nodeVersion>
					<installDirectory>target</installDirectory>
				</configuration>
			</plugin>
		</plugins>
	</build>

The cowsay example works just as well.

	<build>
		<!-- Build without version number; only affects JAR file in /target. -->
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<version>1.15.0</version>
				<executions>
					<execution>
						<id>install-node-and-npm</id>
						<goals>
							<goal>install-node-and-npm</goal>
						</goals>
					</execution>
					<execution>
						<id>npm-install</id>
						<goals>
							<goal>npm</goal>
						</goals>
					</execution>
					<execution>
						<id>webpack</id>
						<goals>
							<goal>webpack</goal>
						</goals>
						<configuration>
							<arguments>${webpack.args}</arguments>
						</configuration>
					</execution>
					<execution>
						<id>npx cowsay</id>
						<goals>
							<goal>npx</goal>
						</goals>
						<configuration>
							<arguments>-y [email protected] hello</arguments>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<nodeVersion>${node.version}</nodeVersion>
					<installDirectory>target</installDirectory>
				</configuration>
			</plugin>
		</plugins>
	</build>

What is the expected behavior?

An npx execution in pom.xml does not trigger a warning in VS Code.

Please mention your frontend-maven-plugin and operating system version.

plugin version: 1.15.0
operating system: macOS Ventura 13.6.3
VS Code: 1.89.1

heathharrelson added a commit to heathharrelson/frontend-maven-plugin that referenced this issue Jun 5, 2024
Add npx to lifecycle-mapping-metadata.xml. Fixes eirslett#1150.
heathharrelson added a commit to heathharrelson/frontend-maven-plugin that referenced this issue Jun 5, 2024
Add npx to lifecycle-mapping-metadata.xml. Fixes eirslett#1150.
eirslett pushed a commit that referenced this issue Jun 6, 2024
Add npx to lifecycle-mapping-metadata.xml. Fixes #1150.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant