Mac-Systems schrieb:
Thanks a lot,

i was able to figure out which is the exact Problem:

If i run compile the Phase will trigger the ANT Plugin.
If i run "install" for example i thought the phase "generate source" phase will executed automaticly as "install" is higher. This seems to be wrong or my ANT Plugin must be configured
different ?

Are you executing 'mvn install'? That should execute everything up to and including the install phase. Or just 'mvn install:install'? That will just execute the install goal of the install plugin and nothing else.


Phases are shown there: http://cvs.peopleware.be/training/maven/maven2/buildLifecyclePhases.html

Part from my POM:

   <build>
       <plugins>
           <!-- Aufruf des XDoclet ANT Scripts  -->
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-antrun-plugin</artifactId>
               <version>1.1</version>
                  <executions>
                     <execution>
                       <id>generate-sources</id>
                       <phase>generate-sources</phase>
                       <configuration>
                             <tasks>
<ant antfile="xdoclet_070814.xml" inheritRefs="true"/>
                             </tasks>
                       </configuration>
                   <goals>
                         <goal>run</goal>
                   </goals>
                 </execution>
           </executions>
       </plugin>


Anyone can tell be how to guaranty the phase will be exceuted ?

best regards,
Jens




Hi,

invoking 'mvn compile'

on this pom:

---
<project>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>my-test-app</artifactId>
  <groupId>my-test-group</groupId>
  <version>1.0-SNAPSHOT</version>

  <build>
    <plugins>
      <!-- Version muss spaeter im Master Pom vergeben werden -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <configuration>
              <tasks>
<property name="compile_classpath" refid="maven.compile.classpath"/> <property name="runtime_classpath" refid="maven.runtime.classpath"/> <property name="test_classpath" refid="maven.test.classpath"/> <property name="plugin_classpath" refid="maven.plugin.classpath"/>

                <echo message="compile classpath: ${compile_classpath}"/>
                <echo message="runtime classpath: ${runtime_classpath}"/>
                <echo message="test classpath:    ${test_classpath}"/>
                <echo message="plugin classpath:  ${plugin_classpath}"/>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
   </build>
</project>
---

gives this output:

---
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - my-test-group:my-test-app:jar:1.0-SNAPSHOT
[INFO]    task-segment: [compile]
[INFO] ----------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [antrun:run {execution: compile}]
[INFO] Executing tasks
[echo] compile classpath: /home/tik/Develop/maven-testprojects/anrun-test/target/classes [echo] runtime classpath: /home/tik/Develop/maven-testprojects/anrun-test/target/classes [echo] test classpath: /home/tik/Develop/maven-testprojects/anrun-test/target/classes:/home/tik/Develop/maven-testprojects/anrun-test/target/test-classes [echo] plugin classpath: /home/tik/.m2/repository/ant/ant/1.6.5/ant-1.6.5.jar:/home/tik/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar:/home/tik/.m2/repository/ant/ant-launcher/1.6.5/ant-launcher-1.6.5.jar:/opt/maven/lib/maven-core-2.0.7-uber.jar
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue Aug 21 12:43:23 CEST 2007
[INFO] Final Memory: 4M/78M
[INFO] ------------------------------------------------------------------------
---

So everything seems to work. If you have a different output please post it.

-Tim

Mac-Systems schrieb:
Hello,

may someone can give me a hint what i am doing wrong while i try to exceute
the ANT Plugin in one of my Subprojekts of a Multiprojekt.

     <build>
     <plugins>
       <!-- Version muss spaeter im Master Pom vergeben werden -->
       <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-antrun-plugin</artifactId>
           <executions>
                  <execution>
               <id>compile</id>
               <phase>compile</phase>
               <configuration>
               <tasks>
<property name="compile_classpath" refid="maven.compile.classpath"/> <property name="runtime_classpath" refid="maven.runtime.classpath"/> <property name="test_classpath" refid="maven.test.classpath"/> <property name="plugin_classpath" refid="maven.plugin.classpath"/>

<echo message="compile classpath: ${compile_classpath}"/> <echo message="runtime classpath: ${runtime_classpath}"/> <echo message="test classpath: ${test_classpath}"/> <echo message="plugin classpath: ${plugin_classpath}"/>
               </tasks>
               </configuration>
               <goals>
                     <goal>run</goal>
               </goals>
                 </execution>
           </executions>
</plugin> The Phase "Compile" should show Messages... On commandline
i do "mvn compile", but nothing gets invoked, why ?


best regards,
Jens

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


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





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


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

Reply via email to