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

Robert Munteanu edited comment on SLING-5648 at 4/5/18 2:58 PM:
----------------------------------------------------------------

The PDE issue can be worked around by configuring the 
{{maven-resources-plugin}} to copy the MANIFEST.MF file under 
META-INF/MANIFEST.MF, so that PDE considers the project a bundle and uses it 
for dependency resolution. A patch for a single project is below

{noformat}diff --git a/shared/modules/api/.gitignore 
b/shared/modules/api/.gitignore
new file mode 100644
index 00000000..219f4178
--- /dev/null
+++ b/shared/modules/api/.gitignore
@@ -0,0 +1 @@
+/META-INF/MANIFEST.MF
diff --git a/shared/modules/api/pom.xml b/shared/modules/api/pom.xml
index 2f6a2c1c..05a80f59 100644
--- a/shared/modules/api/pom.xml
+++ b/shared/modules/api/pom.xml
@@ -93,4 +93,44 @@
             <scope>provided</scope>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>m2e</id>
+            <!-- This profile is only activated when building in Eclipse
+                with m2e -->
+            <activation>
+                <property>
+                    <name>m2e.version</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-resources-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>copy-manifest-for-pde</id>
+                                <phase>process-classes</phase>
+                                <goals>
+                                    <goal>copy-resources</goal>
+                                </goals>
+                                <configuration>
+                                    <outputDirectory>META-INF</outputDirectory>
+                                    <resources>
+                                        <resource>
+                                            
<directory>${project.build.outputDirectory}/META-INF</directory>
+                                            <includes>
+                                                <include>MANIFEST.MF</include>
+                                            </includes>
+                                        </resource>
+                                    </resources>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
{noformat}

_edit_: raised a feature request with PDE - 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=533263


was (Author: rombert):
The PDE issue can be worked around by configuring the 
{{maven-resources-plugin}} to copy the MANIFEST.MF file under 
META-INF/MANIFEST.MF, so that PDE considers the project a bundle and uses it 
for dependency resolution. A patch for a single project is below

{noformat}diff --git a/shared/modules/api/.gitignore 
b/shared/modules/api/.gitignore
new file mode 100644
index 00000000..219f4178
--- /dev/null
+++ b/shared/modules/api/.gitignore
@@ -0,0 +1 @@
+/META-INF/MANIFEST.MF
diff --git a/shared/modules/api/pom.xml b/shared/modules/api/pom.xml
index 2f6a2c1c..05a80f59 100644
--- a/shared/modules/api/pom.xml
+++ b/shared/modules/api/pom.xml
@@ -93,4 +93,44 @@
             <scope>provided</scope>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>m2e</id>
+            <!-- This profile is only activated when building in Eclipse
+                with m2e -->
+            <activation>
+                <property>
+                    <name>m2e.version</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-resources-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>copy-manifest-for-pde</id>
+                                <phase>process-classes</phase>
+                                <goals>
+                                    <goal>copy-resources</goal>
+                                </goals>
+                                <configuration>
+                                    <outputDirectory>META-INF</outputDirectory>
+                                    <resources>
+                                        <resource>
+                                            
<directory>${project.build.outputDirectory}/META-INF</directory>
+                                            <includes>
+                                                <include>MANIFEST.MF</include>
+                                            </includes>
+                                        </resource>
+                                    </resources>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
{noformat}

> Make Non-Eclipse Module regular Maven Packages
> ----------------------------------------------
>
>                 Key: SLING-5648
>                 URL: https://issues.apache.org/jira/browse/SLING-5648
>             Project: Sling
>          Issue Type: Improvement
>          Components: IDE
>    Affects Versions: Sling Eclipse IDE 1.0.10
>            Reporter: Andreas Schaefer
>            Assignee: Robert Munteanu
>            Priority: Major
>             Fix For: Sling Eclipse IDE 1.2.4
>
>
> Non Eclipse modules like api, artifacts, imll-resource, impl-vlt should be 
> regular Maven packages (jar) instead of eclipse plugins (eclipse-plugin) to 
> support development of it by other IDEs like IntelliJ IDEA.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to