0

I would like to build jar file in maven using maven dependencies and local dependencies.

How can I change maven plugin to insert all jar-s to Class-Path that I put inside dependencies sections?

ex.

<dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-1.2-api</artifactId>
            <version>${log4j2.version}</version>
        </dependency>

        <dependency>
            <groupId>config-source</groupId>
            <artifactId>config-source</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${pom.basedir}/lib/ConfigSource_1.0.jar</systemPath>
        </dependency>
 

To create Class-Path in manifest I added plugin

  <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.2</version>
                <configuration>
                    <archive>
                        <index>false</index>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

But in jar file in MANIFEST.FM I have only classes from maven repository.

fBruno
  • 1
  • 1
  • Does this answer your question? [How can I create an executable/runnable JAR with dependencies using Maven?](https://stackoverflow.com/questions/574594/how-can-i-create-an-executable-runnable-jar-with-dependencies-using-maven) – vikingsteve Mar 21 '23 at 09:39

0 Answers0