diff --git a/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionModule.java b/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionModule.java deleted file mode 100644 index 65ba1817e1..0000000000 --- a/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionModule.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.apache.maven.execution.scope.internal; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import javax.inject.Named; - -import org.apache.maven.execution.scope.MojoExecutionScoped; - -import com.google.inject.Binder; -import com.google.inject.Module; -import com.google.inject.name.Names; - -@Named -public class MojoExecutionModule - implements Module -{ - - public void configure( Binder binder ) - { - final MojoExecutionScope executionScope = new MojoExecutionScope(); - - // tell Guice about the scope - binder.bindScope( MojoExecutionScoped.class, executionScope ); - - // make our scope instance injectable - binder.bind( MojoExecutionScope.class ).annotatedWith( Names.named( MojoExecutionScope.SCOPE_NAME ) ).toInstance( executionScope ); - } -} diff --git a/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java b/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java index 3d021fdd80..ce169e140f 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java +++ b/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java @@ -22,6 +22,9 @@ package org.apache.maven.execution.scope.internal; import java.util.LinkedList; import java.util.Map; +import javax.inject.Named; +import javax.inject.Singleton; + import org.apache.maven.execution.MavenSession; import org.apache.maven.execution.scope.MojoExecutionListener; import org.apache.maven.execution.scope.MojoExecutionScoped; @@ -40,11 +43,11 @@ import com.google.inject.Provider; import com.google.inject.Scope; import com.google.inject.util.Providers; +@Named +@Singleton public class MojoExecutionScope implements Scope { - public static final String SCOPE_NAME = "mojoExecution"; - private static final Provider SEEDED_KEY_PROVIDER = new Provider() { public Object get() diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java index 6fe5daa85d..949a228cb8 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java @@ -49,7 +49,7 @@ public class DefaultBuildPluginManager @Requirement private LegacySupport legacySupport; - @Requirement( hint = MojoExecutionScope.SCOPE_NAME ) + @Requirement private MojoExecutionScope scope; /**