jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-3426 regression : <dependency> in plugin c...
  • MNG-3780

<dependency> in plugin configuration doesn't override maven-antrun-plugin classpath

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.7, 2.0.9
  • Fix Version/s: None
  • Component/s: Plugins and Lifecycle
  • Labels:
    None
  • Environment:
    Windows XP SP2, JSDK 1.5.1_12
  • Complexity:
    Intermediate

Description

I have multimodule project, in one of the child pom files defined custom profile, which updates DB via separate Ant build file:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>populate-db</id>
<phase>process-classes</phase>
<configuration>
<tasks>
<ant antfile="${basedir}/data_build.xml" target="populate.db" inheritAll="true" inheritRefs="true">
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-parent</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
Anyway build seems to load ant 1.6.5 in parent pom file (it has some plugins, that require Ant 1.6.5), so I am getting this:

Embedded error: The following error occurred while executing this line:
data_build.xml:39: The <sql> type doesn't support the "expandproperties" attribute.

"expandproperties" attribute was added in Ant 1.7. I have no Ant 1.6 installed in my system, only jars in Maven repository. env.ANT_HOME is set to Ant 1.7, PATH variable also contains Ant 1.7.
I've tried to add any variants of the ant 1.7 packages to task dependecies with no luck.
Any ideas?

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Alex Dubrovsky added a comment - 02/Oct/08 2:55 AM

Sorry, one more add. For now I evade this issue with help of listed below block, but I suppose it's not the correct way Maven should operate:
<property environment="env"/>
<java fork="true" classname="org.apache.tools.ant.launch.Launcher" dir="${basedir}"
failonerror="true" resultproperty="result.ant.property">
<classpath>
<pathelement path="${env.ANT_HOME}/lib/ant-launcher.jar"/>
<fileset dir="${settings.localRepository}/mysql/mysql-connector-java" includes="*/.jar"/>
</classpath>
<sysproperty key="ant.home" value="${env.ANT_HOME}"/>
<arg line="-f ${basedir}/data_build.xml"/>
<arg line="populate.db"/>
</java>

Show
Alex Dubrovsky added a comment - 02/Oct/08 2:55 AM Sorry, one more add. For now I evade this issue with help of listed below block, but I suppose it's not the correct way Maven should operate: <property environment="env"/> <java fork="true" classname="org.apache.tools.ant.launch.Launcher" dir="${basedir}" failonerror="true" resultproperty="result.ant.property"> <classpath> <pathelement path="${env.ANT_HOME}/lib/ant-launcher.jar"/> <fileset dir="${settings.localRepository}/mysql/mysql-connector-java" includes="*/.jar"/> </classpath> <sysproperty key="ant.home" value="${env.ANT_HOME}"/> <arg line="-f ${basedir}/data_build.xml"/> <arg line="populate.db"/> </java>
Hide
Permalink
Joerg Schaible added a comment - 02/Oct/08 3:18 AM

Each plugin is loaded only once and can have therefore only one classpath. If you define different dependencies for a plugin in a multi-project, the first definition will found win.

Show
Joerg Schaible added a comment - 02/Oct/08 3:18 AM Each plugin is loaded only once and can have therefore only one classpath. If you define different dependencies for a plugin in a multi-project, the first definition will found win.
Hide
Permalink
Alex Dubrovsky added a comment - 02/Oct/08 3:37 AM

Joerg, Thanks a million for your help.
Strange thing, in one of the preceding child modules antrun plugin was defined, without any custom dependencies. Seems it loads Ant 1.6.5 by default, and any override in other modules does not work (a bit strange behaviour).
Build fixed when I added custom dependency to Ant 1.7 to all definitions of antrun plugin in all modules.

Show
Alex Dubrovsky added a comment - 02/Oct/08 3:37 AM Joerg, Thanks a million for your help. Strange thing, in one of the preceding child modules antrun plugin was defined, without any custom dependencies. Seems it loads Ant 1.6.5 by default, and any override in other modules does not work (a bit strange behaviour). Build fixed when I added custom dependency to Ant 1.7 to all definitions of antrun plugin in all modules.
Hide
Permalink
Alex Dubrovsky added a comment - 02/Oct/08 3:39 AM

Fixed by adding custom dependency to ant 1.7 to all definitions of antrun plugin in all project modules.

Show
Alex Dubrovsky added a comment - 02/Oct/08 3:39 AM Fixed by adding custom dependency to ant 1.7 to all definitions of antrun plugin in all project modules.
Hide
Permalink
Joerg Schaible added a comment - 02/Oct/08 5:18 AM

You could have done also by using a common parent and declare the dependencies in a pluginManagement section once.

Show
Joerg Schaible added a comment - 02/Oct/08 5:18 AM You could have done also by using a common parent and declare the dependencies in a pluginManagement section once.

People

  • Assignee:
    Unassigned
    Reporter:
    Alex Dubrovsky
Vote (0)
Watch (0)

Dates

  • Created:
    02/Oct/08 2:51 AM
    Updated:
    13/Dec/08 12:40 PM
    Resolved:
    02/Oct/08 3:39 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.