[ https://issues.apache.org/jira/browse/SLING-8078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16678426#comment-16678426 ]
ASF GitHub Bot commented on SLING-8078: --------------------------------------- bosschaert commented on a change in pull request #16: SLING-8078 - New Analyser task which is able to detect Export-Package dependencies between regions URL: https://github.com/apache/sling-slingfeature-maven-plugin/pull/16#discussion_r231562296 ########## File path: src/it/analyzer-apiregions-errors-detected/pom.xml ########## @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more contributor license + agreements. See the NOTICE file distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file to you under the Apache License, + Version 2.0 (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the + License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions + and limitations under the License. +--> +<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> + <groupId>org.apache.sling</groupId> + <artifactId>slingfeature-maven-plugin-test</artifactId> + <packaging>jar</packaging> + <version>1.0.0-SNAPSHOT</version> + + <name>Apache Sling Features Maven plugin test</name> + + <build> + <plugins> + <plugin> + <groupId>@project.groupId@</groupId> + <artifactId>@project.artifactId@</artifactId> + <version>@project.version@</version> + <extensions>true</extensions> + <executions> + <execution> + <id>analyze</id> + <phase>validate</phase> + <goals> + <goal>analyse-features</goal> + </goals> + </execution> + </executions> + <configuration> + <scans> + <scan> + <includes>**/*.json</includes> + <includeTasks>api-regions-dependencies</includeTasks> + <contextConfiguration> + <exporting-apis>my-global</exporting-apis> + <hiding-apis>my-deprecated</hiding-apis> Review comment: I would prefix these with something common so that it's clear that they belong to the same task, something like: ` <taskConfiguration> <api-regions-exporting>my-global</api-regions-exporting> <api-regions-hiding>my-deprecated</api-regions-hiding> </contextConfiguration> ` I guess this is along the same lines as what @cziegeler has commented on https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/7#issuecomment-436665548 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > New Analyser task which is able to detect Export-Package dependencies between > regions > ------------------------------------------------------------------------------------- > > Key: SLING-8078 > URL: https://issues.apache.org/jira/browse/SLING-8078 > Project: Sling > Issue Type: New Feature > Components: Feature Model, Maven Plugins and Archetypes > Affects Versions: Feature Model Analyser 0.2.0 > Reporter: Simone Tripodi > Assignee: David Bosschaert > Priority: Major > Fix For: Feature Model Analyser 0.2.2 > > > It may be helpful users have the need to define a {{deprecated}} region in > order to mark which APIs don't have to be exposed to end users, a new > Analyser Task implementation will help to detect if {{global}} exported APIs > don't have {{uses}} dependencies to APIs that are declared in the > {{deprecated}} region. > i.e. given a feature: > {noformat} > ... > [ > { > "name": "global" > "exports": ["org.osgi.util.function"] > }, > { > "name": "deprecated", > "exports": ["org.objectweb.asm"] > } > ] > ... > {noformat} > and a bundle declares the OSGi header in the Manifest as below: > {noformat} > Export-Package: org.osgi.util.function;uses:="org.objectweb.asm" > {noformat} > the new Analyser Task implementation will detect that "violation" > {noformat} > Bundle 'org.osgi:org.osgi.util.function:1.0.0', defined in feature > 'org.apache.sling.testing:org.apache.sling.testing.apiregions:1.0.0', > declares 'org.osgi.util.function' in the 'Export-Package' header which > requires 'org.objectweb.asm' package that is in the 'deprecated' region > {noformat} > PR is coming -- This message was sent by Atlassian JIRA (v7.6.3#76005)