Re: assemble and compile for a specific version

2011-06-08 Thread Fernando Wermus
I finally solved using filter resources instead of assemblies.

2011/6/7 Fernando Wermus fwer...@odeasrl.com.ar

 Hi all,
 I have the following pom.xml that only assambles in a certein profile:

 profiles
 profile
  idqa-tomcat5x/id
 build
 plugins
  plugin
 artifactIdmaven-assembly-plugin/artifactId
  version2.2-beta-5/version
 executions
 execution
  idqa-tomcat5x/id
 goals
 goalsingle/goal
 /goals
 configuration
 filters
  filter${project.basedir}/src/assemble/filter.properties/filter
  /filters
descriptors
 descriptor${project.basedir}/src/assemble/descriptor.xml/descriptor
  /descriptors
 /configuration
 phasepackage/phase
  /execution
 /executions
 /plugin
  /plugins
 /build
 /profile
  /profiles

 But I also need that the generated jar has all the compiled classes as well
 as all the resources. The only thing that this jar contains is just the file
 that participates in assembly. How can I change that in my profile?

 thanks in advance




assemble and compile for a specific version

2011-06-07 Thread Fernando Wermus
Hi all,
I have the following pom.xml that only assambles in a certein profile:

profiles
profile
idqa-tomcat5x/id
build
plugins
plugin
artifactIdmaven-assembly-plugin/artifactId
version2.2-beta-5/version
executions
execution
idqa-tomcat5x/id
goals
goalsingle/goal
/goals
configuration
filters
filter${project.basedir}/src/assemble/filter.properties/filter
 /filters
   descriptors
descriptor${project.basedir}/src/assemble/descriptor.xml/descriptor
/descriptors
/configuration
phasepackage/phase
/execution
/executions
/plugin
/plugins
/build
/profile
/profiles

But I also need that the generated jar has all the compiled classes as well
as all the resources. The only thing that this jar contains is just the file
that participates in assembly. How can I change that in my profile?

thanks in advance


Re: mvn eclipse plugin for multimodule proyect

2011-04-27 Thread Fernando Wermus
Barrie and Roland,
  I discused with my boss about not doing this work as you explained to
me in this thread. We finally decided not to include the instructions that
copy eclipse and weblogic into pom.xml, but into a script sh that it is
called from outside.

The point was that our script is not part of maven life cycle.

thanks a lot for your support.



2011/4/26 Barrie Treloar baerr...@gmail.com

 Its always helpful to be over-specific in emails.
 I'm having to make assumptions about your environment that are likely
 incorrect and so the advice is not as good as it could be.

 In your original email you say it doesn't create any. referring to
 eclipse project files (like .project, .classpath, etc)
 In Roland's reply he asks whether it creates the files.
 In your reply you say the files are not created.
 Do you mean .project, .classpath, etc are not created at all?
 Remember that mvn eclipse:eclipse just automates what you can do manually.
 Have you been able to manually import the projects into eclipse and
 setup their classpaths?

 In the fourth email, you reply with a bit more detail.
 You say that you have a separate pom.xml for constructing the
 developers environment.
 Roland's reply I presume that the POM you are using is *not* the one
 you call 'parent' in your structure
 As he rightly points out if it is not parent, then mvn eclipse:eclipse
 will be working with the wrong information.
 If you have moved the common configuration into a profile in the
 parent pom.xml then you may be ok.
 Are the projects (A, B, C) modules of parent?
 If they are not modules then mvn doesn't know about them, so neither
 will eclipse:eclipse.
 However thinking about this, I don't think maven dynamically load the
 pom.xml files, it think it reads them all at startup.
 So its possible that you can't do a checkout, which creates the
 modules, and then invoke eclipse:eclipse in a single invocation of
 mvn.

 You need to be aware of a bug (I dont have the jira for it) where
 multiple executions at the same phase do not have a defined ordering.
 Thus, when you have everything in you profile as phase=verify, you
 need to carefully watch the output to see that the execution.id
 printed out when maven is run is the order that you expect things to
 be in.  It is very possible that your problem is that eclipse:eclipse
 is being run prior to checking anything out.
 The only way to fix this is to use different phases.

 I do wonder why you are trying to automate a task that is done
 infrequently.
 Once you have manually checked out the project you never need to do
 this again (you only do syncs).
 Reasons for checking out another instance of the project may include
 preparing for a release, or branch, or perhaps your workflow requires
 bugs to be worked on in separate workspaces.
 Once checked out you manually run eclipse:eclipse.
 Reasons for re-running eclipse:eclipse are because dependencies have
 changed (either the project has been released, something you depend
 upon has bug fixes and you want a different version, or new
 dependencies have been added).

 I think you would be better off including the step by step
 instructions in a readme.txt file, your wiki, or a batch file.
 Trying to do this in Maven doesn't feel like the right thing to do.
 Maven manages your build lifecycle and checkout and eclipse:eclipse
 are not part of that build lifecycle, they are steps prior to that.

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




Re: mvn eclipse plugin for multimodule proyect

2011-04-25 Thread Fernando Wermus
thanks a lot for replaying
your answer are really helpful. I am going to replay you below.

2011/4/20 Barrie Treloar baerr...@gmail.com

 On Wed, Apr 20, 2011 at 10:24 PM, Fernando Wermus
 fwer...@odeasrl.com.ar wrote:
 [del]
  I am trying to run mvn eclipse:eclipse in parent pom.xml without any
  success.
  I am not sure if pom.xml for constructing developer environment run mvn
  eclipse:eclipse in pom.xml parent or in itself. I am almost sure that is
  doing it in parent pom.xml without any success.
 [del]

 What you have described so far appears reasonable.

 Can you please run
 mvn eclipse:eclipse -Pdeveloper
 and paste the error output.


I change that for
 execution
 idgenero-proyectos2/id
 phaseverify/phase
configuration
executablemvn/executable

workingDirectory${src.modulos}/workingDirectory
arguments
argument-Pdesarrollo/argument
argumenteclipse:eclipse/argument
/arguments
/configuration
 goals
 goalexec/goal
 /goals
 /execution


 I'd recommend against putting the eclipse configuration inside a profile.
 What I do instead is to put this inside
 build  pluginManagement
 So that people can run
 mvn eclipse:eclipse
 without having to remember to turn on a profile
 Rememeber, the eclipse plugin does not participate in the standard
 lifecycle.


What we are doing with maven in development profile is:

1. checkout trunk
2. compile
3. mvn eclipse:eclipse
4. copy weblogic to a folder

As you can see, we consider that maven should resolve all the problem about
having a development environment. This includes some operations that are not
part of standard lifecycle. Are we taking a correct path? if not, this
instructions are a part needed for developers when they construct their
environment. How do you recommend is it the best way to achieve this goal?


 If this is for internal development inside your company, then I
 recommend putting this stuff into your corporate parent pom.
 That way any maven projects get this configuration - not just your project

 Personally I dont use these options below
   workspace.../workspace

  
 workspaceCodeStylesURLfile:///${user.home}/WorkingDirectory/${odea.cvs.branch}/env/config/IDEs/eclipse/formatting-rules.xml/workspaceCodeStylesURL

 By doing this you've made some assumptions that may not be valid:
 * that the workspace is always one directory above where you checked
 out the code.
 * that the code style file is in a fixed location on disk.

 Since the code style file doesn't change that regularly we do all that
 manually, by downloading it and installing it via Window 
 Preferences.

 If you do want to automate it then check out

 http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html
 If you bundle corporate stuff into its own project, then you can use
 copy-resources to put them into your target/ directory and then
 reference them that way.  It may be better to place them into a
 different directory than target/ so they dont get deleted when you run
 clean.  But at least these are now project local references instead of
 fixed references.

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




having so environment variables in maven

2011-04-25 Thread Fernando Wermus
I was reading in google that environment variables for using into pom.xml
would be deprecated. Is it true?


Re: mvn eclipse plugin for multimodule proyect

2011-04-20 Thread Fernando Wermus
/goals
/execution

  /executions
  /plugin


/plugins
/build
/profile

2011/4/19 Asmann, Roland roland.asm...@adesso.at

 Can you post your configuration (if any) and the command you issue to
 run Maven?


 On 19.04.2011 17:44, Fernando Wermus wrote:
  What it does not create are the files for each eclipse project. Thus I
  cannot make the import.
 
  2011/4/19 Asmann, Roland roland.asm...@adesso.at
 
Doesn't it create the files or are your projects not in Eclipse?
   
You must import the projects yourself after the build, the plugin does
*not* do this for you!
   
   
On 19.04.2011 17:14, Fernando Wermus wrote:
 Hi all,
 I have a pom which is a multimodule proyect. I am using maven plugin
 eclipse for generating all the eclipse's proyects. But for reason,
 it
 doesn't create any.

 any help would be really appreciated

   
--
Roland Asmann
Senior Software Engineer
   
adesso Austria GmbH
Floridotower 26. Stock T +43 1 2198790-27
Floridsdorfer Hauptstr. 1 F +43 1 2198790-927
A-1210 Wien M +43 664 88657566
E roland.asm...@adesso.at
W www.adesso.at
   
-
 business. people. technology. 
-
   
-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org
   
   
 

 --
 Roland Asmann
 Senior Software Engineer

 adesso Austria GmbH
 Floridotower 26. Stock  T +43 1 2198790-27
 Floridsdorfer Hauptstr. 1   F +43 1 2198790-927
 A-1210 Wien M +43 664 88657566
E roland.asm...@adesso.at
W www.adesso.at

 -
  business. people. technology. 
 -

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




mvn eclipse plugin for multimodule proyect

2011-04-19 Thread Fernando Wermus
Hi all,
I have a pom which is a multimodule proyect. I am using maven plugin
eclipse for generating all the eclipse's proyects. But for reason, it
doesn't create any.

any help would be really appreciated


Re: mvn eclipse plugin for multimodule proyect

2011-04-19 Thread Fernando Wermus
What it does not create are the files for each eclipse project. Thus I
cannot make the import.

2011/4/19 Asmann, Roland roland.asm...@adesso.at

 Doesn't it create the files or are your projects not in Eclipse?

 You must import the projects yourself after the build, the plugin does
 *not* do this for you!


 On 19.04.2011 17:14, Fernando Wermus wrote:
  Hi all,
  I have a pom which is a multimodule proyect. I am using maven plugin
  eclipse for generating all the eclipse's proyects. But for reason, it
  doesn't create any.
 
  any help would be really appreciated
 

 --
 Roland Asmann
 Senior Software Engineer

 adesso Austria GmbH
 Floridotower 26. Stock  T +43 1 2198790-27
 Floridsdorfer Hauptstr. 1   F +43 1 2198790-927
 A-1210 Wien M +43 664 88657566
E roland.asm...@adesso.at
W www.adesso.at

 -
  business. people. technology. 
 -

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




maven eclipse plugin

2011-04-18 Thread Fernando Wermus
Hi all,
I am trying to set up code styles, work space and so on, but it doesn't
work. Does anybody know if maven plug in eclipse is working for these kind
of set up? I am using eclipse helios

thanks in advance


Re: same proyects running under java 1.4 and java 1.5

2011-04-14 Thread Fernando Wermus
Interesting solution. thanks! I will consult

2011/4/13 Jörg Schaible joerg.schai...@gmx.de

 Hi,

 Fernando Wermus wrote:

  Hi all,
  We have a proyect which we need to compile under java 1.4 for some
  companies and 1.6 for other companies. The problem is that in java 1.6 we
  have a class that implements an interface named ResulSet. Result changes
  its methods from 1.4 to 1.6 because jdbc changes. Then we need to have an
  implementation of Resulset for java 1.4 and another impl for java 1.6.
  What we need is to add to our currents profiles a way to include or
  exclude some class in the proyect with the same package and class name.
 
  Is any solution from maven for this problem?
 
  thanks in advance and I hope you have understood our problem.

 This is how we did it:

 1/ Use two independent version lines i.e. do it like Apache commons dbcp
 where version 1.3.x is for JDBC 3 (Java 5 or lower) and version 1.4.x is
 for
 JDBC 4 (Java 6).

 2/ Use comment markers in your Java code, see following snippet:

 = % =
 /*JDBC4**/
 import java.sql.NClob;
 import java.sql.RowId;
 import java.sql.SQLXML;
 //*JDBC4*/
 = % =

 All types and methods that are only available for JDBC 4 are surrounded
 with
 those two markers i.e. the code is compilable from your IDE with Java 6 as
 usual.

 3/ Prepare the POM to modify the source using a profile based on the target
 JDK.

 The trick is to use the original source that compiles against JDBC 4 and
 filter it (resp. generate new sources) with a regular expression that uses
 those two markers to create Java block comments and let the compiler use
 the
 new sources then.

 === % ===
 ...
  groupIdyour.company/groupId
  artifactIdyour.artifact/artifactId
  version${version.your.artifact}/version
 ...
  build
sourceDirectory${local.source.directory}/sourceDirectory
  /build
 ...
  profiles
profile
  idjdk15/id
  activation
jdk1.5/jdk!-- JDBC 3 only --
  /activation
  build
plugins
  plugin
groupIdyour.company/groupId
artifactIdregexp-plugin/artifactId
executions
  execution
idfilter-jdbc4/id
phasegenerate-sources/phase
goals
  goalperform/goal
/goals
  /execution
/executions
configuration
  regExpFilter
sourceDir${basedir}/src/main/java/sourceDir
targetDir${basedir}/target/generated-
 sources/java/targetDir
   regExps
  regExp
search/\*JDBC4\*\*//search
replace/*JDBC4/replace
  /regExp
  regExp
search//\*JDBC4\*//search
replaceJDBC4*//replace
  /regExp
/regExps
  /regExpFilter
/configuration
  /plugin
/plugins
  /build
  properties
local.source.directorytarget/generated-
 sources/java/local.source.directory
  /properties
/profile
  /profiles
 ...
  properties
local.source.directorysrc/main/java/local.source.directory
  /properties
 === % ===

 The property version.your.artifact is defined in the parent and the
 artifact is also declared there in a depMgmt section:

 === % ===
 ...
  dependencyManagement
dependencies
  dependency
groupIdyour.company/groupId
artifactIdyour.artifact/artifactId
version${version.your.artifact}/version
  /dependency
/dependencies
  /dependencyManagement
 ...
  profiles
profile
  idjdk15/id
  activation
jdk1.5/jdk
  /activation
  properties
version.your.artifact1.6.0-SNAPSHOT/version.your.artifact
  /properties
/profile
  /profiles
 ...
  properties
version.your.artifact1.5.0-SNAPSHOT/version.your.artifact
  /properties
 === % ===

 Now, the plugin we use for the regexp fitlering is not publicly available,
 but if you look at Apache dbcp, it is done there with an Ant task and you
 should be able to to similar with the antrun plugin. I've also seen once
 that plexus-utils have capabilities for regexp filtering, but I don't know
 if there's any syntax to activate this for standard Maven filtering. OTOH
 it
 is really easy to write such a simply plugin yourself ;-)

 Note, we used the current JDK for profile activation i.e. it depends on the
 Java version we use to run Maven itself. This might not be appropriate, you
 will have to define different activations then.

 Hope this gives you some ideas,
 Jörg



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




same proyects running under java 1.4 and java 1.5

2011-04-13 Thread Fernando Wermus
Hi all,
We have a proyect which we need to compile under java 1.4 for some
companies and 1.6 for other companies. The problem is that in java 1.6 we
have a class that implements an interface named ResulSet. Result changes its
methods from 1.4 to 1.6 because jdbc changes. Then we need to have an
implementation of Resulset for java 1.4 and another impl for java 1.6. What
we need is to add to our currents profiles a way to include or exclude some
class in the proyect with the same package and class name.

Is any solution from maven for this problem?

thanks in advance and I hope you have understood our problem.


Re: same proyects running under java 1.4 and java 1.5

2011-04-13 Thread Fernando Wermus
Alex,
I understand your proposal. Do I need to create two proyects for this
situation or could I avoid this?

2011/4/13 Alex Lopez alo...@flordeutopia.pt

 Make the classes into different jars (java 1.4 and 1.6) and add one ore the
 other as dependencies under different profiles.

 Em 13-04-2011 15:01, Fernando Wermus escreveu:

  Hi all,
 We have a proyect which we need to compile under java 1.4 for some
 companies and 1.6 for other companies. The problem is that in java 1.6 we
 have a class that implements an interface named ResulSet. Result changes
 its
 methods from 1.4 to 1.6 because jdbc changes. Then we need to have an
 implementation of Resulset for java 1.4 and another impl for java 1.6.
 What
 we need is to add to our currents profiles a way to include or exclude
 some
 class in the proyect with the same package and class name.

 Is any solution from maven for this problem?

 thanks in advance and I hope you have understood our problem.


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




Re: same proyects running under java 1.4 and java 1.5

2011-04-13 Thread Fernando Wermus
Alex,
My boss rejects this option. Any idea?

2011/4/13 Alex Lopez alo...@flordeutopia.pt

 Yes, the thing is create 2 projects (in fact 3).

 So you can include same classes/packages in different jars (different
 projects). And have the 3rd project depend on each of the others depending
 on the active profile.

 I don't know how to do it with only one project... Of course there might be
 plenty of ways ;)

 Em 13-04-2011 15:44, Fernando Wermus escreveu:

  Alex,
 I understand your proposal. Do I need to create two proyects for this
 situation or could I avoid this?

 2011/4/13 Alex Lopezalo...@flordeutopia.pt

  Make the classes into different jars (java 1.4 and 1.6) and add one ore
 the
 other as dependencies under different profiles.

 Em 13-04-2011 15:01, Fernando Wermus escreveu:

  Hi all,

 We have a proyect which we need to compile under java 1.4 for some
 companies and 1.6 for other companies. The problem is that in java 1.6
 we
 have a class that implements an interface named ResulSet. Result changes
 its
 methods from 1.4 to 1.6 because jdbc changes. Then we need to have an
 implementation of Resulset for java 1.4 and another impl for java 1.6.
 What
 we need is to add to our currents profiles a way to include or exclude
 some
 class in the proyect with the same package and class name.

 Is any solution from maven for this problem?

 thanks in advance and I hope you have understood our problem.


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




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




copying resources from /src/main/resources to target/webapp/web-inf/html

2010-06-17 Thread Fernando Wermus
Hi all,
I need to copy my resources located at src/main/resources, which are
html files to target/web-inf/html.  This is needed to create the war file.

I've tried setting up maven resources plug in as follows

plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-resources-plugin/artifactId
   version2.4.1/version
   executions
   execution
 idcopy-package-config/id
 phasepackage/phase
 goals
 goalcopy-resources/goal
 /goals
 configuration
 outputDirectory${basedir}/web-inf/html/outputDirectory
resources
 resource

directory${basedir}/src/main/resources/directory
filteringtrue/filtering
/resource
/resources
 /configuration
   /execution
   /executions
  /plugin

I got

[1] Inside the definition for plugin 'maven-resources-plugin' specify the
following:

configuration
  ...
  resourcesVALUE/resources
/configuration.

any help I really would appreciate

thanks in advance

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


maven 2.3.0 Cannot find lifecycle mapping for packaging: 'zip'.

2009-05-06 Thread Fernando Wermus
I got 'maven 2.3.0 Cannot find lifecycle mapping for packaging: 'zip'.'
message running

mvn install

I am a bit confuse because I haven't changed anything since las time I use
it. This is my setup and I tested it with maven 2.0.9.  Is It a matter of
versions?

Apache Maven 2.1.0 (r755702; 2009-03-18 16:10:27-0300)
Java version: 1.6.0_06
Java home: /usr/lib/jvm/java-6-sun-1.6.0.06/jre
Default locale: en_US, platform encoding: UTF-8
OS name: linux version: 2.6.24-23-generic arch: i386 Family: unix


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/