You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Glenn Wybo <gl...@gmail.com> on 2011/01/24 19:41:58 UTC

create exec of swing maven application

Hi,

I'm trying to create an executable jar from a swing application using  
maven and its maven-assembly-plugin. It builds ok, I saw in the jar it  
packs the dependent jars, but it contains non of my own programmed  
classes, resulting in a classnotfound exception when double clicking  
on the jar.

Can anyone help me out? Is this the easiest way for creating an  
excecutable for a swing application or are there better ways?

the configuration I used is:

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>be.....presentation.MyApp</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>attach-assembly-to-package</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
</plugin>

This plugin is in the parent class containing the modules. It has 6  
modules, from which the presentation module contains the main class.  
The other modules are dependencies of the presentation module.

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


Re: create exec of swing maven application

Posted by Glenn Wybo <gl...@gmail.com>.
Thanks very much,

it solved my issue.



On 24 Jan 2011, at 21:19, Stevo Slavić wrote:

> Only non-deprecated goal, besides help goal is single -
> http://maven.apache.org/plugins/maven-assembly-plugin/plugin-info.html
>
> Use single instead of attached. Use latest release (2.2), declare it
> first in pluginManagement.
>
> Regards,
> Stevo.
>
> On Mon, Jan 24, 2011 at 7:41 PM, Glenn Wybo <gl...@gmail.com>  
> wrote:
>> Hi,
>>
>> I'm trying to create an executable jar from a swing application  
>> using maven
>> and its maven-assembly-plugin. It builds ok, I saw in the jar it  
>> packs the
>> dependent jars, but it contains non of my own programmed classes,  
>> resulting
>> in a classnotfound exception when double clicking on the jar.
>>
>> Can anyone help me out? Is this the easiest way for creating an  
>> excecutable
>> for a swing application or are there better ways?
>>
>> the configuration I used is:
>>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-assembly-plugin</artifactId>
>> <configuration>
>> <descriptorRefs>
>> <descriptorRef>jar-with-dependencies</descriptorRef>
>> <descriptorRef>src</descriptorRef>
>> </descriptorRefs>
>> <archive>
>> <manifest>
>> <mainClass>be.....presentation.MyApp</mainClass>
>> </manifest>
>> </archive>
>> </configuration>
>> <executions>
>> <execution>
>> <id>attach-assembly-to-package</id>
>> <phase>package</phase>
>> <goals>
>> <goal>attached</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>>
>> This plugin is in the parent class containing the modules. It has 6  
>> modules,
>> from which the presentation module contains the main class. The other
>> modules are dependencies of the presentation module.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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


Re: create exec of swing maven application

Posted by Stevo Slavić <ss...@gmail.com>.
Only non-deprecated goal, besides help goal is single -
http://maven.apache.org/plugins/maven-assembly-plugin/plugin-info.html

Use single instead of attached. Use latest release (2.2), declare it
first in pluginManagement.

Regards,
Stevo.

On Mon, Jan 24, 2011 at 7:41 PM, Glenn Wybo <gl...@gmail.com> wrote:
> Hi,
>
> I'm trying to create an executable jar from a swing application using maven
> and its maven-assembly-plugin. It builds ok, I saw in the jar it packs the
> dependent jars, but it contains non of my own programmed classes, resulting
> in a classnotfound exception when double clicking on the jar.
>
> Can anyone help me out? Is this the easiest way for creating an excecutable
> for a swing application or are there better ways?
>
> the configuration I used is:
>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-assembly-plugin</artifactId>
> <configuration>
> <descriptorRefs>
> <descriptorRef>jar-with-dependencies</descriptorRef>
> <descriptorRef>src</descriptorRef>
> </descriptorRefs>
> <archive>
> <manifest>
> <mainClass>be.....presentation.MyApp</mainClass>
> </manifest>
> </archive>
> </configuration>
> <executions>
> <execution>
> <id>attach-assembly-to-package</id>
> <phase>package</phase>
> <goals>
> <goal>attached</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
> This plugin is in the parent class containing the modules. It has 6 modules,
> from which the presentation module contains the main class. The other
> modules are dependencies of the presentation module.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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