Hello,

 

I use the maven-jar-plugin to build an executable jar file with a
manifest that contains the classpath to all embedded jars.

When I build the assembly with the maven-assembly-plugin, the plug-in
adds some snapshot libraries with the build format pattern
myjar-1.0-<date>-<time>-<buildnumber>.jar to zip file instead the format
myjar-1.0-SNAPSHOT.jar.

The classpath isn't correctly and I can't start my application with the
classpath defined in the manifest.

How can I build an assembly with a correct classpath in the jar manifest
with maven.

 

Kind regards 

Peter 

 

    <build>

        <defaultGoal>assembly:assembly</defaultGoal>

        <plugins>

            <plugin>

                <artifactId>maven-jar-plugin</artifactId>

                <configuration>

                    <archive>

                        <manifest>

 
<mainClass>com.test.ApplicationStarter</mainClass>

                            <addClasspath>true</addClasspath>

                            <classpathPrefix>lib</classpathPrefix>

                        </manifest>

                    </archive>

                </configuration>

            </plugin>

            <plugin>

                <artifactId>maven-assembly-plugin</artifactId>

                <executions>

                    <execution>

                        <phase>deploy</phase>

                        <goals>

                            <goal>assembly</goal>

                        </goals>

                    </execution>

                </executions>

                <configuration>

                    <descriptors>

 
<descriptor>src/main/assembly/bin.xml</descriptor>

                    </descriptors>

 
<finalName>application-${distribution.label}</finalName>

                </configuration>

            </plugin>

        </plugins>

    </build>

Reply via email to