Create source bundle for OSGi JAR
</execution>
</executions>
</plugin>
+
+ <!-- We need special build instructions for the sources JAR
+ since this is a 'shaded' JAR constructed from the already
+ compiled classes of its component modules -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>create-sources-artifact</id>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target name="create-sources-artifact-jar" unless="skip.osgi.sources">
+ <mkdir dir="${project.build.directory}/osgi-sources/META-INF/maven/${project.groupId}/${project.artifactId}" />
+
+ <copy todir="${project.build.directory}/osgi-sources/META-INF/maven/${project.groupId}/${project.artifactId}">
+ <fileset dir="${project.basedir}" includes="pom.xml" />
+ </copy>
+
+ <echo file="${project.build.directory}/osgi-sources/META-INF/maven/${project.groupId}/${project.artifactId}/pom.properties">
+#Created by Apache Maven ${maven.version}
+version=${project.version}
+groupId=${project.groupId}
+artifactId=${project.artifactId}
+ </echo>
+
+ <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}-sources.jar">
+ <fileset dir="${project.basedir}/../sshd-common/src/main/java" includes="**/*" />
+ <fileset dir="${project.basedir}/../sshd-common/src/main/resources" includes="**/*" erroronmissingdir="false" />
+ <fileset dir="${project.basedir}/../sshd-core/src/main/java" includes="**/*" />
+ <fileset dir="${project.basedir}/../sshd-core/src/main/resources" includes="**/*" erroronmissingdir="false" />
+ <fileset dir="${project.build.directory}/osgi-sources" includes="META-INF/**/*" />
+ </jar>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-source-artifact</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.directory}/${project.artifactId}-${project.version}-sources.jar</file>
+ <type>jar</type>
+ <classifier>sources</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
