You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marco Sandrini <ne...@gmail.com> on 2008/03/18 17:33:56 UTC

Profiles and Dependencies in Maven ANT Task

Hi!

I know that the attribute profiles in task artifact:dependencies is not yet
supported. I was though wondering is there a mechanism to specify the
correct property/ies in the rest of the ant file so that the correct profile
would be picked up by the dependency task.

In other words I'd like to have in my build.xml

<property name="myprop" value="true"/>

and in pom.xml

.....
<profile>
  <id>additional_dependency_profile</id>
  <activation>
     <property>
         <name>myprop</name>
          <value>true</value>
     </property>
  </activation>
  <dependencies>
      .... extra dependencies here
   </dependencies>
</profile>

I noticed that setting a profile to activeByDefault works, i.e. the
dependency task picks up the extra dependencies defined in the profile, but,
as said, I could not make the property-activated profile do my bidding.

Thanks in advance for your help,

regards,
Marco Sandrini 
-- 
View this message in context: http://www.nabble.com/Profiles-and-Dependencies-in-Maven-ANT-Task-tp16125102s177p16125102.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Profiles and Dependencies in Maven ANT Task

Posted by Marco Sandrini <ne...@gmail.com>.
Hi Cody,

I have forgot to mention that the main build is still done with ant and
maven-ant-tasks are used to resolve dependencies. So, unluckily, the example
proposed does not really apply...


-- 
View this message in context: http://www.nabble.com/Profiles-and-Dependencies-in-Maven-ANT-Task-tp16125102s177p16142232.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Profiles and Dependencies in Maven ANT Task

Posted by Marco Sandrini <ne...@gmail.com>.
Hi Cody,

I have forgot to mention that the main build is still done with ant and
maven-ant-tasks are used to resolve dependencies. So, unluckily, the example
proposed does not really apply...


-- 
View this message in context: http://www.nabble.com/Profiles-and-Dependencies-in-Maven-ANT-Task-tp16125102s177p16142232.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Profiles and Dependencies in Maven ANT Task

Posted by cody zhang <co...@gmail.com>.
you can try the example:
	<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>start-hsqldb</id>
						<phase>site</phase>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<tasks>
						<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
						<if>
							<equals arg1="${unit-test}" arg2="0" />
							<then>
								<delete>
									<fileset  dir="${basedir}/target/test-classes">
										<include name="**/*.class"/>
										<exclude name="**/SignonFunTest.class"/>
									</fileset>
								</delete>
							</then>
						</if>
						<java classname="org.hsqldb.Server" fork="false">
							<arg line="-database.0 signon -dbname.0 signon"/>
							<!--classpath>
							<pathelement
path="D:\Workspace\signon-frank-google\src\main\hsqldb\hsqldb.jar"/>
						</classpath-->
					</java>
				</tasks>
			</configuration>
			<dependencies>
				<dependency>
					<groupId>ant-contrib</groupId>
					<artifactId>ant-contrib</artifactId>
					<version>1.0b2</version>
				</dependency>
				<dependency>
					<groupId>hsqldb</groupId>
					<artifactId>hsqldb</artifactId>
					<version>1.8.0.7</version>
				</dependency>
			</dependencies>
		</plugin>	

2008/3/19, Marco Sandrini <ne...@gmail.com>:
>
>  Hi!
>
>  I know that the attribute profiles in task artifact:dependencies is not yet
>  supported. I was though wondering is there a mechanism to specify the
>  correct property/ies in the rest of the ant file so that the correct profile
>  would be picked up by the dependency task.
>
>  In other words I'd like to have in my build.xml
>
>  <property name="myprop" value="true"/>
>
>  and in pom.xml
>
>  .....
>  <profile>
>   <id>additional_dependency_profile</id>
>   <activation>
>      <property>
>          <name>myprop</name>
>           <value>true</value>
>      </property>
>   </activation>
>   <dependencies>
>       .... extra dependencies here
>    </dependencies>
>  </profile>
>
>  I noticed that setting a profile to activeByDefault works, i.e. the
>  dependency task picks up the extra dependencies defined in the profile, but,
>  as said, I could not make the property-activated profile do my bidding.
>
>  Thanks in advance for your help,
>
>  regards,
>  Marco Sandrini
>
> --
>  View this message in context: http://www.nabble.com/Profiles-and-Dependencies-in-Maven-ANT-Task-tp16125102s177p16125102.html
>  Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>  For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org