You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Oleg Gusakov (JIRA)" <ji...@codehaus.org> on 2008/12/08 17:45:19 UTC

[jira] Created: (MERCURY-48) Document and vet the design

Document and vet the design
---------------------------

                 Key: MERCURY-48
                 URL: http://jira.codehaus.org/browse/MERCURY-48
             Project: Mercury
          Issue Type: Sub-task
            Reporter: Oleg Gusakov
            Assignee: Oleg Gusakov




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157315#action_157315 ] 

Oleg Gusakov edited comment on MERCURY-48 at 12/10/08 2:25 PM:
---------------------------------------------------------------

The proposed syntax looks like this
{code:xml|title=build.xml|borderStyle=solid}
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <merc:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve pathid="compile-path"
                            depref="my-libs"
                            configref="${config.name}"
                      />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve pathid="test-path"
                           depref="my-libs"
                           configref="${config.name}"
                           scope="test"
                        />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>

  <target name="deploy" depends="compile">
    <merc:write repoid="localRepo"
                        bin="${target}/t.jar"
                        name="t:t:1.0"
    />

  </target>
  
</project>
{code}

      was (Author: olle):
    The proposed syntax looks like this
{code:xml|title=build.xml|borderStyle=solid}
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <merc:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve pathid="compile-path"
                            depref="my-libs"
                            configref="${config.name}"
                      />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve pathid="test-path"
                           depref="my-libs"
                           configref="${config.name}"
                           scope="test"
                        />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
</project>
{code}
  
> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>          Time Spent: 1 day
>  Remaining Estimate: 1 day
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157315#action_157315 ] 

Oleg Gusakov edited comment on MERCURY-48 at 12/8/08 3:11 PM:
--------------------------------------------------------------

The proposed syntax looks like this
{code:xml|title=build.xml|borderStyle=solid}
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <mvn:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve name="resolve-compile-deps"
                 pathid="compile-path"
                 depref="my-libs"
                 configref="${config.name}"
                 />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve name="resolve-test-deps"
                 pathid="test-path"
                 depref="my-libs"
                 configref="${config.name}"
                 scope="test"
                 />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
</project>
{code}

      was (Author: olle):
    The proposed syntax looks like this
{code:xml | title=build.xml | borderStyle=solid }
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <mvn:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve name="resolve-compile-deps"
                 pathid="compile-path"
                 depref="my-libs"
                 configref="${config.name}"
                 />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve name="resolve-test-deps"
                 pathid="test-path"
                 depref="my-libs"
                 configref="${config.name}"
                 scope="test"
                 />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
</project>
{code}
  
> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157315#action_157315 ] 

Oleg Gusakov commented on MERCURY-48:
-------------------------------------

The proposed syntax looks like this
{code:xml | title=build.xml | borderStyle=solid }
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <mvn:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve name="resolve-compile-deps"
                 pathid="compile-path"
                 depref="my-libs"
                 configref="${config.name}"
                 />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve name="resolve-test-deps"
                 pathid="test-path"
                 depref="my-libs"
                 configref="${config.name}"
                 scope="test"
                 />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
</project>
{code}

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MERCURY-48) Document and vet the design

Posted by "Gilles Scokart (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157474#action_157474 ] 

Gilles Scokart commented on MERCURY-48:
---------------------------------------

Cool ! 

Just Two comments.

1.  From the tasks, it seems you are tighly coupled to maven repository (and even maven settings file).  Into your config, I think you should better ask the developer to specify somehow that he want to use a maven repository (can be in some tag name, in attribute name or value, wathever).  It will also give clear hook where to plug other type of repository (same from the settings, I guess)

2. With your API, the build will have to reexecute 2 resolution (one per scope).  I didn't looked into the source yet, but even if you can cache things, I asume they will be quiet a lot of things done twice (scaning cache, parsing pom, resolving some conflicts, etc...).  One approach to avoid that is to first make a resolve of multiple scope, and store the result in a resolutionId reference, then use 'merc:path' task (or data types) that reference this resolution.
An other aproach might be to allow to specify multiple pathId - scope as sub-tag of your merc:resolve.



> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157315#action_157315 ] 

Oleg Gusakov edited comment on MERCURY-48 at 12/8/08 3:11 PM:
--------------------------------------------------------------

The proposed syntax looks like this
{code:xml|title=build.xml|borderStyle=solid}
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <merc:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve name="resolve-compile-deps"
                 pathid="compile-path"
                 depref="my-libs"
                 configref="${config.name}"
                 />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve name="resolve-test-deps"
                 pathid="test-path"
                 depref="my-libs"
                 configref="${config.name}"
                 scope="test"
                 />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
</project>
{code}

      was (Author: olle):
    The proposed syntax looks like this
{code:xml|title=build.xml|borderStyle=solid}
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <mvn:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve name="resolve-compile-deps"
                 pathid="compile-path"
                 depref="my-libs"
                 configref="${config.name}"
                 />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve name="resolve-test-deps"
                 pathid="test-path"
                 depref="my-libs"
                 configref="${config.name}"
                 scope="test"
                 />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
</project>
{code}
  
> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157512#action_157512 ] 

Oleg Gusakov commented on MERCURY-48:
-------------------------------------

Gilles, than you for the comment!

*#1 coupling with repo*
In Mercury - Repository was re-implemented - http://docs.codehaus.org/display/MAVEN/Mercury+Repository+Abstraction, as a result - I can plug in any object, implementing Repository interface. For now there are
* RemoteM2
* LocalM2
* LocalFlat - write-only repository with one folder, holding all the artifacts

I plan to also add read-only metadata-only repository, to which you will be able to drop POMs

gem also looks like a good candidate.

All those are (will be) captured in the *type* attribute of the *repo* tag, so that *<merc:repo type="flat" dir="/opt/plugins" id="local-store"/>* will map into it's own implementation. n the future - it will be nice to provide type->implementation mapping configuration

*#2 re-execution*
<merc:resolve /> is equivalent to <path />, it does create a named path or appends to the existing one (if you use *refpathid* instead of *pathid*) as a result of it's execution. I fails it if *pathId* already exists, so idea would be to place it so that it executes once. Treat it almost as a data type, and place so that it executes once.

Does it work ?

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157512#action_157512 ] 

Oleg Gusakov edited comment on MERCURY-48 at 12/9/08 6:22 PM:
--------------------------------------------------------------

Gilles, than you for the comment!

*#1 coupling with repo*
In Mercury - Repository was re-implemented - http://docs.codehaus.org/display/MAVEN/Mercury+Repository+Abstraction, as a result - I can plug in any object, implementing Repository interface. For now there are
* RemoteM2
* LocalM2
* LocalFlat - write-only repository with one folder, holding all the artifacts

I plan to also add read-only metadata-only repository, to which you will be able to drop POMs

gem also looks like a good candidate.

All those are (will be) captured in the *type* attribute of the *repo* tag, so that *<merc:repo type="flat" dir="/opt/plugins" id="local-store"/>* will map into it's own implementation. In the future - it will be nice to provide type->implementation mapping configuration

*#2 re-execution*
<merc:resolve /> is equivalent to <path />, it does create a named path or appends to the existing one (if you use *refpathid* instead of *pathid*) as a result of it's execution. I fails it if *pathId* already exists, so idea would be to place it so that it executes once. Treat it almost as a data type, and place so that it executes once.

Does it work ?

      was (Author: olle):
    Gilles, than you for the comment!

*#1 coupling with repo*
In Mercury - Repository was re-implemented - http://docs.codehaus.org/display/MAVEN/Mercury+Repository+Abstraction, as a result - I can plug in any object, implementing Repository interface. For now there are
* RemoteM2
* LocalM2
* LocalFlat - write-only repository with one folder, holding all the artifacts

I plan to also add read-only metadata-only repository, to which you will be able to drop POMs

gem also looks like a good candidate.

All those are (will be) captured in the *type* attribute of the *repo* tag, so that *<merc:repo type="flat" dir="/opt/plugins" id="local-store"/>* will map into it's own implementation. n the future - it will be nice to provide type->implementation mapping configuration

*#2 re-execution*
<merc:resolve /> is equivalent to <path />, it does create a named path or appends to the existing one (if you use *refpathid* instead of *pathid*) as a result of it's execution. I fails it if *pathId* already exists, so idea would be to place it so that it executes once. Treat it almost as a data type, and place so that it executes once.

Does it work ?
  
> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MERCURY-48) Document and vet the design

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157957#action_157957 ] 

Herve Boutemy commented on MERCURY-48:
--------------------------------------

here are my feelings about the proposed syntax:

- {{config}}
. to be consistent with [settings|http://maven.apache.org/ref/current/maven-settings/settings.html], I think {{localRepository}} and {{repository}} would be better than {{repo}}
. and {{layout}} instead of {{type}}, exactly for the same reason
. why no {{settings}} instead of {{config}}?

- {{dep}}
. {{dependencies}} would be better than {{dep}} IMHO, to be consistent with [pom|http://maven.apache.org/ref/current/maven-model/maven.html]
. I think you meant {{dep pom="${basedir}/pom.xml"}} instead of {{dependency pom=...}}: {{pom}} and {{dependency}} are mutually exclusive
. I don't understand the meaning of {{xmlns}} attribute of {{dependency}}
. adding classic {{groupId}}/{{artifactId}}/{{version}}/{{type}}/{{scope}} coordinates, mutually exlusive with {{name}}, would let people choose the syntax they prefer

- {{resolve}}
. ok with {{pathid}} instead of {{pathId}}: this is consistent with Ant conventions

- {{write}}
. sould support {{pom}} attribute, mutually exclusive with {{name}}
. I'd prefer {{file}} instead of {{bin}}, since it's the name used by Maven Ant Tasks and I don't find {{bin}} really expressive
. I suppose {{attach}} is scheduled for a later update

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>          Time Spent: 1 day
>  Remaining Estimate: 1 day
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Work logged: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#action_112645 ]

Oleg Gusakov logged work on MERCURY-48:
---------------------------------------

                Author: Oleg Gusakov
            Created on: 09/Dec/08 11:00 PM
            Start Date: 09/Dec/08 08:00 AM
    Worklog Time Spent: 1 day 

Issue Time Tracking
-------------------

            Time Spent: 1 day
    Remaining Estimate: 1 day  (was: 2 days)

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>          Time Spent: 1 day
>  Remaining Estimate: 1 day
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Gusakov updated MERCURY-48:
--------------------------------

    Remaining Estimate: 2 days
     Original Estimate: 2 days

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Gusakov updated MERCURY-48:
--------------------------------

    Component/s: Ant tasks

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157967#action_157967 ] 

Oleg Gusakov edited comment on MERCURY-48 at 12/14/08 4:52 PM:
---------------------------------------------------------------

* *config* - I would like it to be as little maven-like, as possible, I think it should be yet another dependency management framework for ant. Usually developers are using the temr *config*,not *settings*. I don't hold on to it, we can create several syntaxes, or change this one.

* *layout* - I don't agree with this one as truely - this should be a mapping from repository id to repository implementation class. I can envision type="gem", type="cpan", etc. This also explains deviation from "local/remore" - they all are just implementations of a repository. The default one is type="m2" and that uniquely select the correct implementation. 

What could be wrong - *dir* and *url* attributes, but they seem to be generic enough for any implementation

* *dep* instead of dependencies - to make it shorter, no other ideas. Two parallel syntaxes possible

* *pom* - one <dependency ..> can define either one artifact, or a whole subtree - if it hides a pom file behind it. *This is a moot point* because - as i said - I would like to get away from Maven specifics. Mercury in general (and ant tasks inherit it) - does not depend on POM files - it defines an abstract DependencyProcessor interface, and anyone can plug in their own. This btw also explains *xmlns* - I would like to be able to interpret dependency in the context of a supplied DependencyProcessor. Maybe it should be higher up - in the <dep[endencies] ..> tag. Or - maybe - we should allow to mix-n-match

* *write* - totally agree with *file* instead of *bin*, already implemented as file.

* *attach* - can you give an example what are you trying to address? Currently one can *<write name="a:a:1.0:tests" .../>*, which is equivalent to attaching the tests classifier jar. Or you can write a zip file with *name="a:b:1.0::zip"*

The full syntax of the name is defined in Mercury as:
"groupId:artifactId:version:classifier:type:scope:{attributes}", where attributes is a comma-separated list of name=value pairs.

And - *Herve* - thank you for the comments! Don't hesitate to indicate if I mis-understand something - rarely, but it happens :)


      was (Author: olle):
    * *config* - I would like it to be as little maven-like, as possible, I think it should be yet another dependency management framework for ant. Usually developers are using the temr *config*,not *settings*. I don't hold on to it, we can create several syntaxes, or change this one.

* *layout* - I don't agree with this one as truely - this should be a mapping from repository id to repository implementation class. I can envision type="gem", type="cpan", etc. This also explains deviation from "local/remore" - they all are just implementations of a repository. The default one is type="m2" and that uniquely select the correct implementation. 

What could be wrong - *dir* and *url* attributes, but they seem to be generic enough for any implementation

* *dep* instead of dependencies - to make it shorter, no other ideas. Two parallel syntaxes possible

* *pom* - one <dependency ..> can define either one artifact, or a whole subtree - if it hides a pom file behind it. *This is a moot point* because - as i said - I would like to get away from Maven specifics. Mercury in general (and ant tasks inherit it) - does not depend on POM files - it defines an abstract DependencyProcessor interface, and anyone can plug in their own. This btw also explains *xmlns* - I would like to be able to interpret dependency in the context of a supplied DependencyProcessor. Maybe it should be higher up - in the <dep[endencies] ..> tag. Or - maybe - we should allow to mix-n-match

* *write* - totally agree with *file* instead of *bin*, already implemented as file.

* *attach* - can you give an example what are you trying to address? Currently one can *<write name="a:a:1.0:tests" .../>*, which is equivalent to attaching the tests classifier jar. Or you can write a zip file with *name="a:b:1.0::zip"*

The full syntax of the name is defined in Mercury as:
"groupId:artifactId:version:classifier:type:scope:{attributes}", where attributes is a comma-separated list of name=value pairs.
  
> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>          Time Spent: 1 day
>  Remaining Estimate: 1 day
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157967#action_157967 ] 

Oleg Gusakov commented on MERCURY-48:
-------------------------------------

* *config* - I would like it to be as little maven-like, as possible, I think it should be yet another dependency management framework for ant. Usually developers are using the temr *config*,not *settings*. I don't hold on to it, we can create several syntaxes, or change this one.

* *layout* - I don't agree with this one as truely - this should be a mapping from repository id to repository implementation class. I can envision type="gem", type="cpan", etc. This also explains deviation from "local/remore" - they all are just implementations of a repository. The default one is type="m2" and that uniquely select the correct implementation. 

What could be wrong - *dir* and *url* attributes, but they seem to be generic enough for any implementation

* *dep* instead of dependencies - to make it shorter, no other ideas. Two parallel syntaxes possible

* *pom* - one <dependency ..> can define either one artifact, or a whole subtree - if it hides a pom file behind it. *This is a moot point* because - as i said - I would like to get away from Maven specifics. Mercury in general (and ant tasks inherit it) - does not depend on POM files - it defines an abstract DependencyProcessor interface, and anyone can plug in their own. This btw also explains *xmlns* - I would like to be able to interpret dependency in the context of a supplied DependencyProcessor. Maybe it should be higher up - in the <dep[endencies] ..> tag. Or - maybe - we should allow to mix-n-match

* *write* - totally agree with *file* instead of *bin*, already implemented as file.

* *attach* - can you give an example what are you trying to address? Currently one can *<write name="a:a:1.0:tests" .../>*, which is equivalent to attaching the tests classifier jar. Or you can write a zip file with *name="a:b:1.0::zip"*

The full syntax of the name is defined in Mercury as:
"groupId:artifactId:version:classifier:type:scope:{attributes}", where attributes is a comma-separated list of name=value pairs.

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>          Time Spent: 1 day
>  Remaining Estimate: 1 day
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Gusakov closed MERCURY-48.
-------------------------------

    Resolution: Fixed

Done

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157315#action_157315 ] 

Oleg Gusakov edited comment on MERCURY-48 at 12/8/08 3:15 PM:
--------------------------------------------------------------

The proposed syntax looks like this
{code:xml|title=build.xml|borderStyle=solid}
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <merc:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve pathid="compile-path"
                            depref="my-libs"
                            configref="${config.name}"
                      />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve pathid="test-path"
                           depref="my-libs"
                           configref="${config.name}"
                           scope="test"
                        />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
</project>
{code}

      was (Author: olle):
    The proposed syntax looks like this
{code:xml|title=build.xml|borderStyle=solid}
<project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" >
	
	<!--
	    this example does not include <merc:write .../> task, which 
	    will be used to install / deploy artifacts into repositories
	    nor this example show how to configure artifact 
	     validation - for the sake of simplicity
	-->

  <target name="init">
    <property name="config.name" value="home-config"/>
    <property name="java.version" value="1.5"/>
    
    <property name="src" value="${basedir}/src/main/java"/>
    <property name="target" value="${basedir}/target/classes"/>
    
    <property name="test.src" value="${basedir}/src/test/java"/>
    <property name="test.target" value="${basedir}/target/test-classes"/>
  
    <!--
     | configration: repositories, ?possibly profiles 
     -->
    <merc:config id="work-config">

    	<!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of explicit m2 type -->   
      <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/>
    	
    </merc:config>

    <merc:config id="home-config">

      <!-- local repo (indicated by dir) of default type -->   
      <merc:repo id="localRepo" dir="/app/maven.repo"/>

      <!-- remote repo (indicated by url) of default type (m2) -->   
      <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/>

    </merc:config>

  	<!--
  	 | another way to get configuration
  	 |   to be implemented later on
  	 --> 
    <merc:config id="demo-config" file="~/.m2/settings.xml"/>
  	
  
    <!--
     | dependency sets, identified and referred to by id - path-like structure declarations
     -->
    <merc:dep id="my-libs">
    	
      <!-- coordinates as string, explicit default namespace  -->
      <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/>
    	
      <!-- 
       | a set of dependencies from a pom
       |  
       |    will be implemented last as mercury does not know
       |    about POMs - this will be a special read-only repository type   
      -->
      <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/>
    	
    </merc:dep>

  </target>

  <target name="compile" depends="init">
  	<!--
  	 | this is the workhorse task - creates a classpath named "compile-path"
  	 |  and adds all the transitive dependencies from "my-libs" in compile scope 
  	-->
    <merc:resolve name="resolve-compile-deps"
                 pathid="compile-path"
                 depref="my-libs"
                 configref="${config.name}"
                 />
    
    <javac srcdir="${src}"
           destdir="${target}"
           classpathref="compile-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
  <target name="compile-tests" depends="compile">  
    <!--
     | this is the workhorse task - creates a classpath named "test-path"
     |  and adds all the transitive dependencies from "my-libs" in test scope 
    -->
    <merc:resolve name="resolve-test-deps"
                 pathid="test-path"
                 depref="my-libs"
                 configref="${config.name}"
                 scope="test"
                 />
    
    <javac srcdir="${test.src}"
           destdir="${test.target}"
           classpathref="test-path"
           debug="on"
           source="${java.version}"
    />
  </target>
  
</project>
{code}
  
> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Work started: (MERCURY-48) Document and vet the design

Posted by "Oleg Gusakov (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on MERCURY-48 started by Oleg Gusakov.

> Document and vet the design
> ---------------------------
>
>                 Key: MERCURY-48
>                 URL: http://jira.codehaus.org/browse/MERCURY-48
>             Project: Mercury
>          Issue Type: Sub-task
>          Components: Ant tasks
>            Reporter: Oleg Gusakov
>            Assignee: Oleg Gusakov
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira