[ 
https://issues.apache.org/jira/browse/FELIX-2921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021197#comment-13021197
 ] 

Stephane Chomat commented on FELIX-2921:
----------------------------------------

Ok I understand. It's not bug.
I run my test under eclipse. The resource is not filtered by resource plugin 
and is filtered by maven bundle plugin.

1. You can use resource plugin instead and replace ${dollar} by $ in 
default.properties.

2. In pom.xml, you can change like : 

replace {src/main/resources/} by {maven-resources}

and this line 

        <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>org/apache/felix/framework/Felix.properties</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
        <excludes>
          <exclude>org/apache/felix/framework/Felix.properties</exclude>
        </excludes>
      </resource>
    </resources>

If you want filter the file default.properties, you can change the delimiter 
(see http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html)

My Patch


--- a/framework/pom.xml
+++ b/framework/pom.xml
@@ -30,10 +30,23 @@
   <version>3.2.0</version>
   <dependencies>
   </dependencies>
-  <properties>
-    <dollar>$</dollar>
-  </properties>
   <build>
+       <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+        <includes>
+          <include>org/apache/felix/framework/Felix.properties</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>false</filtering>
+        <excludes>
+          <exclude>org/apache/felix/framework/Felix.properties</exclude>
+        </excludes>
+      </resource>
+    </resources>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -43,7 +56,6 @@
           <source>1.5</source>
         </configuration>
       </plugin>
-
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
@@ -58,7 +70,7 @@
             
<Export-Package>org.osgi.framework;-split-package:=merge-first,org.osgi.framework.launch,org.osgi.framework.hooks.service,org.osgi.service.
             <Private-Package>org.apache.felix.framework.*</Private-Package>
             <Import-Package>!*</Import-Package>
-            
<Include-Resource>META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES,{src/main/resources/}</Include-Resourc
+            
<Include-Resource>META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES,{maven-resources}</Include-Resource>
 
           </instructions>
         </configuration>
       </plugin>
diff --git a/framework/src/main/resources/default.properties 
b/framework/src/main/resources/default.properties
index c210a03..a89b3fa 100644
--- a/framework/src/main/resources/default.properties
+++ b/framework/src/main/resources/default.properties
@@ -19,7 +19,7 @@
 # Framework config properties.
 #
 org.osgi.framework.executionenvironment= \
- ${dollar}{ee-${dollar}{java.specification.version}}
+ ${ee-${java.specification.version}}
 
 ee-1.7=JavaSE-1.6,JavaSE-1.7,J2SE-1.5,J2SE-1.4,J2SE-1.3, \
  OSGi/Minimum-1.2,OSGi/Minimum-1.1,OSGi/Minimum-1.0
@@ -35,7 +35,7 @@ org.osgi.framework.system.packages=org.osgi.framework; 
version=1.5.0, \
  org.osgi.service.startlevel; version=1.1.0, \
  org.osgi.service.url; version=1.0.0, \
  org.osgi.util.tracker; version=1.4.0 \
- ${dollar}{jre-${dollar}{java.specification.version}}
+ ${jre-${java.specification.version}}
 
 #
 # Java platform package export properties.


> Util.getDefaultProperty return bad values
> -----------------------------------------
>
>                 Key: FELIX-2921
>                 URL: https://issues.apache.org/jira/browse/FELIX-2921
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.0
>         Environment: apple
>            Reporter: Stephane Chomat
>             Fix For: framework-4.0.0
>
>         Attachments: BadPropertiesTest.java
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The properties like FRAMEWORK_SYSTEMPACKAGES are bad substituted by the 
> method Util.getDefaultProperty.
> The properties dollar is missing and the value is '' returned by 
> System.getProperty.
> The bad default value for FRAMEWORK_SYSTEMPACKAGES  is 
> org.osgi.framework; version=1.5.0, org.osgi.framework.launch; version=1.0.0, 
> org.osgi.framework.hooks.service; version=1.0.0, 
> org.osgi.service.packageadmin; version=1.2.0, org.osgi.service.startlevel; 
> version=1.1.0, org.osgi.service.url; version=1.0.0, org.osgi.util.tracker; 
> version=1.4.0 {jre-{java.specification.version}}
> You can add this test :
>     public void testDefaultProperty() {
>        Logger logger = new Logger();
>        
>        String jsv = System.getProperty("java.specification.version");
>        String jre = Util.getDefaultProperty(logger, "jre-"+jsv);
>         
>        String actual = Util.getDefaultProperty(logger, 
> Constants.FRAMEWORK_SYSTEMPACKAGES);
>        
>        assertEquals("org.osgi.framework; version=1.5.0, 
> org.osgi.framework.launch; version=1.0.0, org.osgi.framework.hooks.service; 
> version=1.0.0, org.osgi.service.packageadmin; version=1.2.0, 
> org.osgi.service.startlevel; version=1.1.0, org.osgi.service.url; 
> version=1.0.0, org.osgi.util.tracker; version=1.4.0 "+jre, actual);
>     }
> If you add this line before test, the test works
>      System.setProperty("dollar","$");

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to