Re: maven-shade-plugin createSourcesJar creates a source jar of dependencies but not the main project

2024-03-28 Thread Toshiya Kobayashi
Thank you very much, Alexander! It solved the issue!

Toshiya

On Thu, Mar 28, 2024 at 4:53 PM Alexander Kriegisch <
alexan...@kriegisch.name> wrote:

> Shade needs an original sources JAR as input for 'createSourcesJar'. Make
> sure to add Maven Source Plugin to your build and put it above Shade in the
> 'plugins' section to ensure that both of them are exeuted in the correct
> order during the 'package' phase.
>
> 
>   org.apache.maven.plugins
>   maven-source-plugin
>   3.3.0
>   
> 
>   module-source-jar
>   
> jar
>   
> 
>   
> 
>
> BTW, in a multi-module project, the requirement to create source JARs
> applies to all modules the aggregate JAR depends on and is meant to shade.
> Alternatively, you could use Maven Assembly to first create one aggregate
> sources JAR and then let Shade find that one.
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Toshiya Kobayashi schrieb am 28.03.2024 06:22 (GMT +01:00):
>
> > Hello,
> >
> > I use maven-shade-plugin to create an uber jar and its source jar with
> > .
> >
> > https://github.com/tkobayas/shade-test/blob/main/pom.xml
> > ```
> >   
> > org.apache.maven.plugins
> > maven-shade-plugin
> > 3.5.2
> > 
> >   
> > source-jar
> > 
> >   shade
> > 
> > 
> >   true
> >   
> > 
> >   org.ow2.asm:asm
> > 
> >   
> > 
> >   
> > 
> >   
> > ```
> >
> > The uber jar (shade-test-1.0-SNAPSHOT.jar) contains both the project
> > classes (App.class) and dependency classes (org.ow2.asm:asm), but the
> > source jar (shade-test-1.0-SNAPSHOT-sources.jar) contains only
> > dependency class sources, not the project class sources (App.java).
> >
> > Is it expected? Am I overlooking any configuration?
> >
> > Any help/suggestions would be appreciated.
> >
> > Thanks!
> > Toshiya
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: maven-shade-plugin createSourcesJar creates a source jar of dependencies but not the main project

2024-03-28 Thread Alexander Kriegisch
Shade needs an original sources JAR as input for 'createSourcesJar'. Make sure 
to add Maven Source Plugin to your build and put it above Shade in the 
'plugins' section to ensure that both of them are exeuted in the correct order 
during the 'package' phase.


  org.apache.maven.plugins
  maven-source-plugin
  3.3.0
  

  module-source-jar
  
jar
  

  


BTW, in a multi-module project, the requirement to create source JARs applies 
to all modules the aggregate JAR depends on and is meant to shade. 
Alternatively, you could use Maven Assembly to first create one aggregate 
sources JAR and then let Shade find that one.
-- 
Alexander Kriegisch
https://scrum-master.de


Toshiya Kobayashi schrieb am 28.03.2024 06:22 (GMT +01:00):

> Hello,
> 
> I use maven-shade-plugin to create an uber jar and its source jar with
> .
> 
> https://github.com/tkobayas/shade-test/blob/main/pom.xml
> ```
>   
> org.apache.maven.plugins
> maven-shade-plugin
> 3.5.2
> 
>   
> source-jar
> 
>   shade
> 
> 
>   true
>   
> 
>   org.ow2.asm:asm
> 
>   
> 
>   
> 
>   
> ```
> 
> The uber jar (shade-test-1.0-SNAPSHOT.jar) contains both the project
> classes (App.class) and dependency classes (org.ow2.asm:asm), but the
> source jar (shade-test-1.0-SNAPSHOT-sources.jar) contains only
> dependency class sources, not the project class sources (App.java).
> 
> Is it expected? Am I overlooking any configuration?
> 
> Any help/suggestions would be appreciated.
> 
> Thanks!
> Toshiya
> 

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org