Permalink
Browse files

Merge pull request #19 from sonatype/get-rid-of-sisu-velocity

Get rid of SISU Velocity.
  • Loading branch information...
2 parents be7cff0 + 8a68bc0 commit 5d089fb92e274f875bc1d3965f27e6347deec649 @cstamas cstamas committed Nov 12, 2013
View
@@ -39,9 +39,9 @@
</dependency>
<dependency>
- <groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-velocity</artifactId>
- <version>1.2</version>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>1.7</version>
<optional>true</optional>
</dependency>
@@ -21,12 +21,12 @@
import javax.inject.Inject;
import javax.inject.Named;
+import javax.inject.Provider;
import org.sonatype.sisu.goodies.common.ComponentSupport;
import org.sonatype.sisu.goodies.common.io.Closer;
import org.sonatype.sisu.goodies.template.TemplateEngine;
import org.sonatype.sisu.goodies.template.TemplateParameters;
-import org.sonatype.sisu.velocity.Velocity;
import com.google.common.base.Throwables;
import com.google.common.collect.Maps;
@@ -48,11 +48,11 @@
implements TemplateEngine
{
- private final Velocity velocity;
+ private final Provider<VelocityEngine> velocityEngineProvider;
@Inject
- public VelocityTemplateEngine(final Velocity velocity) {
- this.velocity = checkNotNull(velocity);
+ public VelocityTemplateEngine(final Provider<VelocityEngine> velocityEngineProvider) {
+ this.velocityEngineProvider = checkNotNull(velocityEngineProvider);
}
public String render(final Object owner, final @NonNls URL template, @Nullable Map<String, Object> params) {
@@ -69,7 +69,7 @@ public String render(final Object owner, final @NonNls URL template, @Nullable M
try {
input = new InputStreamReader(template.openStream());
- VelocityEngine engine = velocity.getEngine();
+ VelocityEngine engine = velocityEngineProvider.get();
params.put("owner", owner); //NON-NLS
StringWriter buff = new StringWriter();

0 comments on commit 5d089fb

Please sign in to comment.