In the interest of reporting success, I decided not to change the 
maven.build.dir and instead just move everything to target/lib.  I also found 
a simply way to copy dependent jars.  Here's my new post goal.

        <postGoal name="jar">
        <!-- Create a target/lib directory -->
        <mkdir dir="${maven.build.dir}/lib"/>
        
        <!-- Move any generated jars into this directory -->
        <move file="${maven.build.dir}/${maven.final.name}.jar" 
            todir="${maven.build.dir}/lib"/>
        
        <deploy:copy-deps todir="${maven.build.dir}/lib"/>
 
        </postGoal>


As for my resources problem, that was fixed with:

        <resources>
            <resource>
                <directory>${basedir}/src/java</directory>
                <includes>
                        <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>


Thanks for the help,

Matt

---------- Forwarded Message -----------
From: "Matt Raible" <[EMAIL PROTECTED]>
To: "Maven Users List" <[EMAIL PROTECTED]>
Sent: Thu, 29 May 2003 16:22:01 -0700
Subject: Re: building jar in target/lib and copying dependencies

Thanks, both answers where what I was looking for.  I'm not building a webapp 
(yet).  Currently, I'm copying all jars (including the built one) into 
target/lib, and then running:

java -cp [all jars] package.className

Adding the following helped me get my dependent jars into the target/lib 
directory:

        <postGoal name="jar">
        <j:forEach var="dep" items="${pom.dependencies}">
          <j:if test="${dep.getProperty('bundle.jar')=='true'}">
            <copy todir="${maven.build.dir}"
              file="${maven.repo.local}/${dep.artifactDirectory}/jars/
${dep.artifact}"/>
          </j:if>  
        </j:forEach>  
        </postGoal>

Now, I'm running into a new problem.  I have a Resources.properties file in 
my java/src/package... tree, and I want to include it in the jar.

Unfortunately, this is not working:

        <resources>
            <includes>
                <include>**/*.properties</include>
            </includes>
        </resources>

Thanks,

Matt
------- End of Forwarded Message -------


-- Matt Raible, Raible Designs, Morrison CO US
-- Tel: +1 303 979-5340
-- Mob: +1 720 560-8460
-- Fax: +1 508 256-6471
-- Web: http://www.raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to