Hi John,

ok, I see what you mean: http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Can atleast <dependencies> be allowed in profiles.xml. I have a use-case where it would make sense to have them in profiles.xml.

The use-case is as follows:
Lets says I have a web-project that sets up profiles.xml for target build environments that it can be deployed on. Target environments can each have different J2EE containers.

Now this is what happens when I put my project up for builds/deploys.
1) Set up a build control project, a minimal pom.xml that has contains SCM connection to my web-project above. 2) checksout profiles.xml first so now the build control project has a minimal pom + profiles.xml.
3) checks out the web-project under ${basedir}/target
4) I can activate a particular profile, based on which some operations can be done by a custom Plugin before an embedded instance of maven is spawned and some goals (specific to that profile) are delegated down to the checked out project.

I got steps - 1, 2, 3 working and 4 working partially (delegation) but I am hitting a blocker with the profiles :-( and can't reuse them.

Would it make sense to introduce <dependencies> to external profiles.xml so these can be selectively included when a profile is activated. I would like to invite a discussion on this and see if it merits it.

Thoughts please?

Cheers,

Rahul



----- Original Message ----- From: "John Casey" <[EMAIL PROTECTED]>
To: "Maven Developers List" <dev@maven.apache.org>
Sent: Tuesday, December 20, 2005 6:01 AM
Subject: Re: [m2] Unable setup <dependencies> under <profile> (XmlPullParserException: Unrecognised tag)


You cannot specify anything but properties, repositories, and pluginRepositories (IIRC) outside of the POM itself. This is to help ensure that POMs remain portable.

Rinku wrote:
Hi , I am trying to introduce selective dependencies based on profile activation for a project, but i am encountering an exception (stacktrace below)

<snip>
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: Unrecognised tag: 'dependencies' (position: START_TAG seen ...</activation>\r\n <dependencies>... @12:19) at org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader.parseProfile(ProfilesXpp3Reader.java:577) at org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader.parseProfilesRoot(ProfilesXpp3Reader.java:617) at org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader.read(ProfilesXpp3Reader.java:1126) at org.apache.maven.profiles.DefaultMavenProfilesBuilder.buildProfiles(DefaultMavenProfilesBuilder.java:47) at org.apache.maven.project.DefaultMavenProjectBuilder.loadProjectExternalProfiles(DefaultMavenProjectBuilder.java:1013)
        ... 18 more
</snip>

Has any one tried setting up dependencies in Profiles? The profiles.xml that I am using looks as follows: <profiles>
  <profile>
    <id>tc-int</id>
    <activation>
      <property>
        <name>target</name>
        <value>tc-int</value>
      </property>
    </activation>
    <dependencies>
      <dependency>      <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-core-container-tomcat</artifactId>
      </dependency>
    </dependencies> ......
  </profile>
</profiles>

Am I missing something here? I am referring to the POM descriptor online to create profiles. Much appreciate pointers and thanks in advance for any! Cheers, Rahul

---------------------------------------------------------------------
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