felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Tripodi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4512) Add a new Mojo to invoke the BND Baseline tool
Date Sun, 11 May 2014 14:46:15 GMT

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

Simone Tripodi commented on FELIX-4512:
---------------------------------------

The proposal contained in {{FELIX-4512.patch}} provides an implementation of {{org.apache.felix:maven-bundle-plugin:2.4.1-SNAPSHOT:baseline}}
MOJO that has the following configuration parameters:

||Name||Type||Since||Description||
|failOnError|boolean|2.4.1|Whether to fail on errors. Default value is: true. User property
is: failOnError.|
|failOnWarning|boolean|2.4.1|Whether to fail on warnings. Default value is: false. User property
is: failOnWarning.|
|filters|String[]|2.4.1|A list of packages filter, if empty the whole bundle will be traversed.
Values are specified in OSGi package instructions notation, e.g. {{!org.apache.felix.bundleplugin.}}|
|logResults|boolean|2.4.1|Whether to log the results to the console or not, true by default.
Default value is: true. User property is: logResults.|
|skip|boolean|2.4.1|Flag to easily skip execution.Default value is: false.User property is:
baseline.skip.|
|textOutputFile|File|2.4.1|A text output file to render to ${project.build.directory}/baseline.txt.|
|xmlOutputFile|File|2.4.1|An XML output file to render to ${project.build.directory}/baseline.xml.|

It is invoked during {{validate}} phase in order to make sure the current bundle is produced
and contains valid OSGi metadata.

Plugging it in existing projects is quiet easy, i.e.:

{code}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.http.parent</artifactId>
        <version>3-SNAPSHOT</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>

    <name>Apache Felix Http Api</name>
    <artifactId>org.apache.felix.http.api</artifactId>
    <version>2.3.0-SNAPSHOT</version>
  
    ...

     <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.4.1-SNAPSHOT</version>
                <executions>
                    <execution>
                        <id>bundle</id>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                        <configuration>
                          <instructions>
                              <Export-Package>
                                  org.osgi.dto;version=${osgi.dto.version},
                                  org.osgi.service.http;version=${http.service.version},
                                  org.osgi.service.http.runtime;version=${http.service.version},
                                  org.apache.felix.http.api;version=${http.api.version}
                              </Export-Package>
                              <Import-Package>
                                  org.osgi.dto,
                                  org.osgi.service.http,
                                  org.osgi.service.http.runtime,
                                  javax.servlet.*;version="[2.3,4)",
                                  *
                              </Import-Package>
                          </instructions>
                      </configuration>
                    </execution>
                    <execution>
                        <id>baseline</id>
                        <goals>
                            <goal>baseline</goal>
                        </goals>
                        <configuration>
                            <comparisonVersion>2.2.2</comparisonVersion>
                            <failOnWarning>true</failOnWarning>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            ...
    </build>
    ...
</project>
{code}

it produces two output files by default, a txt one:

{noformat}
# Baseline Report - Generated by Apache Felix Maven Bundle Plugin at Sun May 11 16:06:20 CEST
2014
Analising current bundle org.apache.felix.http.api-2.3.0-SNAPSHOT against previous released
org.apache.felix.http.api-2.2.2
attrs for org.apache.felix.http.api version="2.0.4";uses:="javax.servlet,org.osgi.service.http,org.osgi.service.http.runtime"
attrs for org.osgi.dto version="1.0.0"
attrs for org.osgi.service.http version="1.3.0";uses:="javax.servlet,javax.servlet.http"
attrs for org.osgi.service.http.runtime version="1.3.0"
  PACKAGE_NAME                                       DELTA      CUR_VER    BASE_VER   REC_VER
   WARNINGS  
= ================================================== ========== ========== ========== ==========
==========
* org.apache.felix.http.api                          MAJOR      2.0.4      2.0.4      3.0.0
     Version increase required
	>   interface  org.apache.felix.http.api.ExtHttpService
		+   method     createDefaultHttpContext()
			+   access     abstract
			+   return     org.osgi.service.http.HttpContext
		+   method     doSomething()
			+   access     abstract
		+   method     registerResources(java.lang.String,java.lang.String,org.osgi.service.http.HttpContext)
			+   access     abstract
		+   method     registerServlet(java.lang.String,javax.servlet.Servlet,java.util.Dictionary,org.osgi.service.http.HttpContext)
			+   access     abstract
		+   method     unregister(java.lang.String)
			+   access     abstract
	+   interface  org.apache.felix.http.api.ExtHttpServiceRuntime
		+   access     abstract
		+   implements org.osgi.service.http.runtime.HttpServiceRuntime
		+   method     getRuntimeDTO()
			+   access     abstract
			+   return     org.osgi.dto.DTO
			+   return     org.osgi.service.http.runtime.dto.RuntimeDTO
		+   method     registerFilter(org.osgi.service.http.runtime.dto.FilterDTO)
			+   access     abstract
		+   method     registerServlet(org.osgi.service.http.runtime.dto.ServletDTO)
			+   access     abstract
-----------------------------------------------------------------------------------------------------------
  org.osgi.dto                                       ADDED      1.0.0      0.0.0      1.0.0
     -         
	+   class      org.osgi.dto.DTO
		+   access     abstract
		+   method     <init>()
		+   method     clone()
			+   access     protected
		+   method     equals(java.lang.Object)
			+   return     boolean
		+   method     finalize()
			+   access     protected
		+   method     hashCode()
			+   return     int
		+   method     toString()
			+   return     java.io.Serializable
			+   return     java.lang.CharSequence
			+   return     java.lang.Comparable
			+   return     java.lang.String
	+   version    1.0.0
-----------------------------------------------------------------------------------------------------------
  org.osgi.service.http                              ADDED      1.3.0      0.0.0      1.0.0
     Excessive version increase
	+   class      org.osgi.service.http.NamespaceException
		+   extends    java.lang.Exception
		+   extends    java.lang.Throwable
		+   implements java.io.Serializable
		+   method     <init>(java.lang.String)
		+   method     <init>(java.lang.String,java.lang.Throwable)
		+   method     clone()
			+   access     protected
		+   method     equals(java.lang.Object)
			+   return     boolean
		+   method     fillInStackTrace()
			+   return     java.io.Serializable
			+   return     java.lang.Throwable
		+   method     finalize()
			+   access     protected
		+   method     getCause()
			+   return     java.io.Serializable
			+   return     java.lang.Throwable
		+   method     getException()
			+   return     java.io.Serializable
			+   return     java.lang.Throwable
		+   method     getLocalizedMessage()
			+   return     java.io.Serializable
			+   return     java.lang.CharSequence
			+   return     java.lang.Comparable
			+   return     java.lang.String
		+   method     getMessage()
			+   return     java.io.Serializable
			+   return     java.lang.CharSequence
			+   return     java.lang.Comparable
			+   return     java.lang.String
		+   method     getStackTrace()
			+   return     java.io.Serializable
			+   return     java.lang.StackTraceElement[]
		+   method     hashCode()
			+   return     int
		+   method     initCause(java.lang.Throwable)
			+   return     java.io.Serializable
			+   return     java.lang.Throwable
		+   method     printStackTrace()
		+   method     printStackTrace(java.io.PrintStream)
		+   method     printStackTrace(java.io.PrintWriter)
		+   method     setStackTrace(java.lang.StackTraceElement[])
		+   method     toString()
			+   return     java.io.Serializable
			+   return     java.lang.CharSequence
			+   return     java.lang.Comparable
			+   return     java.lang.String
	+   interface  org.osgi.service.http.HttpContext
		+   access     abstract
		+   field      java.lang.String AUTHENTICATION_TYPE
			+   access     final
			+   access     static
			+   constant   org.osgi.service.http.authentication.type
		+   field      java.lang.String AUTHORIZATION
			+   access     final
			+   access     static
			+   constant   org.osgi.service.useradmin.authorization
		+   field      java.lang.String REMOTE_USER
			+   access     final
			+   access     static
			+   constant   org.osgi.service.http.authentication.remote.user
		+   method     getMimeType(java.lang.String)
			+   access     abstract
			+   return     java.io.Serializable
			+   return     java.lang.CharSequence
			+   return     java.lang.Comparable
			+   return     java.lang.String
		+   method     getResource(java.lang.String)
			+   access     abstract
			+   return     java.io.Serializable
			+   return     java.net.URL
		+   method     handleSecurity(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
			+   access     abstract
			+   return     boolean
		+   annotated  org.osgi.annotation.versioning.ConsumerType
	+   interface  org.osgi.service.http.HttpService
		+   access     abstract
		+   method     createDefaultHttpContext()
			+   access     abstract
			+   return     org.osgi.service.http.HttpContext
		+   method     registerResources(java.lang.String,java.lang.String,org.osgi.service.http.HttpContext)
			+   access     abstract
		+   method     registerServlet(java.lang.String,javax.servlet.Servlet,java.util.Dictionary,org.osgi.service.http.HttpContext)
			+   access     abstract
		+   method     unregister(java.lang.String)
			+   access     abstract
		+   annotated  org.osgi.annotation.versioning.ProviderType
	+   version    1.3.0
-----------------------------------------------------------------------------------------------------------
  org.osgi.service.http.runtime                      ADDED      1.3.0      0.0.0      1.0.0
     Excessive version increase
	+   class      org.osgi.service.http.runtime.HttpServiceRuntimeConstants
		+   access     final
		+   field      java.lang.String HTTP_SERVICE_ENDPOINT_ATTRIBUTE
			+   access     final
			+   access     static
			+   constant   osgi.http.endpoint
		+   method     clone()
			+   access     protected
		+   method     equals(java.lang.Object)
			+   return     boolean
		+   method     finalize()
			+   access     protected
		+   method     hashCode()
			+   return     int
		+   method     toString()
			+   return     java.io.Serializable
			+   return     java.lang.CharSequence
			+   return     java.lang.Comparable
			+   return     java.lang.String
	+   interface  org.osgi.service.http.runtime.HttpServiceRuntime
		+   access     abstract
		+   method     getRuntimeDTO()
			+   access     abstract
			+   return     org.osgi.dto.DTO
			+   return     org.osgi.service.http.runtime.dto.RuntimeDTO
		+   annotated  org.osgi.annotation.versioning.ProviderType
	+   version    1.3.0
-----------------------------------------------------------------------------------------------------------
Baseline analisys complete, 0 errors, 0 warnings
{noformat}

and an XML one that can be used to generate the html report page:

{code}
<baseline generatedBy="Apache Felix Maven Bundle Plugin" generatedAt="Sun May 11 16:06:20
CEST 2014">
  <package>
    <name>org.apache.felix.http.api</name>
    <mismatch>*</mismatch>
    <packageDiff>MAJOR</packageDiff>
    <newerVersion>2.0.4</newerVersion>
    <olderVersion>2.0.4</olderVersion>
    <suggestedVersion>3.0.0</suggestedVersion>
    <warnings>Version increase required</warnings>
    <attributes>version=&quot;2.0.4&quot;;uses:=&quot;javax.servlet,org.osgi.service.http,org.osgi.service.http.runtime&quot;</attributes>
    <interface name="org.apache.felix.http.api.ExtHttpService" delta="major">
      <method name="createDefaultHttpContext()" delta="added">
        <access name="abstract" delta="added"/>
        <return name="org.osgi.service.http.HttpContext" delta="added"/>
      </method>
      <method name="doSomething()" delta="added">
        <access name="abstract" delta="added"/>
      </method>
      <method name="registerResources(java.lang.String,java.lang.String,org.osgi.service.http.HttpContext)"
delta="added">
        <access name="abstract" delta="added"/>
      </method>
      <method name="registerServlet(java.lang.String,javax.servlet.Servlet,java.util.Dictionary,org.osgi.service.http.HttpContext)"
delta="added">
        <access name="abstract" delta="added"/>
      </method>
      <method name="unregister(java.lang.String)" delta="added">
        <access name="abstract" delta="added"/>
      </method>
    </interface>
    <interface name="org.apache.felix.http.api.ExtHttpServiceRuntime" delta="added">
      <access name="abstract" delta="added"/>
      <implements name="org.osgi.service.http.runtime.HttpServiceRuntime" delta="added"/>
      <method name="getRuntimeDTO()" delta="added">
        <access name="abstract" delta="added"/>
        <return name="org.osgi.dto.DTO" delta="added"/>
        <return name="org.osgi.service.http.runtime.dto.RuntimeDTO" delta="added"/>
      </method>
      <method name="registerFilter(org.osgi.service.http.runtime.dto.FilterDTO)" delta="added">
        <access name="abstract" delta="added"/>
      </method>
      <method name="registerServlet(org.osgi.service.http.runtime.dto.ServletDTO)" delta="added">
        <access name="abstract" delta="added"/>
      </method>
    </interface>
  </package>
  <package>
    <name>org.osgi.dto</name>
    <mismatch> </mismatch>
    <packageDiff>ADDED</packageDiff>
    <newerVersion>1.0.0</newerVersion>
    <olderVersion>0.0.0</olderVersion>
    <suggestedVersion>1.0.0</suggestedVersion>
    <warnings>-</warnings>
    <attributes>version=&quot;1.0.0&quot;</attributes>
    <class name="org.osgi.dto.DTO" delta="added">
      <access name="abstract" delta="added"/>
      <method name="&lt;init&gt;()" delta="added"/>
      <method name="clone()" delta="added">
        <access name="protected" delta="added"/>
      </method>
      <method name="equals(java.lang.Object)" delta="added">
        <return name="boolean" delta="added"/>
      </method>
      <method name="finalize()" delta="added">
        <access name="protected" delta="added"/>
      </method>
      <method name="hashCode()" delta="added">
        <return name="int" delta="added"/>
      </method>
      <method name="toString()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.CharSequence" delta="added"/>
        <return name="java.lang.Comparable" delta="added"/>
        <return name="java.lang.String" delta="added"/>
      </method>
    </class>
    <version name="1.0.0" delta="added"/>
  </package>
  <package>
    <name>org.osgi.service.http</name>
    <mismatch> </mismatch>
    <packageDiff>ADDED</packageDiff>
    <newerVersion>1.3.0</newerVersion>
    <olderVersion>0.0.0</olderVersion>
    <suggestedVersion>1.0.0</suggestedVersion>
    <warnings>Excessive version increase</warnings>
    <attributes>version=&quot;1.3.0&quot;;uses:=&quot;javax.servlet,javax.servlet.http&quot;</attributes>
    <class name="org.osgi.service.http.NamespaceException" delta="added">
      <extends name="java.lang.Exception" delta="added"/>
      <extends name="java.lang.Throwable" delta="added"/>
      <implements name="java.io.Serializable" delta="added"/>
      <method name="&lt;init&gt;(java.lang.String)" delta="added"/>
      <method name="&lt;init&gt;(java.lang.String,java.lang.Throwable)" delta="added"/>
      <method name="clone()" delta="added">
        <access name="protected" delta="added"/>
      </method>
      <method name="equals(java.lang.Object)" delta="added">
        <return name="boolean" delta="added"/>
      </method>
      <method name="fillInStackTrace()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.Throwable" delta="added"/>
      </method>
      <method name="finalize()" delta="added">
        <access name="protected" delta="added"/>
      </method>
      <method name="getCause()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.Throwable" delta="added"/>
      </method>
      <method name="getException()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.Throwable" delta="added"/>
      </method>
      <method name="getLocalizedMessage()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.CharSequence" delta="added"/>
        <return name="java.lang.Comparable" delta="added"/>
        <return name="java.lang.String" delta="added"/>
      </method>
      <method name="getMessage()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.CharSequence" delta="added"/>
        <return name="java.lang.Comparable" delta="added"/>
        <return name="java.lang.String" delta="added"/>
      </method>
      <method name="getStackTrace()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.StackTraceElement[]" delta="added"/>
      </method>
      <method name="hashCode()" delta="added">
        <return name="int" delta="added"/>
      </method>
      <method name="initCause(java.lang.Throwable)" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.Throwable" delta="added"/>
      </method>
      <method name="printStackTrace()" delta="added"/>
      <method name="printStackTrace(java.io.PrintStream)" delta="added"/>
      <method name="printStackTrace(java.io.PrintWriter)" delta="added"/>
      <method name="setStackTrace(java.lang.StackTraceElement[])" delta="added"/>
      <method name="toString()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.CharSequence" delta="added"/>
        <return name="java.lang.Comparable" delta="added"/>
        <return name="java.lang.String" delta="added"/>
      </method>
    </class>
    <interface name="org.osgi.service.http.HttpContext" delta="added">
      <access name="abstract" delta="added"/>
      <field name="java.lang.String AUTHENTICATION_TYPE" delta="added">
        <access name="final" delta="added"/>
        <access name="static" delta="added"/>
        <constant name="org.osgi.service.http.authentication.type" delta="added"/>
      </field>
      <field name="java.lang.String AUTHORIZATION" delta="added">
        <access name="final" delta="added"/>
        <access name="static" delta="added"/>
        <constant name="org.osgi.service.useradmin.authorization" delta="added"/>
      </field>
      <field name="java.lang.String REMOTE_USER" delta="added">
        <access name="final" delta="added"/>
        <access name="static" delta="added"/>
        <constant name="org.osgi.service.http.authentication.remote.user" delta="added"/>
      </field>
      <method name="getMimeType(java.lang.String)" delta="added">
        <access name="abstract" delta="added"/>
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.CharSequence" delta="added"/>
        <return name="java.lang.Comparable" delta="added"/>
        <return name="java.lang.String" delta="added"/>
      </method>
      <method name="getResource(java.lang.String)" delta="added">
        <access name="abstract" delta="added"/>
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.net.URL" delta="added"/>
      </method>
      <method name="handleSecurity(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)"
delta="added">
        <access name="abstract" delta="added"/>
        <return name="boolean" delta="added"/>
      </method>
      <annotated name="org.osgi.annotation.versioning.ConsumerType" delta="added"/>
    </interface>
    <interface name="org.osgi.service.http.HttpService" delta="added">
      <access name="abstract" delta="added"/>
      <method name="createDefaultHttpContext()" delta="added">
        <access name="abstract" delta="added"/>
        <return name="org.osgi.service.http.HttpContext" delta="added"/>
      </method>
      <method name="registerResources(java.lang.String,java.lang.String,org.osgi.service.http.HttpContext)"
delta="added">
        <access name="abstract" delta="added"/>
      </method>
      <method name="registerServlet(java.lang.String,javax.servlet.Servlet,java.util.Dictionary,org.osgi.service.http.HttpContext)"
delta="added">
        <access name="abstract" delta="added"/>
      </method>
      <method name="unregister(java.lang.String)" delta="added">
        <access name="abstract" delta="added"/>
      </method>
      <annotated name="org.osgi.annotation.versioning.ProviderType" delta="added"/>
    </interface>
    <version name="1.3.0" delta="added"/>
  </package>
  <package>
    <name>org.osgi.service.http.runtime</name>
    <mismatch> </mismatch>
    <packageDiff>ADDED</packageDiff>
    <newerVersion>1.3.0</newerVersion>
    <olderVersion>0.0.0</olderVersion>
    <suggestedVersion>1.0.0</suggestedVersion>
    <warnings>Excessive version increase</warnings>
    <attributes>version=&quot;1.3.0&quot;</attributes>
    <class name="org.osgi.service.http.runtime.HttpServiceRuntimeConstants" delta="added">
      <access name="final" delta="added"/>
      <field name="java.lang.String HTTP_SERVICE_ENDPOINT_ATTRIBUTE" delta="added">
        <access name="final" delta="added"/>
        <access name="static" delta="added"/>
        <constant name="osgi.http.endpoint" delta="added"/>
      </field>
      <method name="clone()" delta="added">
        <access name="protected" delta="added"/>
      </method>
      <method name="equals(java.lang.Object)" delta="added">
        <return name="boolean" delta="added"/>
      </method>
      <method name="finalize()" delta="added">
        <access name="protected" delta="added"/>
      </method>
      <method name="hashCode()" delta="added">
        <return name="int" delta="added"/>
      </method>
      <method name="toString()" delta="added">
        <return name="java.io.Serializable" delta="added"/>
        <return name="java.lang.CharSequence" delta="added"/>
        <return name="java.lang.Comparable" delta="added"/>
        <return name="java.lang.String" delta="added"/>
      </method>
    </class>
    <interface name="org.osgi.service.http.runtime.HttpServiceRuntime" delta="added">
      <access name="abstract" delta="added"/>
      <method name="getRuntimeDTO()" delta="added">
        <access name="abstract" delta="added"/>
        <return name="org.osgi.dto.DTO" delta="added"/>
        <return name="org.osgi.service.http.runtime.dto.RuntimeDTO" delta="added"/>
      </method>
      <annotated name="org.osgi.annotation.versioning.ProviderType" delta="added"/>
    </interface>
    <version name="1.3.0" delta="added"/>
  </package>
{code}

> Add a new Mojo to invoke the BND Baseline tool
> ----------------------------------------------
>
>                 Key: FELIX-4512
>                 URL: https://issues.apache.org/jira/browse/FELIX-4512
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.4.0
>            Reporter: Simone Tripodi
>             Fix For: maven-bundle-plugin-2.4.1
>
>         Attachments: FELIX-4512.patch
>
>
> The BND 2.2.0 library contains an extraordinary tool called [Baseline|http://www.aqute.biz/Bnd/Versioning]
(see Baselining paragraph) that compares the public API of a bundle with the public API of
another bundle.
> It would be really useful to have this tool in the {{maven-bundle-plugin}} in order to
keep track of APIs modifications during development time.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message