diff --git a/jline.spec b/jline.spec
index 66047c5..47115c3 100644
--- a/jline.spec
+++ b/jline.spec
@@ -1,6 +1,6 @@
Name: jline
Version: 2.13
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: JLine is a Java library for handling console input
License: BSD and ASL 2.0
URL: https://github.com/jline/jline2
@@ -55,8 +55,9 @@ This package contains the API documentation for %{name}.
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions/pom:Import-Package"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions" "javax.swing;resolution:=optional,org.fusesource.jansi,!org.fusesource.jansi.internal"
-# Let maven bundle plugin figure out the exports.
-%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions/pom:Export-Package"
+# Be sure to export jline.internal, but not org.fusesource.jansi.
+# See https://bugzilla.redhat.com/show_bug.cgi?id=1317551
+%pom_xpath_set "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions/pom:Export-Package" "jline.*;-noimport:=true"
# For some reason these directories do not exist, failing compilation due to -Werror
mkdir -p target/generated-sources/annotations
@@ -75,6 +76,9 @@ mkdir -p target/generated-test-sources/test-annotations
%files javadoc -f .mfiles-javadoc
%changelog
+* Mon Mar 14 2016 Severin Gehwolf - 2.13-3
+- OSGi export jline.internal. Resolves RHBZ#1317551.
+
* Thu Feb 04 2016 Fedora Release Engineering - 2.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild