You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Derricutt <ma...@talios.com> on 2008/04/09 07:14:23 UTC

Adding a Main-Class to a jar-with-dependencies jar?

Hey all,

http://docs.codehaus.org/pages/viewpage.action?pageId=72602 shows how to set
the Main-Class for a .jar file using the maven-jar-plugin and thats fine,
but I was wondering if this could also be applied to the jar being made from
the assembly plugin somehow?

Do I need to make a custom assembly descriptor for this?

Thanks,
Mark

-- 
"It is easier to optimize correct code than to correct optimized code." --
Bill Harlan

Re: Adding a Main-Class to a jar-with-dependencies jar?

Posted by Mark Derricutt <ma...@talios.com>.
Correct - not sure how I missed that earlier.

Thanks,
Mark

On Wed, Apr 9, 2008 at 8:23 PM, MATHUS Baptiste <ma...@mipih.fr> wrote:

> Hi,
>
> Having a look in the assembly plugin documentation:
> http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
> Then "Advanced Config/Creating an Executable Jar", wouldn't it help?
>


-- 
"It is easier to optimize correct code than to correct optimized code." --
Bill Harlan

RE: Adding a Main-Class to a jar-with-dependencies jar?

Posted by MATHUS Baptiste <ma...@mipih.fr>.
Hi,

Having a look in the assembly plugin documentation: http://maven.apache.org/plugins/maven-assembly-plugin/usage.html 
Then "Advanced Config/Creating an Executable Jar", wouldn't it help?

Excerpt:
     <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          [...]
          <archive>
            <manifest>
              <mainClass>org.sample.App</mainClass>
            </manifest>
          </archive>
        </configuration>
        [...]
      </plugin>

Cheers

> -----Message d'origine-----
> De : Mark Derricutt [mailto:mark@talios.com] 
> Envoyé : mercredi 9 avril 2008 07:14
> À : Maven Users List
> Objet : Adding a Main-Class to a jar-with-dependencies jar?
> 
> Hey all,
> 
> http://docs.codehaus.org/pages/viewpage.action?pageId=72602 
> shows how to set the Main-Class for a .jar file using the 
> maven-jar-plugin and thats fine, but I was wondering if this 
> could also be applied to the jar being made from the assembly 
> plugin somehow?
> 
> Do I need to make a custom assembly descriptor for this?
> 
> Thanks,
> Mark
> 
> --
> "It is easier to optimize correct code than to correct 
> optimized code." -- Bill Harlan
> 

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


Maven 2 Bug? Not Processing Children

Posted by Ch...@aami.com.au.
Following Nick's suggestion to how to report a bug:

On this issue:

http://www.nabble.com/Class-Path-Test-Problem.-tt16556171s177.html

I have solved the problem.

If the consolidated pom has a scope in it, it fails to resolve it's child 
dependencies.

Consider this from a top level pom:

        <dependency>
            <groupId>com.ibm.db2.jcc</groupId>
            <artifactId>library</artifactId>
            <version>V8-FP15</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>

This is what works:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ibm.db2.jcc</groupId>
    <artifactId>library</artifactId>
    <version>V8-FP15</version>
    <packaging>pom</packaging>
    <name>Master POM for the DB2 Universal Drivers from V8 FP15.</name>
    <description>POM was created from install:install-file</description>
        <dependencies>
            <dependency>
                <groupId>com.ibm.db2.jcc</groupId>
                <artifactId>db2jcc</artifactId>
                <version>V8-FP15</version>
            </dependency>
            <dependency>
                <groupId>com.ibm.db2.jcc</groupId>
                <artifactId>db2jcc_license_cisuz</artifactId>
                <version>V8-FP15</version>
            </dependency>
            <dependency>
                <groupId>com.ibm.db2.jcc</groupId>
                <artifactId>db2jcc_license_cu</artifactId>
                <version>V8-FP15</version>
            </dependency>
        </dependencies>
</project>

If I add a scope of <anything> to each dependency, it fails to resolve 
it's children.

I consider this a bug.

If you are depending on a pom of type pom and the scope attribute is not 
needed (it should be specified in the top level dependency definition), 
then it should be ignored. At the very least it should not cease 
processing it's children.

This is the broken one, for reference:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ibm.db2.jcc</groupId>
    <artifactId>library</artifactId>
    <version>V8-FP15</version>
    <packaging>pom</packaging>
    <name>Master POM for the DB2 Universal Drivers from V8 FP15.</name>
    <description>POM was created from install:install-file</description>
        <dependencies>
            <dependency>
                <groupId>com.ibm.db2.jcc</groupId>
                <artifactId>db2jcc</artifactId>
                <version>V8-FP15</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>com.ibm.db2.jcc</groupId>
                <artifactId>db2jcc_license_cisuz</artifactId>
                <version>V8-FP15</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>com.ibm.db2.jcc</groupId>
                <artifactId>db2jcc_license_cu</artifactId>
                <version>V8-FP15</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
</project>

-Chris


**********************************************************************
CAUTION - This message is intended for the addressee named above. It may contain privileged or confidential information. 

If you are not the intended recipient of this message you must: 
- Not use, copy, distribute or disclose it to anyone other than the addressee;
- Notify the sender via return email; and
- Delete the message (and any related attachments) from your computer immediately.

Internet emails are not necessarily secure. Australian Associated Motors Insurers Limited ABN 92 004 791 744 (AAMI), and its related entities, do not accept responsibility for changes made to this message after it was sent.

Unless otherwise stated, views expressed within this email are the author's own and do not represent those of AAMI.
**********************************************************************

Newer Jar Override

Posted by Ch...@aami.com.au.
Hi All.

        The org.apache.maven.plugins:maven-checkstyle-plugin dependon upon 
checkstyle 4.1.

        I'd like to use checkstyle 4.4 (that matches by eclipse version).

        Is there any way to override it and get it to use 4.4 instead of 
4.1?

        TIA,

-Chris


**********************************************************************
CAUTION - This message is intended for the addressee named above. It may contain privileged or confidential information. 

If you are not the intended recipient of this message you must: 
- Not use, copy, distribute or disclose it to anyone other than the addressee;
- Notify the sender via return email; and
- Delete the message (and any related attachments) from your computer immediately.

Internet emails are not necessarily secure. Australian Associated Motors Insurers Limited ABN 92 004 791 744 (AAMI), and its related entities, do not accept responsibility for changes made to this message after it was sent.

Unless otherwise stated, views expressed within this email are the author's own and do not represent those of AAMI.
**********************************************************************