Re: Maven and GData

2008-06-03 Thread Alan Gutierrez

On Jun 2, 2008, at 10:26 PM, Alan Gutierrez wrote:

It seems that Google Guice has made it into the Maven repositories  
while GData has not, even though they are both very openly  
licensed. I'm searching using mvnrepository.com. I'm not seeing  
anything for GData.


I did find the Google APIs Mavenized project. Not sure how up to  
date it is.


http://code.google.com/p/google-apis-mavenized/

Was hoping that it would be available in a repository somewhere.


How does one proceed once you've determined that a project is not  
available in a Maven format? Do you indeed Mavenize it and work with  
it that way?


Alan

--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can I run an Ant target in Maven?

2008-06-02 Thread Alan Gutierrez

Related question:

In most of my projects I create command line tools. To get them up  
and running quickly, I use Ant and all the classpath configuration  
that is already defined in my build.xml.


I've seen that you're supposed to use Profiles to switch out plugin  
configurations, so I could use different profiles to change my antrun  
tasks, effectively creating targets.


But, is that the best practice? I assume that there are one of three  
choices. (Because, I explored making Maven switchable without writing  
plugins, and was told that profiles where it.)


1) Use profiles - Seemingly verbose. Does not feel as though I'm  
using it as the authors intended. If my program is only tangentially  
part of the build process, like a program that updates a database  
schema, it seems like it should be it's own program with it's own  
documentation, not a by product or variation of the build.


2) Keep a parallel build.xml - If I can execute the tasks using the  
ant plugin, then it might not be the duplication that it appears to  
be. Is there a way to inherit or export the classpath configurations  
in Maven? (Similarly, part of the build, but people have grown  
accustomed to supplemental Ant tasks that perform non-build tasks.  
Maven conventions make supplemental actions unconventional.)


3) Define some standard shell script / batch file pair that  
understands the Maven repository layout - Or perhaps one that  
conforms to some best practice for distributing a shell script /  
batch file launcher pair, the way Groovy and Ant do.


Assume that I want to write Java command line programs to aid my  
development by munging log files and the like, things that don't  
belong in a web interface.


Alan

On Jun 2, 2008, at 8:46 AM, [EMAIL PROTECTED] wrote:


Every maven plugin has documentation on the maven site. It is the best
place to look for answers to questions like this. See:
  http://maven.apache.org/plugins/maven-antrun-plugin/plugin-info.html

As the documentation says, writing a target tag is NOT allowed  
within

the pom.xml file.

So I would define this stuff in a separate build.xml file.  The antrun
plugin can then be configured to execute a task in this separate file,
using the ant tag. And you can run the file directly from ant  
when you

want.

FYI, you can run the ant definition directly with
  antrun:run
but you cannot specify a target as far as I can see. And that makes
sense, as the maven-antrun-plugin doesn't allow targets to be defined
within the pom.xml file.

Regards,
Simon

John Casey schrieb:

You should be able to simply call the hibernatetool without a target.
IIRC, the antrun plugin may not support targets.

-john

youhaodeyi wrote:

I use Maven runant plugin to execute ant task, see below:

build
plugins
plugin
artifactIdmaven-antrun-plugin/artifactId
configuration
tasks
property name=output
value=target/classes /
taskdef name=hibernatetool
classname=org.hibernate.tool.ant.HibernateToolTask
/

target name=schema-recreate
hibernatetool destdir=${output}
configuration
configurationfile=${output}/hibernate.cfg.xml /
hbm2ddl drop=true create=true
export=true update=false /
/hibernatetool
/target
/tasks
/configuration
/plugin
/plugins
/build
How can I run the target schema-recreate? I don't want o attach this
into
any Maven lifecycle.






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Maven and GData

2008-06-02 Thread Alan Gutierrez
It seems that Google Guice has made it into the Maven repositories  
while GData has not, even though they are both very openly licensed.  
I'm searching using mvnrepository.com. I'm not seeing anything for  
GData.


I did find the Google APIs Mavenized project. Not sure how up to date  
it is.


http://code.google.com/p/google-apis-mavenized/

Was hoping that it would be available in a repository somewhere.

Alan

--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can I run an Ant target in Maven?

2008-06-02 Thread Alan Gutierrez


On Jun 2, 2008, at 10:06 AM, [EMAIL PROTECTED] wrote:


Alan Gutierrez schrieb:

Related question:

In most of my projects I create command line tools. To get them up  
and
running quickly, I use Ant and all the classpath configuration  
that is

already defined in my build.xml.

I've seen that you're supposed to use Profiles to switch out plugin
configurations, so I could use different profiles to change my antrun
tasks, effectively creating targets.

But, is that the best practice? I assume that there are one of three
choices. (Because, I explored making Maven switchable without writing
plugins, and was told that profiles where it.)



So I would recommend keeping maven for build tasks, and doing all the
other stuff that is, as you say, only tangentially part of the build
process separate, eg shell-script, perl, or ant. If it isn't part  
of a
build lifecycle, then shoe-horning it into Maven will always be  
awkward.


This thread started with someone asking how to set up maven to
effectively act like
ant runSomeArbitraryProcessing
and I think this is exactly the sort of thing that should NOT be  
pushed
into a pom file. There is no reason why everything needs to be done  
via

Maven.



Simon

I'm happy to leave Maven focused on a build and deployment. The Ant  
task looks like it will be the method by which I implement command  
line utilities, without duplicating path management.


However, it seems like it would be best to create a convention for  
the shell script / batch file pair. Maybe utility that builds these  
utilities for you. If you name a utility such as database-export and  
create a class com.software.DatabaseExport.java, a Maven plugin can  
generate a database-export.sh and a database-export.bat that will  
know how to find libraries given an layout convention. The code for  
launching Ant or Groovy, those shell scripts and batch files, can be  
used as jumping off point for a convention.


Writing Java command line programs is easy using args4j. It's  
launching them and deploying them that is a problem.


This would be my preferred way of creating this utilities, since it  
would lead me to develop generally useful utilities, rather than one  
off Ant monsters.


Alan

--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Publishing Source and Javadoc to Local Repository

2008-06-01 Thread Alan Gutierrez

When I type:

mvn install

In my projects, it installs the jar artifact to the local repository  
in my home directory, but not the source or javadoc.


How do install the source and javadoc from my working projects to my  
local repository?


Alan

--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Publishing Source and Javadoc to Local Repository

2008-06-01 Thread Alan Gutierrez

On Jun 1, 2008, at 5:21 PM, Martijn Dashorst wrote:

See the maven source plugin, and attach it to the jar execution phase
(iirc.) you can see one example of the definition in action in the
Wicket parent pom:
http://svn.apache.org/repos/asf/wicket/trunk/pom.xml


Thank you for your help.

That is placing the Jars in the local repository. However, I'm still  
not able to use the source and Javadoc when I regenerate my Eclipse  
projects for a dependent project.


I'm running...

mvn install

In the project directory.

and

mvn eclipse:clean  mvn eclipse:eclipse -DdownloadSources=true - 
DdownloadJavadocs=true


In the dependent directory.

I've placed the output of mvn install and the generated .classpath  
file below.


[EMAIL PROTECTED] core]$ mvn install
[INFO] Scanning for projects...
[INFO]  


[INFO] Building binder
[INFO]task-segment: [install]
[INFO]  


[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Surefire report directory: /Users/alan/svn/open/binder/core/ 
target/surefire-reports


---
 T E S T S
---
Running com.agtrz.binder.DocumentBinderTestCase
Tests run: 2, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.048  
sec


Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 1

[INFO] [jar:jar]
[INFO] Preparing source:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive  
invocation.

[INFO] No goals needed for project - skipping
[INFO] [source:jar {execution: attach-sources}]
[INFO] Building jar: /Users/alan/svn/open/binder/core/target/ 
binder-0.1-sources.jar

[INFO] Preparing javadoc:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive  
invocation.
[WARNING] Removing: jar from forked lifecycle, to prevent recursive  
invocation.

[INFO] No goals needed for project - skipping
[INFO] [javadoc:jar {execution: attach-sources}]
2 warnings
[INFO] Javadoc Warnings
[WARNING] /Users/alan/svn/open/binder/core/src/main/java/com/agtrz/ 
binder/Binder.java:56: warning - @todo is an unknown tag.
[WARNING] /Users/alan/svn/open/binder/core/src/main/java/com/agtrz/ 
binder/Binder.java:124: warning - @param argument documentClass is  
not a parameter name.
[INFO] Building jar: /Users/alan/svn/open/binder/core/target/ 
binder-0.1-javadoc.jar

[INFO] [install:install]
[INFO] Installing /Users/alan/svn/open/binder/core/target/ 
binder-0.1.jar to /Users/alan/.m2/repository/com/agtrz/binder/0.1/ 
binder-0.1.jar
[INFO] Installing /Users/alan/svn/open/binder/core/target/binder-0.1- 
sources.jar to /Users/alan/.m2/repository/com/agtrz/binder/0.1/ 
binder-0.1-sources.jar
[INFO] Installing /Users/alan/svn/open/binder/core/target/binder-0.1- 
javadoc.jar to /Users/alan/.m2/repository/com/agtrz/binder/0.1/ 
binder-0.1-javadoc.jar
[INFO]  


[INFO] BUILD SUCCESSFUL
[INFO]  


[INFO] Total time: 7 seconds
[INFO] Finished at: Sun Jun 01 17:41:28 CDT 2008
[INFO] Final Memory: 10M/20M
[INFO]  




classpath
  classpathentry kind=src path=src/main/java/
  classpathentry kind=src path=src/main/resources excluding=**/ 
*.java/

  classpathentry kind=output path=target/classes/
  classpathentry kind=con  
path=org.eclipse.jdt.launching.JRE_CONTAINER/
  classpathentry kind=var path=M2_REPO/args4j/args4j/2.0.8/ 
args4j-2.0.8.jar sourcepath=M2_REPO/args4j/args4j/2.0.8/ 
args4j-2.0.8-sources.jar/
  classpathentry kind=var path=M2_REPO/com/agtrz/binder/0.1/ 
binder-0.1.jar/
  classpathentry kind=var path=M2_REPO/junit/junit/4.4/ 
junit-4.4.jar sourcepath=M2_REPO/junit/junit/4.4/junit-4.4- 
sources.jar

attributes
  attribute value=jar:file:/Users/alan/.m2/repository/junit/ 
junit/4.4/junit-4.4-javadoc.jar!/ name=javadoc_location/

/attributes
  /classpathentry
  classpathentry kind=var path=M2_REPO/net/sf/saxon/saxon/8.7/ 
saxon-8.7.jar/
  classpathentry kind=var path=M2_REPO/net/sf/saxon/saxon-dom/ 
8.7/saxon-dom-8.7.jar/

/classpath




--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Publishing Source and Javadoc to Local Repository

2008-06-01 Thread Alan Gutierrez


On Jun 1, 2008, at 5:44 PM, Alan Gutierrez wrote:


On Jun 1, 2008, at 5:21 PM, Martijn Dashorst wrote:

See the maven source plugin, and attach it to the jar execution phase
(iirc.) you can see one example of the definition in action in the
Wicket parent pom:
http://svn.apache.org/repos/asf/wicket/trunk/pom.xml


Thank you for your help.

That is placing the Jars in the local repository. However, I'm  
still not able to use the source and Javadoc when I regenerate my  
Eclipse projects for a dependent project.


I'm running...

mvn install

In the project directory.

and

mvn eclipse:clean  mvn eclipse:eclipse -DdownloadSources=true - 
DdownloadJavadocs=true


In the dependent directory.

I've placed the output of mvn install and the generated .classpath  
file below.


It appears to be working now if I run clean which clears a cache file  
that determines if the Eclipse plugin will scan the repository.


Thank you.

Alan

--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multiple Executions with Hibernate3 Plugin

2008-04-08 Thread Alan Gutierrez
So, it is the case that you can only use antrun one in your pom.xml  
to do one thing? You can't create new goals using XML?


If so, that is wicked lame.

Alan

On Apr 7, 2008, at 3:38 PM, Alan Gutierrez wrote:

Wayne
 You could either include the full plugin config in the plugin or  
just a property value, whatever makes the most sense.


Did you mean...

You could either include the full plugin config in the *profile* or  
just a property value, whatever makes the most sense.


Okay. So, there are profiles. I'll use that.

I'm curious though, is there no way to create custom goals? I'm  
wondering how someone would use the antrun task more than once in  
their build. Let's say I had a foo tool and a bar tool, neither of  
which had a Maven plugin, but both of which had ant tasks. What if  
I wanted to create two goals.


bar:run

foo:run

But those goals really where calling antrun:run , which would have  
to be used twice in the pom, once to define bar:run and once to  
define foo:run . Analogous, I suppose, to creating ant tasks in  
build.xml .


Is there no way to create new goals short of creating a new plugin?  
Are profiles supposed to be the means to define new tasks?


Alan

On Apr 6, 2008, at 11:55 PM, Wayne Fay wrote:
The best way to handle this is with multiple profiles. Then you  
activate one with -Pprofilename eg -Pdbupdate. You could either  
include the full plugin config in the plugin or just a property  
value, whatever makes the most sense.


Wayne

On 4/4/08, Alan Gutierrez [EMAIL PROTECTED] wrote:

I have the maven plugin working with the following code.

plugin
groupIdorg.codehaus.mojo/groupId
artifactIdhibernate3-maven-plugin/artifactId
version2.0-alpha-2/version
dependencies
dependency
groupIdmysql/groupId
artifactIdmysql-connector-java/artifactId
version5.1.3/version
/dependency
/dependencies
configuration
executions
execution
phaseprocess-resources/phase
goals
goalhbm2ddl/goal
/goals
/execution
/executions
componentProperties
exportfalse/export
!--
updatetrue/update
--
ejb3true/ejb3
jdk5true/jdk5
formattrue/format
outputfilenameschema.sql/outputfilename
/componentProperties
/configuration
/plugin

The executions section I've just added, but I'm not sure how to get
to where I want to go.

What I want is the ability to run this plugin with the update
feature on, so that I can update the databases easily, when I'm in
development mode.

What XML do I add to create a new separate goal? I supposed I could
toggle update using a commandline parameter, but I'm wondering, what
are the ways to create a different configuration for a plugin? For
the antrun plugin to be useful, it seems like you should be able to
specify many different task configurations.



--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multiple Executions with Hibernate3 Plugin

2008-04-07 Thread Alan Gutierrez

Wayne
 You could either include the full plugin config in the plugin or  
just a property value, whatever makes the most sense.


Did you mean...

You could either include the full plugin config in the *profile* or  
just a property value, whatever makes the most sense.


Okay. So, there are profiles. I'll use that.

I'm curious though, is there no way to create custom goals? I'm  
wondering how someone would use the antrun task more than once in  
their build. Let's say I had a foo tool and a bar tool, neither of  
which had a Maven plugin, but both of which had ant tasks. What if I  
wanted to create two goals.


bar:run

foo:run

But those goals really where calling antrun:run , which would have to  
be used twice in the pom, once to define bar:run and once to define  
foo:run . Analogous, I suppose, to creating ant tasks in build.xml .


Is there no way to create new goals short of creating a new plugin?  
Are profiles supposed to be the means to define new tasks?


Alan

On Apr 6, 2008, at 11:55 PM, Wayne Fay wrote:
The best way to handle this is with multiple profiles. Then you  
activate one with -Pprofilename eg -Pdbupdate. You could either  
include the full plugin config in the plugin or just a property  
value, whatever makes the most sense.


Wayne

On 4/4/08, Alan Gutierrez [EMAIL PROTECTED] wrote:

I have the maven plugin working with the following code.

plugin
groupIdorg.codehaus.mojo/groupId
artifactIdhibernate3-maven-plugin/artifactId
version2.0-alpha-2/version
dependencies
dependency
groupIdmysql/groupId
artifactIdmysql-connector-java/artifactId
version5.1.3/version
/dependency
/dependencies
configuration
executions
execution
phaseprocess-resources/phase
goals
goalhbm2ddl/goal
/goals
/execution
/executions
componentProperties
exportfalse/export
!--
updatetrue/update
--
ejb3true/ejb3
jdk5true/jdk5
formattrue/format
outputfilenameschema.sql/outputfilename
/componentProperties
/configuration
/plugin

The executions section I've just added, but I'm not sure how to get
to where I want to go.

What I want is the ability to run this plugin with the update
feature on, so that I can update the databases easily, when I'm in
development mode.

What XML do I add to create a new separate goal? I supposed I could
toggle update using a commandline parameter, but I'm wondering, what
are the ways to create a different configuration for a plugin? For
the antrun plugin to be useful, it seems like you should be able to
specify many different task configurations.



--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Multiple Executions with Hibernate3 Plugin

2008-04-04 Thread Alan Gutierrez
I have the maven plugin working with the following code.

plugin
groupIdorg.codehaus.mojo/groupId
artifactIdhibernate3-maven-plugin/artifactId
version2.0-alpha-2/version
dependencies
dependency 
groupIdmysql/groupId
artifactIdmysql-connector-java/artifactId
version5.1.3/version
/dependency 
/dependencies
configuration
executions
execution
phaseprocess-resources/phase
goals
goalhbm2ddl/goal
/goals
/execution
/executions
componentProperties
exportfalse/export
!-- 
updatetrue/update
--
ejb3true/ejb3
jdk5true/jdk5
formattrue/format
outputfilenameschema.sql/outputfilename
/componentProperties
/configuration
/plugin

The executions section I've just added, but I'm not sure how to get
to where I want to go.

What I want is the ability to run this plugin with the update
feature on, so that I can update the databases easily, when I'm in
development mode.

What XML do I add to create a new separate goal? I supposed I could
toggle update using a commandline parameter, but I'm wondering, what
are the ways to create a different configuration for a plugin? For
the antrun plugin to be useful, it seems like you should be able to
specify many different task configurations.

Alan Gutierrez

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Downloading Sources

2008-03-08 Thread Alan Gutierrez

I am able to download sources using ...

mvn eclipse:eclipse -DdownloadSources=true

How can I do this without regenerating .classpath and .project ?

--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Integration Testing with Maven

2008-02-16 Thread Alan Gutierrez


I am getting started with Maven 2. I currently use a Groovy +  
AntBuilder build for my projects.


I create parallel projects.

/codearea
  /pack
  /strata
  /depot

Let's say the depot project depends on strata which depends on  
pack. I can cd to depot and run...


./builder siblingTest

And it will compile and test all projects. It will use the local  
projects for testing rather than jars. The depot project will use  
the newly build class files from the strata project. To my mind  
this tests the integration before I check in.


Is there a similar way to have Maven 2 to test against local  
development instances of projects?


Thank you.

Alan

--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]