You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Aaron Zeckoski <aa...@vt.edu> on 2007/11/14 18:02:58 UTC

triggering profiles without using command line and without running the default profile?

I need to be able to trigger a specific profile WITHOUT executing the
default profile AND without having to use the -P command line option.
Ideally I want to trigger it using some setting in a POM file but any
method where the user who is building the code can still type "mvn
clean build" is fine.

Can anyone help?
Thanks
-AZ


-- 
Aaron Zeckoski (aaronz@vt.edu)
Senior Research Engineer - CARET - Cambridge University
[http://bugs.sakaiproject.org/confluence/display/~aaronz/]
Sakai Fellow - [http://aaronz-sakai.blogspot.com/]

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


Re: triggering profiles without using command line and without running the default profile?

Posted by Roland Asmann <Ro...@cfc.at>.
I'm afraid that combination will not work. Worst case scenario: you define two 
the same profiles, one that is activated when the property is not set, the 
other when it has the value 'core'.


On Thursday 15 November 2007 12:13, Aaron Zeckoski wrote:
> We do need a way to have a default profile OR simply a way so that
> each project can be built using "mvn clean install" and still work
> without the base. I also wanted to have it able to run when the same
> property is set a certain way as well.
>
> In other words, if the property is set to core then the default
> profile should run and if no properties are set ("mvn clean install")
> then the default profile should still run.
>
> For example:
> <profile>
> <!--  default profile for sakai core -->
>   <id>sakai</id>
>   <activation>
>     <activeByDefault>true</activeByDefault>
>   <property>
>     <name>sakai.distribution</name>
>     <value>core</value>
>   </property>
>   </activation>
> <modules>
>   <module>alias-api/api</module>
>   <module>alias-impl/impl</module>
>   <module>alias-impl/pack</module>
>   <module>alias-tool/tool</module>
>   </modules>
>   </profile>
> <profile>
>
> Is it possible to combine them and have come up with something like
> this? (probably not)
> <activation>
>   <property>
>     <name>sakai.distribution</name>
>     <value>core</value>
>   </property>
>   <property>
>     <name>!sakai.distribution</name>
>   </property>
> </activation>
>
> I will experiment a bit and see what happens.
> Thanks!
> -AZ
>
> On Nov 15, 2007 10:51 AM, Roland Asmann <Ro...@cfc.at> wrote:
> > Do you need the default-profile? If not, remove the tag
> > 'activateByDefault'.
> >
> > Or you can try setting it to run when your property is NOT set/a certain
> > value is NOT set:
> >
> > <property>
> >  <name>!property</name>
> > </property>
> >
> > or
> >
> > <property>
> >  <name>property</name>
> >  <value>!value</value>
> > </property>
> >
> > On Wednesday 14 November 2007 23:29, Aaron Zeckoski wrote:
> > > Yes... I did that. This is not a newbie question (though I wish it
> > > were). The default profile is still running unless I do something like
> > > "mvn install -Pkernel"
> > >
> > > Here are the poms:
> > > Parent: https://source.sakaiproject.org/contrib/caret/kernel/pom.xml
> > > (this sets a property)
> > > Project:
> > > https://source.sakaiproject.org/contrib/caret/kernel/alias/pom.xml
> > > (this one has the default profile getting activated even though another
> > > profile is activated via a property)
> > >
> > > So, the question is, how do I get the same effect as running "mvn
> > > install -Pkernel" (which is to not run the default profile anymore and
> > > only run the profile that I wanted)?
> > >
> > > -AZ
> > >
> > > On Nov 14, 2007 5:40 PM, Roland Asmann <Ro...@cfc.at> wrote:
> > > > Check the profile-documentation and use the property-activation.
> > > >
> > > > On Wednesday 14 November 2007 18:02, Aaron Zeckoski wrote:
> > > > > I need to be able to trigger a specific profile WITHOUT executing
> > > > > the default profile AND without having to use the -P command line
> > > > > option. Ideally I want to trigger it using some setting in a POM
> > > > > file but any method where the user who is building the code can
> > > > > still type "mvn clean build" is fine.
> > > > >
> > > > > Can anyone help?
> > > > > Thanks
> > > > > -AZ
> > > >
> > > > --
> > > > Roland Asmann
> > > >
> > > > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > > > Bäckerstrasse 1/2/7
> > > > A-1010 Wien
> > > > FN 266155f, Handelsgericht Wien
> > > >
> > > > Tel.: +43/1/513 88 77 - 27
> > > > Fax.: +43/1/513 88 62
> > > > Email: Roland.Asmann@cfc.at
> > > > Web: www.cfc.at
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> >
> > --
> > Roland Asmann
> >
> > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > Bäckerstrasse 1/2/7
> > A-1010 Wien
> > FN 266155f, Handelsgericht Wien
> >
> > Tel.: +43/1/513 88 77 - 27
> > Fax.: +43/1/513 88 62
> > Email: Roland.Asmann@cfc.at
> > Web: www.cfc.at
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

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


Re: triggering profiles without using command line and without running the default profile?

Posted by Roland Asmann <Ro...@cfc.at>.
If this triggers the same exception, add the tool-project shortly, just to 
make sure you can run this command!


On Thursday 15 November 2007 15:08, Roland Asmann wrote:
> Run 'mvn help:active-profiles' to see which profiles are activated. Seems
> like the property is not handed down or something...
>
> On Thursday 15 November 2007 14:18, Aaron Zeckoski wrote:
> > OK, when I use this and run "mvn clean install"
> >    <profiles>
> >       <profile>
> >          <!-- default profile for sakai core-->
> >          <id>sakai</id>
> >          <activation>
> >             <property>
> >                <name>!sakai.distribution</name>
> >             </property>
> >          </activation>
> >          <modules>
> >             <module>alias-api/api</module>
> >             <module>alias-impl/impl</module>
> >             <module>alias-impl/pack</module>
> >             <module>alias-tool/tool</module>
> >          </modules>
> >       </profile>
> >       <profile>
> >          <!-- kernel (services + utils only) -->
> >          <id>kernel</id>
> >          <activation>
> >             <property>
> >                <name>sakai.distribution</name>
> >                <value>kernel</value>
> >             </property>
> >          </activation>
> >          <modules>
> >             <module>alias-api/api</module>
> >             <module>alias-impl/impl</module>
> >             <module>alias-impl/pack</module>
> >          </modules>
> >       </profile>
> > ...
> >
> > I get the following error (see below). I am not confused about what
> > the error is. That is perfectly clear. I AM confused about why it is
> > happening. That "tool" bit is only defined in the top profile and the
> > property IS set in the base POM (where the mvn is being run) to cause
> > that NOT to run like so:
> >    <properties>
> >       <sakai.distribution>kernel</sakai.distribution>
> >    </properties>
> >
> > Any ideas?
> > -AZ
> >
> >
> > [INFO] Error building POM (may not be this project's POM).
> > Project ID: unknown
> > Reason: Could not find the model file
> > '/opt/kernel/alias/alias-tool/tool/pom.xml'. for project unknown
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Trace
> > org.apache.maven.reactor.MavenExecutionException: Could not find the
> > model file '/opt/kernel/alias/alias-tool/tool/pom.xml'. for project
> > unknown
> >         at
> > org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378) at
> > org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:290) at
> > org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at
> > org.apache.maven.cli.MavenCli.main(MavenCli.java:280) at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> >:3 9) at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
> >mp l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
> >         at
> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at
> > org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at
> > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at
> > org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by:
> > org.apache.maven.project.ProjectBuildingException: Could not find the
> > model file '/opt/kernel/alias/alias-tool/tool/pom.xml'. for project
> > unknown at
> > org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMave
> >nP rojectBuilder.java:1383) at
> > org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileIn
> >te rnal(DefaultMavenProjectBuilder.java:477) at
> > org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenPro
> >je ctBuilder.java:200) at
> > org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:553) at
> > org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:467) at
> > org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:527) at
> > org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:527) at
> > org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:364) ... 11
> > more
> > Caused by: java.io.FileNotFoundException:
> > /opt/kernel/alias/alias-tool/tool/pom.xml (No such file or directory)
> >         at java.io.FileInputStream.open(Native Method)
> >         at java.io.FileInputStream.<init>(FileInputStream.java:106)
> >         at java.io.FileReader.<init>(FileReader.java:55)
> >         at
> > org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMave
> >nP rojectBuilder.java:1378) ... 18 more
> >
> > On Nov 15, 2007 10:51 AM, Roland Asmann <Ro...@cfc.at> wrote:
> > > Do you need the default-profile? If not, remove the tag
> > > 'activateByDefault'.
> > >
> > > Or you can try setting it to run when your property is NOT set/a
> > > certain value is NOT set:
> > >
> > > <property>
> > >   <name>!property</name>
> > > </property>
> > >
> > > or
> > >
> > > <property>
> > >   <name>property</name>
> > >   <value>!value</value>
> > > </property>
> > >
> > > On Wednesday 14 November 2007 23:29, Aaron Zeckoski wrote:
> > > > Yes... I did that. This is not a newbie question (though I wish it
> > > > were). The default profile is still running unless I do something
> > > > like "mvn install -Pkernel"
> > > >
> > > > Here are the poms:
> > > > Parent: https://source.sakaiproject.org/contrib/caret/kernel/pom.xml
> > > > (this sets a property)
> > > > Project:
> > > > https://source.sakaiproject.org/contrib/caret/kernel/alias/pom.xml
> > > > (this one has the default profile getting activated even though
> > > > another profile is activated via a property)
> > > >
> > > > So, the question is, how do I get the same effect as running "mvn
> > > > install -Pkernel" (which is to not run the default profile anymore
> > > > and only run the profile that I wanted)?
> > > >
> > > > -AZ
> > > >
> > > > On Nov 14, 2007 5:40 PM, Roland Asmann <Ro...@cfc.at> wrote:
> > > > > Check the profile-documentation and use the property-activation.
> > > > >
> > > > > On Wednesday 14 November 2007 18:02, Aaron Zeckoski wrote:
> > > > > > I need to be able to trigger a specific profile WITHOUT executing
> > > > > > the default profile AND without having to use the -P command line
> > > > > > option. Ideally I want to trigger it using some setting in a POM
> > > > > > file but any method where the user who is building the code can
> > > > > > still type "mvn clean build" is fine.
> > > > > >
> > > > > > Can anyone help?
> > > > > > Thanks
> > > > > > -AZ
> > > > >
> > > > > --
> > > > > Roland Asmann
> > > > >
> > > > > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > > > > Bäckerstrasse 1/2/7
> > > > > A-1010 Wien
> > > > > FN 266155f, Handelsgericht Wien
> > > > >
> > > > > Tel.: +43/1/513 88 77 - 27
> > > > > Fax.: +43/1/513 88 62
> > > > > Email: Roland.Asmann@cfc.at
> > > > > Web: www.cfc.at
> > > > >
> > > > > -------------------------------------------------------------------
> > > > >-- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For
> > > > > additional commands, e-mail: users-help@maven.apache.org
> > >
> > > --
> > > Roland Asmann
> > >
> > > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > > Bäckerstrasse 1/2/7
> > > A-1010 Wien
> > > FN 266155f, Handelsgericht Wien
> > >
> > > Tel.: +43/1/513 88 77 - 27
> > > Fax.: +43/1/513 88 62
> > > Email: Roland.Asmann@cfc.at
> > > Web: www.cfc.at
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

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


Re: triggering profiles without using command line and without running the default profile?

Posted by Roland Asmann <Ro...@cfc.at>.
Run 'mvn help:active-profiles' to see which profiles are activated. Seems like 
the property is not handed down or something...


On Thursday 15 November 2007 14:18, Aaron Zeckoski wrote:
> OK, when I use this and run "mvn clean install"
>    <profiles>
>       <profile>
>          <!-- default profile for sakai core-->
>          <id>sakai</id>
>          <activation>
>             <property>
>                <name>!sakai.distribution</name>
>             </property>
>          </activation>
>          <modules>
>             <module>alias-api/api</module>
>             <module>alias-impl/impl</module>
>             <module>alias-impl/pack</module>
>             <module>alias-tool/tool</module>
>          </modules>
>       </profile>
>       <profile>
>          <!-- kernel (services + utils only) -->
>          <id>kernel</id>
>          <activation>
>             <property>
>                <name>sakai.distribution</name>
>                <value>kernel</value>
>             </property>
>          </activation>
>          <modules>
>             <module>alias-api/api</module>
>             <module>alias-impl/impl</module>
>             <module>alias-impl/pack</module>
>          </modules>
>       </profile>
> ...
>
> I get the following error (see below). I am not confused about what
> the error is. That is perfectly clear. I AM confused about why it is
> happening. That "tool" bit is only defined in the top profile and the
> property IS set in the base POM (where the mvn is being run) to cause
> that NOT to run like so:
>    <properties>
>       <sakai.distribution>kernel</sakai.distribution>
>    </properties>
>
> Any ideas?
> -AZ
>
>
> [INFO] Error building POM (may not be this project's POM).
> Project ID: unknown
> Reason: Could not find the model file
> '/opt/kernel/alias/alias-tool/tool/pom.xml'. for project unknown
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.reactor.MavenExecutionException: Could not find the
> model file '/opt/kernel/alias/alias-tool/tool/pom.xml'. for project
> unknown
>         at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:290)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at
> org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at
> org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by:
> org.apache.maven.project.ProjectBuildingException: Could not find the model
> file '/opt/kernel/alias/alias-tool/tool/pom.xml'. for project unknown
>         at
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenP
>rojectBuilder.java:1383) at
> org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInte
>rnal(DefaultMavenProjectBuilder.java:477) at
> org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProje
>ctBuilder.java:200) at
> org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:553) at
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:467) at
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:527) at
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:527) at
> org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:364) ... 11
> more
> Caused by: java.io.FileNotFoundException:
> /opt/kernel/alias/alias-tool/tool/pom.xml (No such file or directory)
>         at java.io.FileInputStream.open(Native Method)
>         at java.io.FileInputStream.<init>(FileInputStream.java:106)
>         at java.io.FileReader.<init>(FileReader.java:55)
>         at
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenP
>rojectBuilder.java:1378) ... 18 more
>
> On Nov 15, 2007 10:51 AM, Roland Asmann <Ro...@cfc.at> wrote:
> > Do you need the default-profile? If not, remove the tag
> > 'activateByDefault'.
> >
> > Or you can try setting it to run when your property is NOT set/a certain
> > value is NOT set:
> >
> > <property>
> >   <name>!property</name>
> > </property>
> >
> > or
> >
> > <property>
> >   <name>property</name>
> >   <value>!value</value>
> > </property>
> >
> > On Wednesday 14 November 2007 23:29, Aaron Zeckoski wrote:
> > > Yes... I did that. This is not a newbie question (though I wish it
> > > were). The default profile is still running unless I do something like
> > > "mvn install -Pkernel"
> > >
> > > Here are the poms:
> > > Parent: https://source.sakaiproject.org/contrib/caret/kernel/pom.xml
> > > (this sets a property)
> > > Project:
> > > https://source.sakaiproject.org/contrib/caret/kernel/alias/pom.xml
> > > (this one has the default profile getting activated even though another
> > > profile is activated via a property)
> > >
> > > So, the question is, how do I get the same effect as running "mvn
> > > install -Pkernel" (which is to not run the default profile anymore and
> > > only run the profile that I wanted)?
> > >
> > > -AZ
> > >
> > > On Nov 14, 2007 5:40 PM, Roland Asmann <Ro...@cfc.at> wrote:
> > > > Check the profile-documentation and use the property-activation.
> > > >
> > > > On Wednesday 14 November 2007 18:02, Aaron Zeckoski wrote:
> > > > > I need to be able to trigger a specific profile WITHOUT executing
> > > > > the default profile AND without having to use the -P command line
> > > > > option. Ideally I want to trigger it using some setting in a POM
> > > > > file but any method where the user who is building the code can
> > > > > still type "mvn clean build" is fine.
> > > > >
> > > > > Can anyone help?
> > > > > Thanks
> > > > > -AZ
> > > >
> > > > --
> > > > Roland Asmann
> > > >
> > > > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > > > Bäckerstrasse 1/2/7
> > > > A-1010 Wien
> > > > FN 266155f, Handelsgericht Wien
> > > >
> > > > Tel.: +43/1/513 88 77 - 27
> > > > Fax.: +43/1/513 88 62
> > > > Email: Roland.Asmann@cfc.at
> > > > Web: www.cfc.at
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> >
> > --
> > Roland Asmann
> >
> > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > Bäckerstrasse 1/2/7
> > A-1010 Wien
> > FN 266155f, Handelsgericht Wien
> >
> > Tel.: +43/1/513 88 77 - 27
> > Fax.: +43/1/513 88 62
> > Email: Roland.Asmann@cfc.at
> > Web: www.cfc.at
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

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


Re: triggering profiles without using command line and without running the default profile?

Posted by Aaron Zeckoski <aa...@vt.edu>.
We do need a way to have a default profile OR simply a way so that
each project can be built using "mvn clean install" and still work
without the base. I also wanted to have it able to run when the same
property is set a certain way as well.

In other words, if the property is set to core then the default
profile should run and if no properties are set ("mvn clean install")
then the default profile should still run.

For example:
<profile>
<!--  default profile for sakai core -->
  <id>sakai</id>
  <activation>
    <activeByDefault>true</activeByDefault>
  <property>
    <name>sakai.distribution</name>
    <value>core</value>
  </property>
  </activation>
<modules>
  <module>alias-api/api</module>
  <module>alias-impl/impl</module>
  <module>alias-impl/pack</module>
  <module>alias-tool/tool</module>
  </modules>
  </profile>
<profile>

Is it possible to combine them and have come up with something like
this? (probably not)
<activation>
  <property>
    <name>sakai.distribution</name>
    <value>core</value>
  </property>
  <property>
    <name>!sakai.distribution</name>
  </property>
</activation>

I will experiment a bit and see what happens.
Thanks!
-AZ


On Nov 15, 2007 10:51 AM, Roland Asmann <Ro...@cfc.at> wrote:
> Do you need the default-profile? If not, remove the tag 'activateByDefault'.
>
> Or you can try setting it to run when your property is NOT set/a certain value
> is NOT set:
>
> <property>
>  <name>!property</name>
> </property>
>
> or
>
> <property>
>  <name>property</name>
>  <value>!value</value>
> </property>
>
>
>
> On Wednesday 14 November 2007 23:29, Aaron Zeckoski wrote:
> > Yes... I did that. This is not a newbie question (though I wish it
> > were). The default profile is still running unless I do something like
> > "mvn install -Pkernel"
> >
> > Here are the poms:
> > Parent: https://source.sakaiproject.org/contrib/caret/kernel/pom.xml
> > (this sets a property)
> > Project: https://source.sakaiproject.org/contrib/caret/kernel/alias/pom.xml
> > (this one has the default profile getting activated even though
> > another profile is activated via a property)
> >
> > So, the question is, how do I get the same effect as running "mvn
> > install -Pkernel" (which is to not run the default profile anymore and
> > only run the profile that I wanted)?
> >
> > -AZ
> >
> > On Nov 14, 2007 5:40 PM, Roland Asmann <Ro...@cfc.at> wrote:
> > > Check the profile-documentation and use the property-activation.
> > >
> > > On Wednesday 14 November 2007 18:02, Aaron Zeckoski wrote:
> > > > I need to be able to trigger a specific profile WITHOUT executing the
> > > > default profile AND without having to use the -P command line option.
> > > > Ideally I want to trigger it using some setting in a POM file but any
> > > > method where the user who is building the code can still type "mvn
> > > > clean build" is fine.
> > > >
> > > > Can anyone help?
> > > > Thanks
> > > > -AZ
> > >
> > > --
> > > Roland Asmann
> > >
> > > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > > Bäckerstrasse 1/2/7
> > > A-1010 Wien
> > > FN 266155f, Handelsgericht Wien
> > >
> > > Tel.: +43/1/513 88 77 - 27
> > > Fax.: +43/1/513 88 62
> > > Email: Roland.Asmann@cfc.at
> > > Web: www.cfc.at
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
>
> --
> Roland Asmann
>
> CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> Bäckerstrasse 1/2/7
> A-1010 Wien
> FN 266155f, Handelsgericht Wien
>
> Tel.: +43/1/513 88 77 - 27
> Fax.: +43/1/513 88 62
> Email: Roland.Asmann@cfc.at
> Web: www.cfc.at
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Aaron Zeckoski (aaronz@vt.edu)
Senior Research Engineer - CARET - Cambridge University
[http://bugs.sakaiproject.org/confluence/display/~aaronz/]
Sakai Fellow - [http://aaronz-sakai.blogspot.com/]

Re: triggering profiles without using command line and without running the default profile?

Posted by Aaron Zeckoski <aa...@vt.edu>.
OK, when I use this and run "mvn clean install"
   <profiles>
      <profile>
         <!-- default profile for sakai core-->
         <id>sakai</id>
         <activation>
            <property>
               <name>!sakai.distribution</name>
            </property>
         </activation>
         <modules>
            <module>alias-api/api</module>
            <module>alias-impl/impl</module>
            <module>alias-impl/pack</module>
            <module>alias-tool/tool</module>
         </modules>
      </profile>
      <profile>
         <!-- kernel (services + utils only) -->
         <id>kernel</id>
         <activation>
            <property>
               <name>sakai.distribution</name>
               <value>kernel</value>
            </property>
         </activation>
         <modules>
            <module>alias-api/api</module>
            <module>alias-impl/impl</module>
            <module>alias-impl/pack</module>
         </modules>
      </profile>
...

I get the following error (see below). I am not confused about what
the error is. That is perfectly clear. I AM confused about why it is
happening. That "tool" bit is only defined in the top profile and the
property IS set in the base POM (where the mvn is being run) to cause
that NOT to run like so:
   <properties>
      <sakai.distribution>kernel</sakai.distribution>
   </properties>

Any ideas?
-AZ


[INFO] Error building POM (may not be this project's POM).
Project ID: unknown
Reason: Could not find the model file
'/opt/kernel/alias/alias-tool/tool/pom.xml'. for project unknown
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Could not find the
model file '/opt/kernel/alias/alias-tool/tool/pom.xml'. for project
unknown
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:290)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Could
not find the model file '/opt/kernel/alias/alias-tool/tool/pom.xml'.
for project unknown
        at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1383)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:477)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:553)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:467)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:527)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:527)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:364)
        ... 11 more
Caused by: java.io.FileNotFoundException:
/opt/kernel/alias/alias-tool/tool/pom.xml (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at java.io.FileReader.<init>(FileReader.java:55)
        at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1378)
        ... 18 more



On Nov 15, 2007 10:51 AM, Roland Asmann <Ro...@cfc.at> wrote:
> Do you need the default-profile? If not, remove the tag 'activateByDefault'.
>
> Or you can try setting it to run when your property is NOT set/a certain value
> is NOT set:
>
> <property>
>   <name>!property</name>
> </property>
>
> or
>
> <property>
>   <name>property</name>
>   <value>!value</value>
> </property>
>
>
>
> On Wednesday 14 November 2007 23:29, Aaron Zeckoski wrote:
> > Yes... I did that. This is not a newbie question (though I wish it
> > were). The default profile is still running unless I do something like
> > "mvn install -Pkernel"
> >
> > Here are the poms:
> > Parent: https://source.sakaiproject.org/contrib/caret/kernel/pom.xml
> > (this sets a property)
> > Project: https://source.sakaiproject.org/contrib/caret/kernel/alias/pom.xml
> > (this one has the default profile getting activated even though
> > another profile is activated via a property)
> >
> > So, the question is, how do I get the same effect as running "mvn
> > install -Pkernel" (which is to not run the default profile anymore and
> > only run the profile that I wanted)?
> >
> > -AZ
> >
> > On Nov 14, 2007 5:40 PM, Roland Asmann <Ro...@cfc.at> wrote:
> > > Check the profile-documentation and use the property-activation.
> > >
> > > On Wednesday 14 November 2007 18:02, Aaron Zeckoski wrote:
> > > > I need to be able to trigger a specific profile WITHOUT executing the
> > > > default profile AND without having to use the -P command line option.
> > > > Ideally I want to trigger it using some setting in a POM file but any
> > > > method where the user who is building the code can still type "mvn
> > > > clean build" is fine.
> > > >
> > > > Can anyone help?
> > > > Thanks
> > > > -AZ
> > >
> > > --
> > > Roland Asmann
> > >
> > > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > > Bäckerstrasse 1/2/7
> > > A-1010 Wien
> > > FN 266155f, Handelsgericht Wien
> > >
> > > Tel.: +43/1/513 88 77 - 27
> > > Fax.: +43/1/513 88 62
> > > Email: Roland.Asmann@cfc.at
> > > Web: www.cfc.at
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
>
> --
> Roland Asmann
>
> CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> Bäckerstrasse 1/2/7
> A-1010 Wien
> FN 266155f, Handelsgericht Wien
>
> Tel.: +43/1/513 88 77 - 27
> Fax.: +43/1/513 88 62
> Email: Roland.Asmann@cfc.at
> Web: www.cfc.at
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Aaron Zeckoski (aaronz@vt.edu)
Senior Research Engineer - CARET - Cambridge University
[http://bugs.sakaiproject.org/confluence/display/~aaronz/]
Sakai Fellow - [http://aaronz-sakai.blogspot.com/]

Re: triggering profiles without using command line and without running the default profile?

Posted by Roland Asmann <Ro...@cfc.at>.
Do you need the default-profile? If not, remove the tag 'activateByDefault'.

Or you can try setting it to run when your property is NOT set/a certain value 
is NOT set:

<property>
  <name>!property</name>
</property>

or

<property>
  <name>property</name>
  <value>!value</value>
</property>


On Wednesday 14 November 2007 23:29, Aaron Zeckoski wrote:
> Yes... I did that. This is not a newbie question (though I wish it
> were). The default profile is still running unless I do something like
> "mvn install -Pkernel"
>
> Here are the poms:
> Parent: https://source.sakaiproject.org/contrib/caret/kernel/pom.xml
> (this sets a property)
> Project: https://source.sakaiproject.org/contrib/caret/kernel/alias/pom.xml
> (this one has the default profile getting activated even though
> another profile is activated via a property)
>
> So, the question is, how do I get the same effect as running "mvn
> install -Pkernel" (which is to not run the default profile anymore and
> only run the profile that I wanted)?
>
> -AZ
>
> On Nov 14, 2007 5:40 PM, Roland Asmann <Ro...@cfc.at> wrote:
> > Check the profile-documentation and use the property-activation.
> >
> > On Wednesday 14 November 2007 18:02, Aaron Zeckoski wrote:
> > > I need to be able to trigger a specific profile WITHOUT executing the
> > > default profile AND without having to use the -P command line option.
> > > Ideally I want to trigger it using some setting in a POM file but any
> > > method where the user who is building the code can still type "mvn
> > > clean build" is fine.
> > >
> > > Can anyone help?
> > > Thanks
> > > -AZ
> >
> > --
> > Roland Asmann
> >
> > CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> > Bäckerstrasse 1/2/7
> > A-1010 Wien
> > FN 266155f, Handelsgericht Wien
> >
> > Tel.: +43/1/513 88 77 - 27
> > Fax.: +43/1/513 88 62
> > Email: Roland.Asmann@cfc.at
> > Web: www.cfc.at
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

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


Re: triggering profiles without using command line and without running the default profile?

Posted by Aaron Zeckoski <aa...@vt.edu>.
Yes... I did that. This is not a newbie question (though I wish it
were). The default profile is still running unless I do something like
"mvn install -Pkernel"

Here are the poms:
Parent: https://source.sakaiproject.org/contrib/caret/kernel/pom.xml
(this sets a property)
Project: https://source.sakaiproject.org/contrib/caret/kernel/alias/pom.xml
(this one has the default profile getting activated even though
another profile is activated via a property)

So, the question is, how do I get the same effect as running "mvn
install -Pkernel" (which is to not run the default profile anymore and
only run the profile that I wanted)?

-AZ


On Nov 14, 2007 5:40 PM, Roland Asmann <Ro...@cfc.at> wrote:
> Check the profile-documentation and use the property-activation.
>
>
> On Wednesday 14 November 2007 18:02, Aaron Zeckoski wrote:
> > I need to be able to trigger a specific profile WITHOUT executing the
> > default profile AND without having to use the -P command line option.
> > Ideally I want to trigger it using some setting in a POM file but any
> > method where the user who is building the code can still type "mvn
> > clean build" is fine.
> >
> > Can anyone help?
> > Thanks
> > -AZ
>
> --
> Roland Asmann
>
> CFC Informationssysteme Entwicklungsgesellschaft m.b.H
> Bäckerstrasse 1/2/7
> A-1010 Wien
> FN 266155f, Handelsgericht Wien
>
> Tel.: +43/1/513 88 77 - 27
> Fax.: +43/1/513 88 62
> Email: Roland.Asmann@cfc.at
> Web: www.cfc.at
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Aaron Zeckoski (aaronz@vt.edu)
Senior Research Engineer - CARET - Cambridge University
[http://bugs.sakaiproject.org/confluence/display/~aaronz/]
Sakai Fellow - [http://aaronz-sakai.blogspot.com/]

Re: triggering profiles without using command line and without running the default profile?

Posted by Roland Asmann <Ro...@cfc.at>.
Check the profile-documentation and use the property-activation.


On Wednesday 14 November 2007 18:02, Aaron Zeckoski wrote:
> I need to be able to trigger a specific profile WITHOUT executing the
> default profile AND without having to use the -P command line option.
> Ideally I want to trigger it using some setting in a POM file but any
> method where the user who is building the code can still type "mvn
> clean build" is fine.
>
> Can anyone help?
> Thanks
> -AZ

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

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