0

I am trying to deploy a jar to a maven repo with some dependencies, from the maven. I tried using aven-assembly-plugin and maven-shade-plugin and some other ones. And I am trying to deploy using clean deploy -Dmaven.resolver.transport=wagon dependency:copy-dependencies its building the jar with my code and not adding dependencies.

<plugins>
   <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-dependency-plugin</artifactId>
   <version>2.3</version>
   <executions>
      <execution>
         <phase>package</phase>
         <goals>
            <goal>copy-dependencies</goal>
         </goals>
         <configuration>
            <outputDirectory>localrepo</outputDirectory>
            <useRepositoryLayout>true</useRepositoryLayout>
            <artifactSet>
               <includes>
                  <include>com.zaxxer:HikariCP</include>
               </includes>
            </artifactSet>
         </configuration>
      </execution>
   </executions>
</plugin>
</plugins>

Thanks for your time!

  • If you like to add the dependencies to your jar you have to create a so called shaded jar which means you have to use maven-shade-plugin to combine all those dependencies into a single jar. The other question is: What kind of application are you creating? – khmarbaise Jun 23 '23 at 18:03
  • I am making a library like application to be used in other applications! After I get the shadow jar, how can I deploy the jar? – MaikyDev Jun 23 '23 at 18:27
  • Why making a shaded jar instead of providing your own library with the appropriate transitive dependencies (within the pom file).. This is the usual way to do that... ? – khmarbaise Jun 23 '23 at 18:30
  • For a minecraft plugins is better this way, the user (or me) needs just to put the jar with the maven and there will be all the dependencies. Edit: I am stupid xd, I will try using the src code then. – MaikyDev Jun 23 '23 at 18:40

0 Answers0