brett 2003/08/20 05:42:37 Modified: src/plugins-build/jdee plugin.jelly src/plugins-build/jbuilder plugin.jelly plugin.properties Log: PR: MAVEN-458 Fixes for incorrect usage of dependencies instead of artifacts Revision Changes Path 1.5 +1 -1 maven/src/plugins-build/jdee/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/maven/src/plugins-build/jdee/plugin.jelly,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- plugin.jelly 20 Aug 2003 12:37:18 -0000 1.4 +++ plugin.jelly 20 Aug 2003 12:42:37 -0000 1.5 @@ -52,7 +52,7 @@ </j:if> <!-- now iterate through all dependencies --> <j:forEach var="lib" items="${pom.artifacts}"> -"${maven.repo.local}${lib.urlPath}" <j:whitespace /> +"${lib.path}" <j:whitespace /> </j:forEach> ))))) </j:file> 1.13 +59 -51 maven/src/plugins-build/jbuilder/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/maven/src/plugins-build/jbuilder/plugin.jelly,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- plugin.jelly 19 Aug 2003 04:45:08 -0000 1.12 +++ plugin.jelly 20 Aug 2003 12:42:37 -0000 1.13 @@ -2,6 +2,7 @@ <project xmlns:j="jelly:core" + xmlns:ant="jelly:ant" xmlns:u="jelly:util" xmlns:def="jelly:define" xmlns:m="jelly:maven" @@ -44,9 +45,9 @@ </def:tag> <!-- ================================================================== --> - <!-- jbuilder:generateDependencyLibrary --> + <!-- jbuilder:generateArtifactLibrary --> <!-- ================================================================== --> - <!-- Generate a JBuilder library definition from a dependency. If the --> + <!-- Generate a JBuilder library definition from an artifact. If the --> <!-- dependency is versioned (i.e. is not a snapshot) or if an --> <!-- unversioned library definition has not been created yet from the --> <!-- corresponding artifact, then a versioned library definition is --> @@ -59,10 +60,10 @@ <!-- definition is written. --> <!-- --> <!-- The following parameters can be used with the --> - <!-- generateDependencyLibrary tag by setting the appropriate attribute --> + <!-- generateArtifactLibrary tag by setting the appropriate attribute --> <!-- when invoking the tag: --> <!-- --> - <!-- @param dependency The dependency. --> + <!-- @param artifact The artifact. --> <!-- @param userHome The JBuilder user home directory. --> <!-- @param libraryList Optional name of the variable that contains a --> <!-- a semi-colon separated list of library names. --> @@ -70,14 +71,14 @@ <!-- the generated library will be appended. --> <!-- @param verbose Optional flag to enable verbose output. --> <!-- ================================================================== --> - <def:tag name="generateDependencyLibrary"> - <j:set var="libraryId" value="${dependency.artifactId}" /> - <j:set var="libraryVersion" value="${dependency.version}" /> + <def:tag name="generateArtifactLibrary"> + <j:set var="libraryId" value="${artifact.dependency.artifactId}" /> + <j:set var="libraryVersion" value="${artifact.dependency.version}" /> <!-- The default is to create a versioned library definition that refers to the jar in the local repository. --> <j:set var="libraryName" value="${libraryId}-${libraryVersion}" /> <j:if test="${verbose}" > - <echo>Checking dependency ${libraryName} ...</echo> + <ant:echo>Checking dependency ${libraryName} ...</ant:echo> </j:if> <j:if test="${userHome != null and userHome.length() gt 0}" > <j:set var="isSnapshot" value="${libraryVersion.equals('SNAPSHOT')}" /> @@ -95,7 +96,7 @@ created yet from the corresponding artifact. --> <j:when test="${!isSnapshot or !unversionedLibraryExists}" > <j:if test="${verbose and isSnapshot}" > - <echo> unversioned library definition not found</echo> + <ant:echo> unversioned library definition not found</ant:echo> </j:if> <j:set var="libraryFile" value="${userHome}/${libraryName}.library" /> <j:set var="libraryExists" value="false" /> @@ -118,10 +119,10 @@ <j:if test="${!libraryExists or (mavenGenerated and libraryType == 'dependency') }" > <j:if test="${verbose}" > - <echo> creating dependent ${libraryFile}</echo> + <ant:echo> creating dependent ${libraryFile}</ant:echo> </j:if> <j:if test="${!verbose}" > - <echo>Creating dependent ${libraryFile} ...</echo> + <ant:echo>Creating dependent ${libraryFile} ...</ant:echo> </j:if> <!-- Get optional library source path property. --> @@ -133,7 +134,7 @@ <x:comment>JBuilder Library Definition File</x:comment> <fullname>${libraryName}</fullname> <class> - <path><j:expr value="${maven.repo.local}/${dependency.groupId}/jars/${dependency.artifact}"/></path> + <path><j:expr value="${artifact.path}"/></path> </class> <j:if test="${librarySource != null and librarySource.length() gt 0}" > <source> @@ -156,7 +157,7 @@ <j:otherwise> <j:set var="libraryName" value="${unversionedLibraryName}" /> <j:if test="${verbose}" > - <echo> referencing artifact library ${unversionedLibraryFile}</echo> + <ant:echo> referencing artifact library ${unversionedLibraryFile}</ant:echo> </j:if> </j:otherwise> </j:choose> @@ -187,7 +188,7 @@ <def:tag name="generateProjectLibrary"> <j:set var="libraryName" value="${project.artifactId}" /> <j:set var="libraryFile" value="${userHome}/${libraryName}.library" /> - <echo>Creating ${libraryFile} ...</echo> + <ant:echo>Creating ${libraryFile} ...</ant:echo> <j:file name="${libraryFile}" prettyPrint="true" xmlns="dummy"> <library> <x:comment>JBuilder Library Definition File</x:comment> @@ -261,15 +262,15 @@ <!-- Find and read the JBuilder default project properties. --> <jbuilder:getDefaultProject project="jbDefaultProject" userHome="jbUserHome" /> <j:if test="${jbDefaultProject == null}" > - <echo>+------------------------------------------------------------------</echo> - <echo>| WARNING!</echo> - <echo>|</echo> - <echo>| A JBuilder installation could not be found. The project files</echo> - <echo>| being created will contain default values.</echo> - <echo>+------------------------------------------------------------------</echo> + <ant:echo>+------------------------------------------------------------------</ant:echo> + <ant:echo>| WARNING!</ant:echo> + <ant:echo>|</ant:echo> + <ant:echo>| A JBuilder installation could not be found. The project files</ant:echo> + <ant:echo>| being created will contain default values.</ant:echo> + <ant:echo>+------------------------------------------------------------------</ant:echo> </j:if> <j:if test="${jbDefaultProject != null}" > - <echo>Reading default project ${jbDefaultProject}</echo> + <ant:echo>Reading default project ${jbDefaultProject}</ant:echo> <u:properties file="${jbDefaultProject}" var="defaultProps" /> <j:set var="authorLabel" value="${defaultProps.getProperty('sys[0].AuthorLabel')}" /> <j:set var="backupPath" value="${defaultProps.getProperty('sys[0].BackupPath')}" /> @@ -282,18 +283,18 @@ <j:set var="versionLabel" value="${defaultProps.getProperty('sys[0].VersionLabel')}" /> <available property="jdkDefPresent" file="${jbUserHome}/${jdk}.library" /> <j:if test="${!jdkDefPresent}"> - <echo>+------------------------------------------------------------------</echo> - <echo>| WARNING!</echo> - <echo>|</echo> - <echo>| This project is being configured to use ${jdk}. This</echo> - <echo>| JDK has not been configured yet in your JBuilder installation.</echo> - <echo>| Go to Tools|Configure JDKs.</echo> - <echo>+------------------------------------------------------------------</echo> + <ant:echo>+------------------------------------------------------------------</ant:echo> + <ant:echo>| WARNING!</ant:echo> + <ant:echo>|</ant:echo> + <ant:echo>| This project is being configured to use ${jdk}. This</ant:echo> + <ant:echo>| JDK has not been configured yet in your JBuilder installation.</ant:echo> + <ant:echo>| Go to Tools|Configure JDKs.</ant:echo> + <ant:echo>+------------------------------------------------------------------</ant:echo> </j:if> <j:set var="defCompany" value="${defaultProps.getProperty('sys[0].Company')}" /> </j:if> - <echo>Creating ${basedir}/${pom.artifactId}.jpx ...</echo> + <ant:echo>Creating ${basedir}/${pom.artifactId}.jpx ...</ant:echo> <!-- Format the copyright notice. --> <j:set var="copyright" value="Copyright (c) ${year} ${company} - All Rights Reserved." /> @@ -303,7 +304,6 @@ <j:set var="includeTestPath" value="0" /> <j:set var="sourcePath" value="${pom.build.sourceDirectory}" /> <j:set var="libraries" value="" /> - <j:useList var="testDependencies" /> <!-- If the project has unit tests, add the test source code to the project path. --> <j:if test="${unitTestSourcesPresent}" > @@ -319,37 +319,45 @@ </j:forEach> </j:if> <!-- Convert each of the project's dependencies into a required library. --> - <j:forEach var="lib" items="${pom.dependencies}"> + <j:forEach var="lib" items="${pom.artifacts}"> <!-- If the project has a declared dependency on jUnit, we use the specified version. --> - <j:if test="${lib.artifactId == 'junit'}" > - <j:set var="junitDependency" value="${lib}" /> + <j:if test="${lib.dependency.artifactId == 'junit'}" > + <j:set var="junitArtifact" value="${lib}" /> </j:if> - <jbuilder:generateDependencyLibrary - dependency="${lib}" + <jbuilder:generateArtifactLibrary + artifact="${lib}" userHome="${jbUserHome}" libraryList="libraries" verbose="${maven.jbuilder.verbose}" /> </j:forEach> + <!-- TODO: temporary --> + <j:set var="testDependencies" value="${maven.jbuilder.testDependencies}" /> + <j:if test="${testDependencies != null and !testDependencies.isEmpty()}"> + <ant:fail> + maven.jbuilder.testDependencies must be replaced with + maven.jbuilder.testArtifacts, using artifacts instead of dependencies + </ant:fail> + </j:if> <!-- Convert each supplemental test dependency into a required library. --> - <j:forEach var="lib" items="${maven.jbuilder.testDependencies}"> + <j:forEach var="lib" items="${maven.jbuilder.testArtifacts}"> <!-- If the project has no declared dependency on jUnit, but a supplemental test dependency does, we use the version specified by the test dependency. --> <j:choose> - <j:when test="${lib.artifactId == 'junit'}" > - <j:if test="${junitDependency == null}"> - <j:set var="junitDependency" value="${lib}" /> - <jbuilder:generateDependencyLibrary - dependency="${lib}" + <j:when test="${lib.dependency.artifactId == 'junit'}" > + <j:if test="${junitArtifact == null}"> + <j:set var="junitArtifact" value="${lib}" /> + <jbuilder:generateArtifactLibrary + artifact="${lib}" userHome="${jbUserHome}" libraryList="libraries" verbose="${maven.jbuilder.verbose}" /> </j:if> </j:when> <j:otherwise> - <jbuilder:generateDependencyLibrary - dependency="${lib}" + <jbuilder:generateArtifactLibrary + artifact="${lib}" userHome="${jbUserHome}" libraryList="libraries" verbose="${maven.jbuilder.verbose}" /> @@ -358,15 +366,15 @@ </j:forEach> <!-- Finally, if there are unit tests and we still do not have a specific dependency on jUnit, use the version from the test plugin. --> - <j:if test="${unitTestSourcesPresent and junitDependency == null}" > + <j:if test="${unitTestSourcesPresent and junitArtifact == null}" > <!-- This goal forces the test plugin to be loaded. TODO: In Maven beta 9, use the special test:eclipse tag instead. --> <attainGoal name="test:prepare-filesystem" /> <j:set - var="junitDependency" - value="${pom.getPluginContext('maven-test-plugin').getVariable('plugin').getDependency('junit')}" /> - <jbuilder:generateDependencyLibrary - dependency="${junitDependency}" + var="junitArtifact" + value="${pom.getPluginContext('maven-test-plugin').getVariable('plugin').getArtifact('junit')}" /> + <jbuilder:generateArtifactLibrary + artifact="${junitArtifact}" userHome="${jbUserHome}" libraryList="libraries" verbose="${maven.jbuilder.verbose}" /> @@ -471,9 +479,9 @@ project="${pom}" userHome="${jbUserHome}" /> - <j:forEach var="lib" items="${pom.dependencies}"> - <jbuilder:generateDependencyLibrary - dependency="${lib}" + <j:forEach var="lib" items="${pom.artifacts}"> + <jbuilder:generateArtifactLibrary + artifact="${lib}" userHome="${jbUserHome}" verbose="${maven.jbuilder.verbose}" /> </j:forEach> 1.4 +3 -3 maven/src/plugins-build/jbuilder/plugin.properties Index: plugin.properties =================================================================== RCS file: /home/cvs/maven/src/plugins-build/jbuilder/plugin.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- plugin.properties 29 Jul 2003 11:07:41 -0000 1.3 +++ plugin.properties 20 Aug 2003 12:42:37 -0000 1.4 @@ -15,13 +15,13 @@ # plugin will be used. #maven.jbuilder.docpath = ${maven.build.dir}/jbuilder-doc -# Optional list of test dependencies. The list must be an instance of +# Optional list of test artifacts. The list must be an instance of # java.util.List and each element of the list must be an instance of -# org.apache.maven.project.Dependency. Therefore, this variable technically +# org.apache.maven.repository.Artifact. Therefore, this variable technically # cannot be initialized in a properties file, it must be initialized via jelly # code. It is listed here for documentation purposes. In general, the test # dependencies will be project specific and should be initialized in a pre-goal. -#maven.jbuilder.testDependencies = +#maven.jbuilder.testArtifacts = # Optional source paths for libraries that refer to versioned jars in the local # repository. In general, these will be user specific and should go in
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]