Skip to content

Commit de6ff24

Browse files
Use internal Nullable annotation, allow drop sisu-inject from runtime dependencies
org.eclipse.sisu.inject is not exported by Maven Core ... so plugins must add it to own dependency only for this one annotation Own implementation avoid such situation
1 parent 5b7e4c4 commit de6ff24

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ limitations under the License.
7373
<version>1</version>
7474
<scope>provided</scope>
7575
</dependency>
76+
7677
<dependency>
7778
<groupId>org.eclipse.sisu</groupId>
7879
<artifactId>org.eclipse.sisu.inject</artifactId>
7980
<version>0.9.0.M4</version>
80-
<scope>provided</scope>
81+
<scope>test</scope>
8182
</dependency>
8283

8384
<dependency>

src/main/java/org/codehaus/plexus/velocity/internal/DefaultVelocityComponent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.velocity.app.VelocityEngine;
2626
import org.codehaus.plexus.velocity.VelocityComponent;
2727
import org.codehaus.plexus.velocity.VelocityComponentConfigurator;
28-
import org.eclipse.sisu.Nullable;
2928

3029
/**
3130
* Default component implementation. The presence of {@link VelocityComponentConfigurator} is optional.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.codehaus.plexus.velocity.internal;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
/**
10+
* Internal <code>Nullable</code> annotation to mark parameters that can be null.
11+
* <p>
12+
* Guice allow any Nullable annotation, so this one can be used instead of adding a dependency to sisu-inject.
13+
* <a href="https://github.com/google/guice/wiki/UseNullable">UseNullable</a>
14+
*/
15+
@Target({ElementType.PARAMETER})
16+
@Retention(RetentionPolicy.RUNTIME)
17+
@Documented
18+
@interface Nullable {}

0 commit comments

Comments
 (0)