Bielby, Randy J wrote:
Well one thing you can do which is what I've done for my WebLogic builds is to copy the dependencies from the repository to the WEB-INF/lib folder. I do this withHello,
First, I'm a newbie and just getting started. I'm trying to proof out an existing build that is currently using Ant, while also making a determination of Maven is a good choice for new projects.
I have a situation that I don't believe is unique but I can't seem to
find all the info I'm looking for. I have several projects with a
number of dependent jars. The development team is anywhere from 10-30
developers depending upon the project. We are using WSAD and have as
one of the projects in our workspace a webapp. This webapp contains all
the dependent jars within the WEB-INF/lib folder. All the other project
within the workspace are included as dependent jars in the EAR. I would
prefer that the compile uses the jars in the lib folder. This is the
ensure that the deployed runtime code is the same as what the developers
have developed against. I know this goes against Maven's perferred
method of retrieving dependencies for the repository. I know that I can
override this behavior, but I'm struggling with how to go about it.
I guess I could override the local repository to be the WEB-INF/lib, but I'm not sure that will work due to the expected folder structure of the repo. I could also just not use the dependencies and add the jar to the classpath.
Also, due to corporate defined standards, my jar names cannot contain the version number (don't ask). So I also need my jar dependencies to be something like, log4j.jar instead of log4j-1.2.6.jar. I have tried eliminating the version from the dependency but I get, log4j-.jar instead.
Randy Bielby
<deploy:copy-deps todir="${wli.app.lib.dir}"/>Where wli.app.lib.dir is a property pointing at the WEB-INF/lib folder.
As for getting rid of the version numbers, I believe you could do something like
<j:forEach var="lib" items="${pom.artifacts}">
<j:set var="dep" value="${lib.dependency}"/>
<j:if test="${dep.getProperty('javalib')=='true'}">
<ant:mkdir dir="${maven.war.webapp.dir}/javalib"/>
<j:if test="${dep.type =='jar'}">
<ant:copy file="${lib.path}"
tofile="${maven.war.webapp.dir}/javalib/${dep.artifactId}.jar"
verbose="${squid.verbose}"/>
</j:if>
</j:if>
</j:forEach>
In the above, I have some jars in my dependency list that need to go to a /javalib directory because they
are used by some applets. I tagged the dependency with the property "javalib" so I only copy the jars
that need to be in the /javalib directory. I also don't want the version number on the resulting file which is accomplished by the ${dep.artifactId}.jar name.
A dependency targeted for /javalib looks like
<dependency>
<groupId>Squid</groupId>
<artifactId>taskmaster</artifactId>
<version>${squid.version}</version>
<properties>
<javalib>true</javalib>
</properties>
</dependency>Hope this helps. I too have embarked on the task of replacing Ant with Maven, and have been pleased at
how easy it has been.
--
Erik Husby
Team Lead for Software Quality Automation
Broad Institute of MIT and Harvard Rm. 2192 320 Charles St
Cambridge, MA 02141-2023
mobile: 781.354.6669, office: 617.258.9227, [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
