Skip to content

Commit

Permalink
Merge pull request #96 from dotCMS/fix-3rd-party-lib-example
Browse files Browse the repository at this point in the history
Fixed 3rd party lib example
  • Loading branch information
swicken-dotcms authored Jul 5, 2024
2 parents 3d9eeaf + b63cbc3 commit 1e69659
Showing 1 changed file with 47 additions and 43 deletions.
90 changes: 47 additions & 43 deletions com.dotcms.3rd.party/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.dotcms</groupId>
<artifactId>osgi-third-party-lib-example</artifactId>
<version>0.3</version>
Expand All @@ -28,53 +27,58 @@
<version>24.05.13</version>
<scope>provided</scope>
</dependency>
<!-- Local JAR dependency -->
<dependency>
<groupId>hirondelle.date4j</groupId>
<groupId>hirondelle</groupId>
<artifactId>date4j</artifactId>
<version>your.version</version>
<version>1.5.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/libs/date4j.jar</systemPath>
</dependency>

<!-- Add more dependencies as needed -->
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.9</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Vendor>dotCMS</Bundle-Vendor>
<Bundle-Description>dotCMS - OSGI 3rd Party library example</Bundle-Description>
<Bundle-DocURL>https://dotcms.com/</Bundle-DocURL>
<Bundle-Activator>com.dotmarketing.osgi.external.Activator</Bundle-Activator>
<Bundle-ClassPath>.,libs/*</Bundle-ClassPath> <!-- This assumes all your libs are under 'libs' -->
<Import-Package>!hirondelle.date4j.*,*;version=0</Import-Package>
</instructions>
</configuration>
</plugin>
<!-- Add Maven Dependency Plugin to copy libs from 'src/main/resources/libs' to 'target/libs' -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.9</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Activator>com.dotmarketing.osgi.external.Activator</Bundle-Activator>
<Private-Package>com.dotmarketing.osgi.external.*</Private-Package>
<Import-Package>org.osgi.framework,com.dotmarketing.*,org.apache.felix.http.api,javax.servlet,javax.servlet.http</Import-Package>
<Embed-Dependency>*;scope=system;inline=true</Embed-Dependency>
<Embed-Directory>lib</Embed-Directory>
<Embed-StripGroup>true</Embed-StripGroup>
<Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
</instructions>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
<includeScope>system</includeScope>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 1e69659

Please sign in to comment.