Skip to content

Commit 5186ebc

Browse files
authored
Merge pull request #3047 from hazendaz/master
[pom] Make sure source package picks up our shaded artifacts to help users in IDEs - fixes #3045
2 parents a64a3a0 + 30cddfe commit 5186ebc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@
388388
<phase>package</phase>
389389
<configuration>
390390
<createDependencyReducedPom>false</createDependencyReducedPom>
391+
<createSourcesJar>true</createSourcesJar>
391392
<artifactSet>
392393
<includes>
393394
<include>org.mybatis:mybatis</include>
@@ -419,6 +420,7 @@
419420
<shadedPattern>org.apache.ibatis.javassist</shadedPattern>
420421
</relocation>
421422
</relocations>
423+
<shadeSourcesContent>true</shadeSourcesContent>
422424
</configuration>
423425
</execution>
424426
</executions>
@@ -509,6 +511,33 @@
509511
<derby.version>10.17.1.0</derby.version>
510512
</properties>
511513
</profile>
514+
515+
<!-- We are manipulating the phase to run before package so shading will be used for building source jar
516+
and further turning off attach here as shading will do that. This is required for ognl and javassist
517+
for IDE's usage -->
518+
<profile>
519+
<id>release</id>
520+
<build>
521+
<plugins>
522+
<plugin>
523+
<groupId>org.apache.maven.plugins</groupId>
524+
<artifactId>maven-source-plugin</artifactId>
525+
<executions>
526+
<execution>
527+
<id>attach-sources</id>
528+
<goals>
529+
<goal>jar-no-fork</goal>
530+
</goals>
531+
<phase>prepare-package</phase>
532+
<configuration>
533+
<attach>false</attach>
534+
</configuration>
535+
</execution>
536+
</executions>
537+
</plugin>
538+
</plugins>
539+
</build>
540+
</profile>
512541
</profiles>
513542

514543
</project>

0 commit comments

Comments
 (0)