Search
Calendar
April 2024
S M T W T F S
« Sep    
 123456
78910111213
14151617181920
21222324252627
282930  
Your widget title
Archives

PostHeaderIcon Maven 3: ‘build.plugins.plugin[…].dependencies.dependency.scope’ for … must be one of [compile, runtime, system] but is ‘test’

Case

I am migrating a project from Maven 2 to Maven 3. Fortunately, Maven 3 is said to be mostly back-compatible with Maven 2.
Anyway, on first build, I got this message:

[INFO] Scanning for projects...
[ERROR] The build could not read 3 projects -> [Help 1]
[ERROR]
[ERROR]   The project lalou.jonathan.rmi-server:1.10.0-SNAPSHOT (C:\workarea\...\pom.xml) has 2 errors
[ERROR]     'build.plugins.plugin[org.codehaus.mojo:weblogic-maven-plugin].dependencies.dependency.scope' for org.slf4j:slf4j-log4j12:jar must be one of [compile, runtime, system]
but is 'test'. lalou.jonathan:rmi-server:${project.parent.version}, C:\workarea\...\pom.xml, line 103,
column 32

Quick fix

Introduce a tag pluginManagement between build and plugins, ie replace:

	<build>
(...)
		<plugins>
(...)

with:

	<build>
(...)
		<pluginManagement>
			<plugins>
(...)

One Response to “Maven 3: ‘build.plugins.plugin[…].dependencies.dependency.scope’ for … must be one of [compile, runtime, system] but is ‘test’”

  • Java user says:

    Hi,
    Tried using your step for the similar issue which I get when I try to migrate from m2 to m3 .
    build.plugins.plugin[org.codehaus.mojo:weblogic-maven-plugin].depen
    dencies.dependency.scope’ for weblogic:weblogic:jar must be one of [compile, run
    time, system] but is ‘provided’. @ line 36, column 20
    it was never successful . please let me if there is another way that we can fix similar issues

Leave a Reply