searching the archives??
Greetings, At the risk of asking a dumb question, is users@maven.apache.org searchable?? When I go to the archives (http://mail-archives.apache.org/mod_mbox/maven-users/) I cannot see any mechanism to search. Am I missing something?? Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] maven-antrun-plugin
Greetings, I am trying to get the m2 maven-antrun-plugin to run. I have gotten pretty far but now I'm stumped. First I downloaded the latest/greatest m2 from SVN. Then I pulled the maven-antrun-plugin code out and built it, after hacking a bit. I had to; 1) Change the pom.xml parent version 2) Grab the plexus-override-component-configurator 1.0-SNAPSHOT and install it After getting the plugin built, I then added the following to my little test project's pom.xml: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-antrun-plugin/artifactId version1.0-alpha-1-SNAPSHOT/version executions execution phasevalidate/phase configuration tasks echo! I WAS HERE !!/echo /tasks /configuration goals goalrun/goal /goals /execution /executions /plugin /plugins /build But when I run this, I get the following weird Exceptions (see below). And I'm stumped. Can anyone help me?? I searched the archives and found someone recently had this issue -- but there was no help given. Thanks, -- Chris 110] ~/work/m2-test3/my-app4$ m2 install INFO] INFO] Building Maven Test APP INFO] INFO] maven-resources-plugin: resolved to version 2.0-alpha-3 from local repository INFO] maven-compiler-plugin: resolved to version 2.0-alpha-3 from local repository INFO] maven-surefire-plugin: resolved to version 2.0-alpha-3 from local repository INFO] maven-jar-plugin: resolved to version 2.0-alpha-3 from local repository INFO] maven-source-plugin: resolved to version 2.0-alpha-2 from local repository INFO] maven-install-plugin: resolved to version 2.0-alpha-3 from local repository INFO] my-mojo: using locally installed snapshot INFO] maven-antrun-plugin: using locally installed snapshot INFO] ERROR] BUILD ERROR INFO] INFO] Diagnosis: Error looking up plugin: INFO] ERROR] Cause: rg.apache.maven.plugin.MojoExecutionException: Error looking up plugin: at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:382) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:169) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:143) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:129) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:103) at org.apache.maven.DefaultMaven.processProject(DefaultMaven.java:261) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:180) at org.apache.maven.cli.MavenCli.main(MavenCli.java:269) 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:324) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:303) at org.codehaus.classworlds.Launcher.launch(Launcher.java:243) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:416) at org.codehaus.classworlds.Launcher.main(Launcher.java:363) aused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.apache.maven.plugin. ojoorg.apache.maven.plugins:maven-antrun-plugin:1.0-alpha-1-SNAPSHOT:run', it could not be started at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:315) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:416) at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:495) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:373) ... 15 more aused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error starting component at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:109) at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95) at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
Re: maven2 : packaging options
Thanks Brett. That worked (after updating to the current HEAD from SVN nad building m2 from scratch). I now get the following:: [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [INFO] Executed tasks Although note that I am NOT getting my Ant echo printed to System.out ??? Even if I try echo level=error... Does anyone know offhand how to correct this?? Ant wants a simple PrintStream set in it's Logger -- is there a simple way to convert an m2 Log into a PrintStream -- or some such... Thanks, -- Chris On 8/23/05, Brett Porter [EMAIL PROTECTED] wrote: what do the modules do? A packging of POM is appropriate for pom-only (usually a parent element). - Brett On 8/16/05, Rizwan Merchant [EMAIL PROTECTED] wrote: Hi, I have a project with a number of sub-modules. I need to specify in some of the sub-modules that those modules should not be jar-red. Basically, I want to call the m2 install command on the head project, but jar only some of the sub-modules. Is there an option for the packaging element that will accomplish this? thanks. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: maven2 : packaging options
Actually, it does work when using echo level=error. My mistake... I will add an optional parameter to AntRun that allows one to set echo level. I'll submit it back as a patch... Thanks, -- Chris On 8/23/05, Chris Berry [EMAIL PROTECTED] wrote: Thanks Brett. That worked (after updating to the current HEAD from SVN nad building m2 from scratch). I now get the following:: [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [INFO] Executed tasks Although note that I am NOT getting my Ant echo printed to System.out ??? Even if I try echo level=error... Does anyone know offhand how to correct this?? Ant wants a simple PrintStream set in it's Logger -- is there a simple way to convert an m2 Log into a PrintStream -- or some such... Thanks, -- Chris On 8/23/05, Brett Porter [EMAIL PROTECTED] wrote: what do the modules do? A packging of POM is appropriate for pom-only (usually a parent element). - Brett On 8/16/05, Rizwan Merchant [EMAIL PROTECTED] wrote: Hi, I have a project with a number of sub-modules. I need to specify in some of the sub-modules that those modules should not be jar-red. Basically, I want to call the m2 install command on the head project, but jar only some of the sub-modules. Is there an option for the packaging element that will accomplish this? thanks. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] @parameter, etc
Is there any documentation for the Javadoc annotations for m2 Java-based Mojos?? In particular I am interested in @parameter (and it's follow on syntax like; expression=). If not, could someone please point me at the appropriate source project to read the code in... (unfortunately, there are so many top-level source projects in m2 that it is a daunting task to unearth what's where) Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] project.artifacts Classpath, etc.
Greetings, I am trying to figure out how to pass on the Classpath to Ant. I know how to do this programmatically in Ant (e.g. project.setProperty) . What I am trying to work out is how pass on the Classpath from the *plugin*. By trial and error, I see that ${project.artifacts} results in a HashSet of JARs for the *project* -- not the plugin. I have a couple of questions 1) Is there a relatively comprehensive list of standard properties (e.g. project.artifacts) somewhere?? (i.e. Is there a plugin.artifacts ?? -- How would one know that??) I apologize in advance if this is in the docs somewhere -- I have looked through them, and don't see anything -- but may have overlooked them. 2) How does one know what the Java (or whatever) equivalent of a property would be. (e.g. project.artifacts converts to a HashSet -- How would one know that without resorting to trial-and-error??) 3) Are there shortcuts like plugin.getDependencyPath( axis:ant ) in maven2. (BTW: I do not want to use Marmalade. I am interested only in using either Java and/or Ant) Thanks, -- Chris Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] project.artifacts Classpath, etc.
Thanks much for your answer. When a plugin is called, I'm confused as to what Classpath the plugin itself gets. I see the project gets what I would expect, the dependencies from the POM -- at least that is what I see in project.artifacts. But the plugin doesn't seem to get it's dependencies... When I print System.getProperty(java.class.path) I see only:: [INFO] current Classpath= c:\cwb-tools\ant\maven-2.0-beta-cwb/core/boot/classworlds-1.1-alpha-2.jar Is there a set of properties for plugins like there is for project (i.e. plugin.artifacts)?? Does classworlds take care of this somehow?? I know that, for example, Ant must be on my Classpath because teh plugin is able to invoke it... Thanks, -- Chris On 8/23/05, Trygve Laugstøl [EMAIL PROTECTED] wrote: On Tue, Aug 23, 2005 at 05:52:59PM -0500, Chris Berry wrote: Greetings, I am trying to figure out how to pass on the Classpath to Ant. I know how to do this programmatically in Ant (e.g. project.setProperty) . What I am trying to work out is how pass on the Classpath from the *plugin*. By trial and error, I see that ${project.artifacts} results in a HashSet of JARs for the *project* -- not the plugin. I have a couple of questions 1) Is there a relatively comprehensive list of standard properties (e.g. project.artifacts) somewhere?? (i.e. Is there a plugin.artifacts ?? -- How would one know that??) I apologize in advance if this is in the docs somewhere -- I have looked through them, and don't see anything -- but may have overlooked them. Expressions that use the ${project..} prefix will query the current MavenProject object. Currently there doesn't seem to be a published javadoc site for the maven-project project so you'll have to read the sources for now. But it's worth noticing that the MavenProject object closely mimics the Model object which is documented in [1]. i.e: if you have the expression ${project.build.sourceDirectory} you would get the value foo from project build sourceDirectoryfoo/sourceDirectory ... 2) How does one know what the Java (or whatever) equivalent of a property would be. (e.g. project.artifacts converts to a HashSet -- How would one know that without resorting to trial-and-error??) See the first answer, when referencing ${project} you're querying a MavenProject object. 3) Are there shortcuts like plugin.getDependencyPath( axis:ant ) in maven2. (BTW: I do not want to use Marmalade. I am interested only in using either Java and/or Ant) ${project.artifactMap} Artifacts in the map are keyed using: import org.apache.maven.artifact.ArtifactUtils; ArtifactUtils.versionlessKey( String groupId, String artifactId ) [1]: http://maven.apache.org/maven2/maven-model/maven.html -- Trygve -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDC61j4EbM92cyCUURAiAtAJ4/EkD5wsLn86i/9P05bSJOAarTzgCfeAzC XqCEOcF0zKp5hx/9KEyrCIc= =VEdv -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] project.artifacts Classpath, etc.
Thanks John, I guess what would be most helpful would be a list of what properties one can access. One can figure out types by trial-and-error -- the compiler will let you know. But there is really no guessing the property names. Although I gather that the Model (the hierarchy of XML elements) is transparently reflected by corresponding properties (e.g. project.build.plugins). Is that correct?? But other properties -- like those for plugins -- are not obvious. Is there any way (some API) to simply print all available properites (similar to System.getProperties())?? That would be very convenient. Thanks, -- Chris On 8/23/05, John Casey [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris, If you're looking to retrieve only a particular dependency of a plugin (the dependencies of the plugin project are what form the plugin's classpath), then you might do well to use ${plugin.artifactMap}. This Map instance is keyed by an artifact's groupId:artifactId, and you can use org.apache.maven.artifact.ArtifactUtils.versionlessKey( String groupId,String artifactId) as a standard way of accessing it. The values are org.apache.maven.artifact.Artifact instances, IIRC. If you want to get the actual jar, though, you can call Artifact.getFile() which should return the jar file used for that artifact. Sorry to say that the documentation is a little weak right now, as we're still killing bugs and firming up the last niggling design issues. As you can see, there is a lot of information missing. Until we can firm up our documentation, please don't hesitate to keep asking questions. This will have the added benefit of showing us how best to document the system. hope that helps, - -john Edwin Punzalan wrote: | To get the artifacts that's relative only to your plugin, you can use | ${plugin.artifacts}. | | Its the same as ${project.artifacts} except the project object is your | plugin. | | | | Chris Berry wrote: | | Thanks much for your answer. | When a plugin is called, I'm confused as to what Classpath the plugin | itself gets. I see the project gets what I would expect, the | dependencies from the POM -- at least that is what I see in | project.artifacts. | | But the plugin doesn't seem to get it's dependencies... When I print | System.getProperty(java.class.path) I see only:: | [INFO] current Classpath= | c:\cwb-tools\ant\maven-2.0-beta-cwb/core/boot/classworlds-1.1-alpha-2.jar | | Is there a set of properties for plugins like there is for project | (i.e. plugin.artifacts)?? | | Does classworlds take care of this somehow?? I know that, for example, | Ant must be on my Classpath because teh plugin is able to invoke it... | | Thanks, | -- Chris | | | On 8/23/05, Trygve Laugstøl [EMAIL PROTECTED] wrote: | | | On Tue, Aug 23, 2005 at 05:52:59PM -0500, Chris Berry wrote: | | | Greetings, | I am trying to figure out how to pass on the Classpath to Ant. I know | how to do this programmatically in Ant (e.g. project.setProperty) . | What I am trying to work out is how pass on the Classpath from the | *plugin*. By trial and error, I see that ${project.artifacts} results | in a HashSet of JARs for the *project* -- not the plugin. | I have a couple of questions | | 1) Is there a relatively comprehensive list of standard properties | (e.g. project.artifacts) somewhere?? (i.e. Is there a plugin.artifacts | ?? -- How would one know that??) I apologize in advance if this is in | the docs somewhere -- I have looked through them, and don't see | anything -- but may have overlooked them. | | | Expressions that use the ${project..} prefix will query the current | MavenProject object. Currently there doesn't seem to be a published | javadoc site for the maven-project project so you'll have to read the | sources for now. | | But it's worth noticing that the MavenProject object closely mimics the | Model object which is documented in [1]. i.e: if you have the expression | ${project.build.sourceDirectory} you would get the value foo from | | project | build |sourceDirectoryfoo/sourceDirectory |... | | | | 2) How does one know what the Java (or whatever) equivalent of a | property would be. (e.g. project.artifacts converts to a HashSet -- | How would one know that without resorting to trial-and-error??) | | | See the first answer, when referencing ${project} you're querying a | MavenProject object. | | | | 3) Are there shortcuts like plugin.getDependencyPath( axis:ant ) in | maven2. (BTW: I do not want to use Marmalade. I am interested only in | using either Java and/or Ant) | | | ${project.artifactMap} | | Artifacts in the map are keyed using: | | import org.apache.maven.artifact.ArtifactUtils; | ArtifactUtils.versionlessKey( String groupId, String artifactId ) | | [1]: http://maven.apache.org/maven2/maven-model/maven.html
[m2] javadocs??
I suppose the javadocs for maven2 are somewhere on the site -- but I cannot locate them. The old, familiar Project Reports is missing. And I've trolled thru most pages looking. I also tried to run m2 site:site on my local SVN checkout (it died). So I'm at a loss... Are there any javadocs available for m2?? Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] plugin.getDependencyPath
Hi, In the bad old days of Jelly, we could type something like:: plugin.getDependendcyPath( 'axis:ant' ); And you got back the full path to a JAR -- so we could use it as:: ant:path id=axis.classpath ant:pathelement path=${plugin.getDependencyPath('axis:axis')}/ Is there an equivalent helper function like this for Java?? BTW: FWIW: I have no interest in using Marmalade. I want to use *only* Java + Ant when developing my plugins. In fact, I plan to do as much as possible with Ant and simply fire it from the Maven plugin structure. There is no reason to reinvent the wheel. Ant provides Tasks to do probably 95% of what I need done. Is well understood, well supported, and well documented. I see this sort of marraige between Maven and Ant as powerful combination. Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] plugin.getDependencyPath
Hi Kenney, I am using your plugin. Thanks. In fact, I've already extended it to allow it to set Ant's message level (so you can see Ant's echo when you need to). I believe that Ant + Maven is the sweet spot. What I'm trying to discern is the cleanest way to accomplish this. Say you want to use an extended Ant -- pulling in, say, the Axis Ant Tasks, or the ant-contrib Tasks, or whatever. I'm thinking that I will simply extend AbstractAntMojo with, say, AxisAntMojo. This will have the proper dependencies (axis:ant, etc) and when I call ant inheritAll=true inheritRefs=true antfile= -- then I should be able to find these Tasks on the inherited Classpath (right??) I'm hoping that I will be able to ask the Plugin for it's resources -- so that I can find the Ant buildfile easily. I'm still figuring it out... Thanks again, -- Chris On 8/24/05, Kenney Westerhof [EMAIL PROTECTED] wrote: On Wed, 24 Aug 2005, Chris Berry wrote: Hi, In m2 you just specify that jar as a dependency in the pom of the plugin. It's then automatically added to the runtime classpath of that plugin's execution environment. Further, you can access the Plugin object and it's properties in a Mojo. Btw, if you plan to use ant in your plugins, have a look at the maven-antrun-plugin. If you plan to use it, you should make your plugin depend upon it, and extend AbstractAntTask. You can then create tasks, add them to a Target object, and execute them (using a parent method). (the plugin is part of the m2 svn repository). -- Kenney Hi, In the bad old days of Jelly, we could type something like:: plugin.getDependendcyPath( 'axis:ant' ); And you got back the full path to a JAR -- so we could use it as:: ant:path id=axis.classpath ant:pathelement path=${plugin.getDependencyPath('axis:axis')}/ Is there an equivalent helper function like this for Java?? BTW: FWIW: I have no interest in using Marmalade. I want to use *only* Java + Ant when developing my plugins. In fact, I plan to do as much as possible with Ant and simply fire it from the Maven plugin structure. There is no reason to reinvent the wheel. Ant provides Tasks to do probably 95% of what I need done. Is well understood, well supported, and well documented. I see this sort of marraige between Maven and Ant as powerful combination. Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - 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]
Re: [m2] plugin.getDependencyPath
Comments inline. Thanks, -- Chris On 8/24/05, John Casey [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 One thing we're considering adding to m2 in the very near term is the concept of dependencies that are tied directly to a plugin definition. Don't we already have this?? I have dependencies defined for my plugin and they are all there when I call my Ant tasks (using an extended version of AbstractAntMojo). I have verified this. As for locating plugin resources, it depends on what you're looking for. If it's bundled with the plugin or one of its dependencies, you should be able to use ClassLoader.getResource(..) to retrieve it by name. OTOH, if you're trying to get the path to one of the plugin dependencies, you can execute something similar to the following: /** ~ * @parameter expression=${plugin.artifactMap} ~ * @required ~ * @readonly ~ */ private Map pluginArtifacts; public void execute() { ~ String key = ArtifactUtils.versionlessKey( depGroupId, depArtifactId ); ~ Artifact artifact = (Artifact) pluginArtifacts.get( key ); ~ File depPath = artifact.getFile(); Does this answer your question, or am I misunderstanding? Unfortunately, this doesn't really work in my case. Say I have an Ant build file named axis.xml and I bundle this into my Plugin JAR. I cannot access this as a File. Yes, it has a path in the URL sense (i.e jar:/...) But Ant wants a regular old file that I can get an absolute path to. (BTW: Ant is just an example. The same could hold true for many other situations) Is there any way to bundle files (such as axis.xml) into the repository -- such that I could access it directly as,say, ${localRepository}/blah/plugins/axis-plugin/1.0-SNAPSHOT/axis.xml Of course, I could unjar the Plugin into /target -- but that seems like a hack... Thanks for all your help insight, Cheers, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] properties
Hi Ashley, I'm told it will look like this:: properties keyvalue/key So you might have properties foobar/foo And, thus, you can use ${foo} elsewhere Of course, the Mvaen Guys shoudl confirm this ;-) Cheers, -- Chris On 9/13/05, Ashley Williams [EMAIL PROTECTED] wrote: But where does the name go - you just have the value written there. Also How do you define more than one property? I was hoping it would be something like: project properties property namemyname/name valuemyvalue/value /property property namemyname2/name valuemyvalue2/value /property /properties /project AW On 13 Sep 2005, at 02:53, John Casey wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Actually, no. It's *like* the properties defined in profiles in syntax, but this is a properties section that is specified as a direct child of the project element. So: project ~ ... ~ properties ~namevalue/name ~ /properties /project Cheers, john Allan Ramirez wrote: | I guess your'e referring with the profiles, here's a link for your | reference | | http://maven.apache.org/maven2/profiles-overview.html | | hope this helps, | | Regards, | -allan | | Ashley Williams wrote: | | Heard that there is a new properties tag underneath root project, but | can't guess the syntax - anyone know? | | - | 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] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFDJjEwK3h2CZwO/4URAiApAJ9e9gYTPqSCvHs27kTim2tB5BM3GACgmGS/ nl9MEBBYZBn7X2A0MwpvzSI= =AINP -END PGP SIGNATURE- - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] antfile plugin (was: whether to use ant)
Greetings, There was a recent thread on whether to use ant. It is a long thread (19+ posts) and became divergent. So rather than bury that post there, I will raise it here to the top level. Like people in that thread, I firmly believe that a happy marriage between Maven and Ant is in the best interest of all. When maven began it was really intended to be an easy way to share Ant build scripts. We were all tired of reinventing the wheel. Every time we started a new Ant project we had to copy in and customize a set of Ant build scripts. With every new Ant project, we violated the Don't Repeat Yourself principle. Enhancements/bug fixes had to be hand propagated across projects. Over time, maven became more than this. It added Good Stuff like the POM (a holistic recipe for the project) and dependency management. It added Bad Stuff, like Jelly. That's all water under the bridge. IMO, maven should emphatically refrain from reinventing the wheel. Ant is the defacto Java build tool, although it is in no way limited to Java. Ant already does ~90+% of the individual Tasks required by a build system. And what it doesn't do is typically provided by others wishing to either augment Ant's deficiencies (e.g. ant-contrib) or wishing to have their tools adopted (e.g. axis-ant). Ant is cross-platform, and is intended as a build tool -- not as a general scripting language. Ant's original intent was simply to be a better make. Maven should concentrate on being the glue that holds it all together -- providing value in reusability, repeatability, and holistic project management. To this end, I have written an Antfile Plugin. It extends the AntRun plugin, and simply allows you to delegate to an Ant buildfile. The buildfile is rolled into the plugin jar, and then, is unzipped from that jar into the /target and is run during the build. One simply extends the AntFile plugin with their own plugin, declaring the buildfile, pulling config info from the POM and passing them on as properties to Ant. It's very simple to use. (BTW: I have built an Axis plugin on top of this, validating it's usage pattern) I passed my AntRun plugin to John Casey (one of the Maven gurus), and I hope that The Powers That Be will allow it into the HEAD of the SVN tree. Cheers, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] antfile plugin (was: whether to use ant)
Hi Ashley, comments inline. Cheers, -- Chris On 9/15/05, Ashley Williams [EMAIL PROTECTED] wrote: (Chris) Pleased to see fellow users steering Maven more in the direction of ant and I have a few questions about this new plugin. 1. I'm concerned that I have to write java code in order to call ant tasks. For example to support the tomcat task, would I or somebody else have to have extended the antfile plugin? The Java code is trivial. The real work is all handled by an abstract class. The reason we have to have to write a bit of Java is because a) m2, at least currently, has no way to do annotation-based pulls of POM configuration properties in any but the base class -- when these classes are in separate jars. b) But even if it could, you will still need to pull these properties and pass them on to Ant. That's' pretty much all that the Java code does. (although, yes, I think this could maybe be generalized when (a) is fixed) c) We want reusable Plugins. (E.g. I have an Axis plugin that I use in many projects.) This plugin contains it's Ant buildfile (e.g. axis-build.xml), and needs to have a Mojo associated with it (AFAIK). There are specifics to each AntFile usage such as what target to call, the name of the buildfile (it cannot be build.xml because it will likely clash with other AntFile uses), and properties (with defaults). IMO, this is not necessarily a Bad Thing. 2. Is this a stop gap plugin until John 'persuades' ;) his client to let him reuse some wrapper archetecture to dynamically create ant property delegates - or does it achieve something slightly different? Again, I think for reuasability you will want to have specific plugins which handle chunks of your build, which have to be layered into the m2 phases. So you might have an Ant-based build that you're converting to m2. Let's assume that ~80% is directly convertible to m2, and there are, say, 2 things that are specific to your needs-- at, say, 2 different phases of the Ant build. These should be pulled into 2 m2 plugins that you layer into the general m2 sequence. It is my experience that if you need some ability in one build, you will likely need it in your next build. They are typically company build policy and not build-specific 3. Are you talking about invoking isolated ant tasks or whole ant build files or both? Are you suggesting that ant basically becomes another plugin language encapsulated in its own build file - could be very useful. Absolutely. I would like to see m2 embrace Ant as a plugin language -- perhaps as it's primary extension language. IMO, m2 would get tremendous adoption if it took this stance. I have no desire to reinvent everything that Ant already does. And, as we all know, it is pretty easy to scrounge up Ant Tasks that do whatever you're after somewhere on the Net. So why recode it and debug it. Either programmatically build the Tasks in your Mojo (which can get a little long-winded) -- or just use a buildfile... I'd definitely welcome the option to embed ant tasks directly within a pom, preserving the exact same ant syntax, like I think antrun does - only benefiting from automatic maven properties and invoked in the same jvm as discussed a while ago. Agreed. But this is isolated to that POM, so it's useful, but not reusable. There will be cases where this makes the most sense, and case where reusability is important. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] antfile plugin (was: whether to use ant)
On 9/15/05, Kenney Westerhof [EMAIL PROTECTED] wrote: :) Well, I agree mostly, so far. So, it's back to Jelly, or, with m2, marmalade. I think an 'ant' scripting language is in the works, next to beanshell / marmalade / java, maybe that'll be the solution then. No mo task wrapping, just native ant plugins. Jeez, I hope not. The last thing we need is another Jelly. ;-) BTW: I'm not certain what you are referring to by 'ant scripting language' ?? But today one can do most scripting that's required using the ant-contrib tasks -- they fill the void nicely... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] antfile plugin (was: whether to use ant)
On 9/15/05, Ashley Williams [EMAIL PROTECTED] wrote: ROFL! Dude, I must put the record straight: Ashley not Ashleigh ... Glen not Glenda if you get what I mean!!! eeek. sorry about that. Although you completely blew my mental image ;-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] antfile plugin (was: whether to use ant)
If you are interested in seeing this stuff in action I have entered an enhancement request in Maven's Jira. (Per John's request) This Jira entry contains a ZIP which has a full example of what I'm describing -- including the axisant plugin -- which extends the antfile plugin. And a my-app, which shows the axisant plugin in action -- completing the usage picture. The Jira entry is under maven-antrun-plugin BTW: Kenney, this also contains some mods to enable Ant echo Cheers, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] reasons for sticking with maven
Ashley, I recommend that you pull my AntFile Plugin (as a ZIP) from the M2 Jira. I think you will see that this provides exactly what you're asking for -- a simple, clean blending of Ant w/ Maven (Included is an Axis WSDL2Java plugin that demonstrates it's usage pattern). You script with Ant, roll the script into a reusable Plugin, and execute your script (via the Plugin) from the appropriate Maven Phase. Cheers, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] reasons for sticking with maven
Yes, it is the equivalent. But one thing confuses me, it's not about executing a java process (per se) -- it's about executing Ant. And it's not about maintenance. I think the heart of the discussion is reuse. Not reinventing what Ant already does. Providing a mechanism for reuse and versioning of Ant scripts. Reusing Ant scripts (or pieces of them) from existing builds, when converting to Maven. To the plugin developer, they can simply build an Ant script as they always do, and a simple Mojo that passes parameters (and defaults) from the POM in to the Ant script and executes it. Obviously, I could have done it all within the Mojo myself, or I could have called Ant programmatically, or I could just script the Ant. There are many ways to get there. To the plugin user, they don't know which technique is in use, and shouldn't care... On 9/20/05, Wendell Beckwith [EMAIL PROTECTED] wrote: Just for clarification are you suggesting that a plugin that needs to execute a java process should be designed as an ant script, and the plugin would simply pass parameters to the ant script? I ask because I don't see how this is less maintenance than my current plugin that provides intelligent defaults in the mojo and just needs to pass theses parameters along with any the user changed to the java process. Whenever there are plugin changes, I still go to the mojo in my design or an ant script in your design, correct? Wb On 9/20/05, John Casey [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've actually done something just like this in the past, in order to call a Make-based build. IMO, you want to wrap a command line call in a plugin, to formalize the parameters - required and optional - which constitutes a valid invocation of that executable. Otherwise, it's prone to breaking, misuse, and cut-and-paste maintenance style. In short, it isn't robust, and doesn't scale well. Anything where execution logic is embedded in the POM will suffer from this, IMO - including the antrun and execute plugins in the mojos project. A better solution for Ant would be to build the plugin around the Ant script/scriptlet, and bundle that script into the plugin jar...then parameterize the input configuration. Then, the script can climb the maturity curve, and is truly reused with a single point of maintenance. - -john Vincent Massol wrote: | |-Original Message- |From: Wendell Beckwith [mailto:[EMAIL PROTECTED] |Sent: mardi 20 septembre 2005 19:15 |To: Maven Users List |Subject: Re: [m2] reasons for sticking with maven | |John is basically stating the very thing that I'm against in the statement |below. I have a 3rd party command line utility from |www.agitar.com http://www.agitar.comhttp://www.agitar.com, |that basically does unit tests against our code. I want to write (and have |started writing) an M2 plugin to execute the java command line for the |agitation process from my plugin. All I need now to complete my plugin |besides more hours in a day is a plugin that will allow me to execute a |java |command line. Now my plugin will integrate with the maven lifecycle during |the test phase. However, first I'm told to use the maven-execute-plugin |and |then another dev states that it's bad and wants to see it eliminated, I'm |left thinking WTF!? This *helps* me adopt maven and the process, not |hinders |it. My whole purpose for writing the plugin was so that I could make the |plugin once and the other groups here and else where since I would open |source it would be able to reuse it. Is this not what maven is for? | | | Just to muddy the waters: why don't you use commons-exec from your plugin's | java code to execute your process? | | [snip] | | Thanks | -Vincent | | | - | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | | | -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFDMEdFK3h2CZwO/4URAjLaAKCo3sOGgRHJYg0nTR66E38EUaxN9wCfRY9m 3JIbhwsALTmuwn5OB/7gG9k= =WOfH -END PGP SIGNATURE- - 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]
Re: [m2] Antfile plugin
This is it Cheers, -- Chris allows use of Ant build files - Key: MNG-897 URL: http://jira.codehaus.org/browse/MNG-897 Project: Maven 2 Type: Improvement Components: maven-ant-plugin Versions: 2.0-alpha-3 Reporter: Chris Berry Attachments: antfile.zip Cheers, -- Chris On 9/21/05, Ashley Williams [EMAIL PROTECTED] wrote: On 21 Sep 2005, at 09:26, Ashley Williams wrote: Hi Chris, I've mislaid the link to your plugin - can you post it up again?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SocketException downloading JARs
Greetings, I am having trouble building the latest/greatest m2 HEAD from SVN. I am getting a SocketException: Invalid argument or cannot assign requested address when it is trying to download a JAR from http://repo1.maven.org What is odd is that 1) I can see POMs that have been loaded into my .m2/repository -- all from maven and all SNAPSHOTs -- so it seems odd that I can download from one repo (http://snapshots.maven.codehaus.org) but not the other?? 2) I can do a wget of the JAR in question without any problem 3) I can browse the ibiblio maven2 repo just fine from this machine I'm stumped. Any ideas?? Note; this is on a freshly built Fedora 4 box (no proxy) and it could be that I've not configured something properly -- although 1-3 above seem to indicate that all is well?? Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SocketException downloading JARs
I wonder if this has something to do with redirects?? http://repo1.maven.org redirects to ibiblio but the SNAPSHOTs repo does not redirect... Although I don't know what to do with that info ;-) On 9/21/05, Chris Berry [EMAIL PROTECTED] wrote: Greetings, I am having trouble building the latest/greatest m2 HEAD from SVN. I am getting a SocketException: Invalid argument or cannot assign requested address when it is trying to download a JAR from http://repo1.maven.org What is odd is that 1) I can see POMs that have been loaded into my .m2/repository -- all from maven and all SNAPSHOTs -- so it seems odd that I can download from one repo (http://snapshots.maven.codehaus.org) but not the other?? 2) I can do a wget of the JAR in question without any problem 3) I can browse the ibiblio maven2 repo just fine from this machine I'm stumped. Any ideas?? Note; this is on a freshly built Fedora 4 box (no proxy) and it could be that I've not configured something properly -- although 1-3 above seem to indicate that all is well?? Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] properties
Hi John, Don't know if it's a bug but properties m2.version2.0-beta-2-SNAPSHOT/m2.version /properties . version${m2.version}/version does NOT work. But, without the . in the property name, it does work. I.e. properties m2version2.0-beta-2-SNAPSHOT/m2version /properties . version${m2version}/version This works. Cheers, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] properties
Actually it was just a snippet ;-) The version was really meant to be in a plugin definition (I just got lazy). Although I could see one interested in, say, having a single inherited version when building multiple projects -- so I could see it's legitimate use. In the end, it's hard to build a powerful tool that isn't also dangerous. You can cut your finger off w/ a skill saw, but that doesn't make it any less useful and necessary -- it is assumed that you will be careful. Cheers, -- Chris On 9/26/05, John Casey [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 this should work now (committed it this afternoon). However, I should note that in Chris' email he was using model properties (POM-level properties) to set the version of the POM...to me, this has a bad smell, since the project version may be influenced by active profiles, etc. way too easily, which in turn may cause a reproducability problem. With model properties and profile properties, you should be really careful to avoid letting users override the sort of core project information (groupId, artifactId, version, packaging, etc.) by simply providing a profile in their settings.xml...at least, IMHO. Cheers, John Brett Porter wrote: | I guess a lot of people are going to want to use dotted properties, so | we should support it. | | It probably is attempting to do reflection on m2. | | - Brett | | | On 9/26/05, Chris Berry [EMAIL PROTECTED] wrote: | |Hi John, |Don't know if it's a bug but |properties |m2.version2.0-beta-2-SNAPSHOT/m2.version |/properties |. |version${m2.version}/version | |does NOT work. | |But, without the . in the property name, it does work. I.e. |properties |m2version2.0-beta-2-SNAPSHOT/m2version |/properties |. |version${m2version}/version |This works. |Cheers, |-- Chris | |- |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] | | | -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFDOJALK3h2CZwO/4URAvnbAJ44JReEYzlyF4xXj7yXkYZQygRQkQCggPlt 4Xwqr6brD0Ite8MQAdXE0yM= =NauG -END PGP SIGNATURE- - 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]
Re: [M2] Using Spring with Maven / Eclipse
I don't think you can do what you want with Spring. It cannot have a master set of dependencies because Spring is split up into a pay-as-you-go set of JARs (i.e there are many JARs available -- but you use a subset). Once you know that subset, m2 has a cool way of building Composite POM Projects -- where you simply have a project that has POM packaging and only declares dependencies (e.g. teh set of Spring JARs applicable to your app) in it's pom.xml. So your app declares a dependency on the Composite POM which, in turn, brings in it's dependencies. On 9/28/05, Jose Gonzalez Gomez [EMAIL PROTECTED] wrote: The 1.2.4 pom neither has the dependency information, at least in the maven2 respository (http://www.ibiblio.org/maven2/springframework/spring/1.2.4/spring-1.2.4.pom). I have taken a look at the maven1 respoitory and I was only able to find the 1.1.2 pom (http://www.ibiblio.org/maven/springframework/poms/spring-1.1.2.pom). Best regards Jose 2005/9/28, Stephen Duncan [EMAIL PROTECTED]: You should be able to look at the 1.2.4 poms in the repository and figure them out. I wouldn't expect very many of the dependencies to change. -Stephen On 9/28/05, Nicolas Chalumeau [EMAIL PROTECTED] wrote: -- Forwarded message -- From: Jose Gonzalez Gomez [EMAIL PROTECTED] Date: 28 sept. 2005 19:12 Subject: Re: [M2] Using Spring with Maven / Eclipse To: Nicolas Chalumeau [EMAIL PROTECTED] http://jira.codehaus.org/browse/MEV-98 Meanwhile, anybody has a list of spring dependencies to include them manually? 2005/9/28, Nicolas Chalumeau [EMAIL PROTECTED]: post an issue at http://jira.codehaus.org/browse/MEV for it Nicolas 2005/9/28, Jose Gonzalez Gomez [EMAIL PROTECTED]: Hi there, I'm trying to use Spring / Maven / Eclipse in one of my projects with no success. I have included the following dependency in my pom: dependency groupIdspringframework/groupId artifactIdspring/artifactId version1.2.5/version /dependency When I try to generate the Eclipse project (m2 eclipse:eclipse) I only get spring-1.2.5.jar added to the project classpath, so whenever I try to launch my application it fails due to missing spring dependencies. I've taken a look at ibiblio.org/maven2, and all the spring poms seem to include no dependency information, so... am I doing anything wrong or should I include all the Spring dependencies manually? Are the Spring poms incorrect? If this is the case, is it normal to have incorrect poms with missing dependencies in the ibiblio repository? Thanks in advance, best regards Jose - 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] -- Stephen Duncan Jr www.stephenduncanjr.com - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
repositories in settings.xml
Greetings, Can one declare a repository at the top level of the settings . In other words, outside of a profile?? Many of us use a few local repos -- say, a local mirror of ibiblio or a local repo for internal JARs. -- common to all projects, and it makes sense to me that this is a global setting per user. If not, could someone explain profiles?? I get the idea behind them -- just not how they fit into the procedure?? It appears that one does the following:: m2 -P myglobalprofile install which would seem a bit verbose to get at global settings -- where the alternative is simply m2 install Also it would appear that, since one can declare multiple profiles; m2 -P myglobalprofile,mylocalprofile install then repositories must be additive?? Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best Solution to Parent POM Chicken Egg Problem
As I've said previously, I do not believe that repository info has *any* place in a POM -- at any level of the hierarchy. A POM should be thought of as a recipe. And with any recipe, the recipe itself does not prescribe where to shop for the ingredients!! This is especially important for projects, because one cannot tell the different points in the product cycle to use the same repos. E.g. where I work, there is a build team that wants to explicitly build all packages headed into integration testing and finally on into Production. They will never point at any repos that development uses. Conversely, Dev has it's own repos -- for interim packages, for SNAPSHOTS, etc. One can think of the Production repo as a subset of the Dev repo, etc. IMO, repo info should *always* come from external settings.xml -- and that, if anything, settings.xml should allow an inherited hierarchy (with overrides) -- just like build.properties did in maven1. This is a powerful idiom. I was sorry to see it gone in m2. Yes, I get that arbitrary properties in build.properties can lead to POM recipes that cannot be generally satisfied -- i.e. some prop is required but undefined in the POM and comes from build.properties, and thus, what value should it have?? The recipe is incomple. But settings.xml is not arbitrary. It is limited to it's DTD. My $.02, -- Chris On 9/30/05, Stephen Duncan [EMAIL PROTECTED] wrote: What is truly the preferred/best solution to the chicken the egg problem with parent POM's? (Where your parent POM might define the internal repository to use, but a project defines it's parent as this POM, which is stored in the internal repository, and therefore how do you get it the first time?) Brett Porter said in one mailing list entry: for information common to all projects, we recommend using an organisation-wide parent POM that declares all the information. Of course, this is a chicken and egg probem - you need the repository to define the repository. The advantages to this are still: - if you want to change the repository location you only need to update that pom, not individual users computers (they get the new pom from the old repository, and that is used for the new definition) - you can share standard settings - organisation information, plugin configuration, source layout, among all projects Kenney Westerhof said in another mailing list entry: This can cause a problem though: you usually define the artifact repository in the root pom; if you check out a submodule, m2 might not find the root pom in the correct repository; kinf of a chicken and egg problem. A solution is to specify a company wide (or project local) repository in your settings.xml. I had started going down the route of always specifying the internal repository in every POM I have, so that they could all be built without requiring the user to know the details of the repository and setting that up in settings.xml. When I changed to password-protecting this internal repository, I've now required the person checking out a project to at least define the password in the sites section of settings.xml, so that benefit seems decreased. Is the proper compromise to specify the team-wide repository in the Parent POM, and then specify the repository to get that POM in settings.xml? -- Stephen Duncan Jr www.stephenduncanjr.com - 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]
Re: Best Solution to Parent POM Chicken Egg Problem
Kenney, It's not about taste. Defining repos in teh POM are a real problem. Here's an example; I recently got a POM from someone that had the SNAPSHOT repo defined in the POM. Fine, as long as you could get at it, which we couldn't. But that aside, this repo element defined snapshots enabledtrue/enabled /snapshots releases enabledfalse/enabled /releases So now let's assume I'm a build engineer that will *never* allow SNAPSHOTs. So what are they to do -- edit the POM to remove this statement. That seems very wrong to me. These guys don't edit POMs -- they build things. (i.e. check out on v1.1.2 tag, build it, and deploy the artifacts) And if they then check this altered POM back into the SCM, (which they should for repeatability and proper tagging) what happens to teh develoer that needs to use SNAPSHOTs. They would have to change it back. And on and on... Does that seem right?? What am I missing?? In my opinion, repo info is orthogonal to the project definition, Coupling them seems a mistake, particularly juxtaposed against large organizations with tight change control and production build policies. Cheers, -- Chris On 9/30/05, Kenney Westerhof [EMAIL PROTECTED] wrote: On Fri, 30 Sep 2005, Stephen Duncan wrote: Brett's anwer (define repo @ pom) is the way to go. My 'settings.xml' solution is merely a convenient way to help locate that parent pom the first time - if you don't have that repository on the list, you're going to have to manually download (or use a lengthy commandline) to install the desired pom and it's parents. On the other hand, having a company wide repo specified in settings.xml gives them the power to decide what you can and cannot use (beside company-created artifacts). I think it's a matter of taste and convenience what's best for you. -- Kenney What is truly the preferred/best solution to the chicken the egg problem with parent POM's? (Where your parent POM might define the internal repository to use, but a project defines it's parent as this POM, which is stored in the internal repository, and therefore how do you get it the first time?) Brett Porter said in one mailing list entry: for information common to all projects, we recommend using an organisation-wide parent POM that declares all the information. Of course, this is a chicken and egg probem - you need the repository to define the repository. The advantages to this are still: - if you want to change the repository location you only need to update that pom, not individual users computers (they get the new pom from the old repository, and that is used for the new definition) - you can share standard settings - organisation information, plugin configuration, source layout, among all projects Kenney Westerhof said in another mailing list entry: This can cause a problem though: you usually define the artifact repository in the root pom; if you check out a submodule, m2 might not find the root pom in the correct repository; kinf of a chicken and egg problem. A solution is to specify a company wide (or project local) repository in your settings.xml. I had started going down the route of always specifying the internal repository in every POM I have, so that they could all be built without requiring the user to know the details of the repository and setting that up in settings.xml. When I changed to password-protecting this internal repository, I've now required the person checking out a project to at least define the password in the sites section of settings.xml, so that benefit seems decreased. Is the proper compromise to specify the team-wide repository in the Parent POM, and then specify the repository to get that POM in settings.xml? -- Stephen Duncan Jr www.stephenduncanjr.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - 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]
Re: [m2] using java web services
Hi Ashley, There may be a JAXB plugin that I'm unaware of ?? There is an Axis WSDL2Java plugin at mojo.codehaus.orghttp://mojo.codehaus.org . I have also written a WSDL2Java plugin that actually just offloads to an Ant build file to do all of the work. You could easily canibalize my work for JAXB. (It's in JIRA) The steps are essentially the same. BTW: Are you using JAXB2 and WSDLs?? Cheers, -- Chris On 10/3/05, Ashley Williams [EMAIL PROTECTED] wrote: I need to do some work with the java web services libraries, starting with some simple jaxb stuff so that I can generate my binding classes early on in the lifecycle. Is anything in development I can use, even if it means pulling code out of a svn repository? Thanks AW - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] using java web services
off-topic Hi Ashley, FWIW, given that (it sounds like) you are at the beginnings of hatching a data model (or rather a data-transfer-object model) -- I would highly recommend using WSDLs as teh primary artifact over XSDs (since you say this is for web services). WSDLs are an IDL -- where XSDs are just a part of the picture (the arguments). JAXB2 can consume WSDLs, although it is not widely advertized. And (AFAIK) JAXB2 does not suffer from some of the glaring warts of JAXB1. But keep in mind JAXB2 requires JDK 1.5. I tend to use Axis' WSDL2Java to generate my XML Beans It works against all of the WSDLs/XSDs we've put to it. We had many issues w/ JAXB1. If I were looking only at XSD to Java code generators, I would likely choose XMLBeans over JAXB. Cheers, -- Chris /off-topic On 10/3/05, Ashley Williams [EMAIL PROTECTED] wrote: Thanks Chris, though I'm not doing anything so heavyweight! I'm just trying to put an end to the days where I have to roll my own java data model from xml. There is something going down for jaxb because I came across the following link: http://jira.codehaus.org/browse/MEV-71?page=all so I think that because of licensing issues I'm supposed to create my own artifact for jaxb using this pom and my downloaded xjc jar file. As for wsdl, not using it yet simply because there aren't 37 hours in a day to look at it, but it's definitely on my radar ;) Cheers AW On 3 Oct 2005, at 17:27, Chris Berry wrote: Hi Ashley, There may be a JAXB plugin that I'm unaware of ?? There is an Axis WSDL2Java plugin at mojo.codehaus.orghttp://mojo.codehaus.org http:// mojo.codehaus.org http://mojo.codehaus.org . I have also written a WSDL2Java plugin that actually just offloads to an Ant build file to do all of the work. You could easily canibalize my work for JAXB. (It's in JIRA) The steps are essentially the same. BTW: Are you using JAXB2 and WSDLs?? Cheers, -- Chris On 10/3/05, Ashley Williams [EMAIL PROTECTED] wrote: I need to do some work with the java web services libraries, starting with some simple jaxb stuff so that I can generate my binding classes early on in the lifecycle. Is anything in development I can use, even if it means pulling code out of a svn repository? Thanks AW - 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]
Re: [m2] using java web services (off topic)
inline, cheers, -- Chris BTW: if you need to followup -- we should probably take the discussion offline ;-) ([EMAIL PROTECTED]) On 10/3/05, Ashley Williams [EMAIL PROTECTED] wrote: off-topic At the moment I'm just looking at code gen so it's interesting that you recommend xmlbeans over jaxb - xmlbeans is more feature rich and could be faster because it has a lazy loading feature. That said, I've not used it -- although juxtaposed against JAXB (at least the Sun implementation) I wish we had given it a go... We went w/ JAXB because it is a standard. Unfortunately, it was a can of worms as well... The biggest warts; 1) JAXB generates an impl-specific class with the same name (ObjectFactory) for every XSD you process. This can, and often will, cause conflicts. If you have two XSDs that you process independently in the build and they generate into the same package then the last one in will win. As you might imagine, this is a big problem. Sure you can work around it by putting each XSD (and all the XSDs it may chain in) into it's own namespace -- but then you get massive duplication of generated code (if XSDs are shared -- i.e both A.xsdand B.xsd include C.xsd.). BTW: note that WSDL2Java doesn't have this issue. It generates a unique names (based on the WSDL) for all classes it generates. I don't know what xmlbeans does?? 2) xjc dumps core often (at least for us). You have to kick the Stack size up to get it somewhat stable. It's been quite problematic... 3) JAXB is way too verbose. It generates a boat load of classes to represent an XSD. It could and should be much more terse. In fact, JAXB2 supposedly corrects this. (But like I said, JAXB2 requires Java 1.5 -- which we cannot yet use) do you have any links that compare the two? I'd love to know about these warts. You're right about centering on something like wsdl, but I have to start somewhere! I'd start w/ WSDL -- it's where you will eventually end up . ;-) wsdl2java looks great, just the sort of thing that gives me confidence in Maven. off-topic On 3 Oct 2005, at 20:12, Chris Berry wrote: off-topic Hi Ashley, FWIW, given that (it sounds like) you are at the beginnings of hatching a data model (or rather a data-transfer-object model) -- I would highly recommend using WSDLs as teh primary artifact over XSDs (since you say this is for web services). WSDLs are an IDL -- where XSDs are just a part of the picture (the arguments). JAXB2 can consume WSDLs, although it is not widely advertized. And (AFAIK) JAXB2 does not suffer from some of the glaring warts of JAXB1. But keep in mind JAXB2 requires JDK 1.5. I tend to use Axis' WSDL2Java to generate my XML Beans It works against all of the WSDLs/XSDs we've put to it. We had many issues w/ JAXB1. If I were looking only at XSD to Java code generators, I would likely choose XMLBeans over JAXB. Cheers, -- Chris /off-topic On 10/3/05, Ashley Williams [EMAIL PROTECTED] wrote: Thanks Chris, though I'm not doing anything so heavyweight! I'm just trying to put an end to the days where I have to roll my own java data model from xml. There is something going down for jaxb because I came across the following link: http://jira.codehaus.org/browse/MEV-71?page=all so I think that because of licensing issues I'm supposed to create my own artifact for jaxb using this pom and my downloaded xjc jar file. As for wsdl, not using it yet simply because there aren't 37 hours in a day to look at it, but it's definitely on my radar ;) Cheers AW On 3 Oct 2005, at 17:27, Chris Berry wrote: Hi Ashley, There may be a JAXB plugin that I'm unaware of ?? There is an Axis WSDL2Java plugin at mojo.codehaus.orghttp://mojo.codehaus.org http:// mojo.codehaus.org http://mojo.codehaus.org http:// mojo.codehaus.org http://mojo.codehaus.org http://mojo.codehaus.org . I have also written a WSDL2Java plugin that actually just offloads to an Ant build file to do all of the work. You could easily canibalize my work for JAXB. (It's in JIRA) The steps are essentially the same. BTW: Are you using JAXB2 and WSDLs?? Cheers, -- Chris On 10/3/05, Ashley Williams [EMAIL PROTECTED] wrote: I need to do some work with the java web services libraries, starting with some simple jaxb stuff so that I can generate my binding classes early on in the lifecycle. Is anything in development I can use, even if it means pulling code out of a svn repository? Thanks AW --- -- 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
Re: [m2] how to reference lots of jar files
Hi Ashley, I had a similar issue for Axis -- It has many dependencies, which I wanted to keep grouped together - so that I can easily upgrade versions -- or keep Servers and my Axis WSDL2Java plugin easily in sync So I build a POM project -- i.e. a project (e.g. axis-deps-1.2.1) that's artifact is a POM. This POM has in it all of the Axis dependencies I need (Note that this deps list is actually user-specific -- some deps are always required -- and some only if you use those features) Then my POMs depend on this POM (as a dependency), which in turn, sucks in the Axis dependencies. This, I think, is what Brett was referring to... BTW: you will eventually need a local repo of deps that cannot be housed at ibiblio (e.g vendor jars, Sun jars, etc.). We have several local repos in fact -- a mirror of ibiblio, a repo for 3rd party jars not in ibiblio, a repo of in-house jars,... Cheers, -- Chris On 10/4/05, Brett Porter [EMAIL PROTECTED] wrote: that's what http://jira.codehaus.org/browse/MEV is for On 10/5/05, Ashley Williams [EMAIL PROTECTED] wrote: I get the hint! So if I have a pom version 0.1 that at least works for me who can I sumit it to for inclusion? On 4 Oct 2005, at 15:41, Brett Porter wrote: On 10/5/05, Ashley Williams [EMAIL PROTECTED] wrote: When you say xjc do you mean: http://www.ibiblio.org/maven2/javax/xml/jaxb-xjc/1.0.5/jaxb- xjc-1.0.5.pom because if so there are no dependencies declared there. What you see in my dependency list is home made in my own repository by trial and error. Yes, but obviously the pom is not complete. http:// jira.codehaus.org/browse/MEV http://jira.codehaus.org/browse/MEV I think I've just temporarily been experiencing what it must have been like to devlop in maven 1. yup :) - Brett - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] lastUpdated ??
Greetings I recently tried to do a build (this AM) -- and it asked me if I wanted to get newer versions -- I said all -- and then my build broke (BTW; it is using SNAPSHOTS) I get the error:: Root error: Unrecognized tag: 'lastUpdated' Do I need to build a later version of m2?? BTW: someone else ran into this yesterday -- and no one responded to thier question.. Thanks, -- Chris
bug in DefaultLog
Greetings, The class DefaultLog should protect againg NPE's It is filled with lines like; logger.debug( content.toString(),...) where content can surely be null at times Cheers, -- Chris
[m2] proxyactive
Greetings, Perhaps I don't understand the usage, but I assume that proxy activefalse/active should turn off the proxy. But in my case (beta3) it does not. I had to comment out the entire proxy element. Is this a bug or a misunderstanding?? Thanks, -- Chris
mailing list archives
Greetings, FYI: the archives link off the mailing list page in m2 (project-reports-mailing-lists) points to the apache archives (BTW: for the wrong list; [EMAIL PROTECTED]) -- which is not searchable while the one in m1 points to the correct list in MARC, which is searchable. Cheers, -- Chris
[m2] new plugins for m2 RC??
Greetings; Are new plugins available for m2 RC?? If I understand things, I would think that they might be made available?? I.e. When building m2 from SVN one gets a new set of base plugins constructed (e.g. 2.0-beta-3-SNAPSHOT) But with the RC release-- which is distributed as JARs -- the corresponding plugins are not in ibiblio and I cannot locate a corresponding repo for them (e.g. in snapshots.maven.codehaus.org http://snapshots.maven.codehaus.org, or at Brett's site, etc.) ... And I know that the plugins at ibiblio are pretty old and in some cases out-dated. Are the m2 RC plugins available anywhere?? Thanks, -- Chris
Re: [m2] new plugins for m2 RC??
Hi Brett, I'm confused. 1) I'm pretty certain that some plugins have changed -- specifically the antcall plugin. 2) When I build the HEAD from SVN (using the m2-bootstrap script) -- I get all new plugins built and installed in my local repo (stamped at the current SNAPSHOT). So when you build RC, are you not building all of maven-components?? 3) This illustrates a point; Should the base plugins be separated from maven if they are to be rev'ed differently?? Seems that if they are rolled together -- then they should get the same version numbers?? Thanks, -- Chris On 10/17/05, Brett Porter [EMAIL PROTECTED] wrote: There are no specific plugins for the RC, we just missed an incompatibility between versions with resources and site. Upgrading to the RC fixes issues with the resources plugin, but breaks certain reports. These will be corrected shortly. - Brett On 10/17/05, Chris Berry [EMAIL PROTECTED] wrote: Greetings; Are new plugins available for m2 RC?? If I understand things, I would think that they might be made available?? I.e. When building m2 from SVN one gets a new set of base plugins constructed (e.g. 2.0-beta-3-SNAPSHOT) But with the RC release-- which is distributed as JARs -- the corresponding plugins are not in ibiblio and I cannot locate a corresponding repo for them (e.g. in snapshots.maven.codehaus.orghttp://snapshots.maven.codehaus.org http://snapshots.maven.codehaus.org, or at Brett's site, etc.) ... And I know that the plugins at ibiblio are pretty old and in some cases out-dated. Are the m2 RC plugins available anywhere?? Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] Building a generic build system in m2
Greetings, I have found that one could easily produce a generic build system in m1 using the import statement from jelly:core inside of the maven.xml file. I.e . j:import inherit='true' file='mybuildtools-1.2.3.xml' / where the file; mybuildtools-1.2.3.xml, would contain parametrized goals which are filled in for the case at hand (i.e the goal might contain ${artifactId} which is appropriately set to that of the current project.xml ). Build systems like this are very useful. You can create a system where your general users don't have to know much about what is happening under-the-covers. And you can upgrade the system easily. I know some of you are cringing, but in large organizations it is important to homogenize the build system, and there are a wide range of experience levels. The last thing you want is for every project to do-their-own-thing. Yes, they will need some permutations, but the general system remains constant. How would one accomplish this in m2?? Could one use a parent POM?? For example, project modelVersion4.0.0/modelVersion groupIdmyorg.com http://myorg.com/groupId artifactIdtools/artifactId version1.0/version packagingpom/packaging properties somePluginVersion1.0-SNAPSHOT/somePluginVersion /properties build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-some-plugin/artifactId version${somePluginVersion}/version configuration someConfig${artifactId}-${version}/someConfig /configuration /plugin /plugins /build /project And in the child POM; project modelVersion4.0.0/modelVersion groupIdmyorg.com http://myorg.com/groupId artifactIdsomeproject/artifactId version1.0/version packagingwhatever/packaging parent groupIdmyorg.com http://myorg.com/groupId artifactIdtools/artifactId version1.0/version parent /project But could this work?? Won't the parent try to replace all of the variables ( e.g. artifactId, etc) with what's defined in it's POM?? Is there a better way to accomplish this in m2?? Thanks, -- Chris
Re: [m2] Building a generic build system in m2
This is very cool. It will be far easier to build generic tool sets this way. Using imports was problematic (well anything in Jelly was problematic for that matter ;-) Thanks again, -- Chris On 10/18/05, John Casey [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Chris. :) Comments inline. Chris Berry wrote: | Greetings, | I have found that one could easily produce a generic build system in m1 | using the import statement from jelly:core inside of the maven.xml file. I.e | . | | j:import inherit='true' file='mybuildtools-1.2.3.xml' / | | where the file; mybuildtools-1.2.3.xml, would contain parametrized goals | which are filled in for the case at hand (i.e the goal might contain | ${artifactId} which is appropriately set to that of the current project.xml | ). | | Build systems like this are very useful. You can create a system where your | general users don't have to know much about what is happening | under-the-covers. And you can upgrade the system easily. I know some of you | are cringing, but in large organizations it is important to homogenize the | build system, and there are a wide range of experience levels. The last | thing you want is for every project to do-their-own-thing. Yes, they will | need some permutations, but the general system remains constant. | | How would one accomplish this in m2?? | Could one use a parent POM?? This is exactly how we'd suggest doing it. In muli-user installations, it's also possible to control plugin versions explicitly using a plugin registry, and it's conceivable that one could create a global plugin registry loader that would read from a central URL or something. | For example, | | project | modelVersion4.0.0/modelVersion | groupIdmyorg.com http://myorg.com http://myorg.com/groupId | artifactIdtools/artifactId | version1.0/version | packagingpom/packaging | | properties | somePluginVersion1.0-SNAPSHOT/somePluginVersion | /properties Because plugins always update LATEST version metadata, and the plugin version resolver looks at LATEST metadata now (as of RC, I believe), you shouldn't need to do this. Either specify it in the plugin-registry.xml or allow Maven to resolve it using LATEST/RELEASE metadata. | | build | plugins | plugin | groupIdorg.apache.maven.plugins/groupId If your plugin's groupId is configured like this in the settings.xml: pluginGroups ~ pluginGroupcom.myco.plugins/pluginGroup /pluginGroups then this element can also be left out, though specifying it removes any chance of ambiguity. Also note that the 'org.apache.maven.plugins' and 'org.codehaus.mojo' groupIds are searched by default, in that order. | artifactIdmaven-some-plugin/artifactId | version${somePluginVersion}/version | configuration | someConfig${artifactId}-${version}/someConfig | /configuration | /plugin | /plugins | /build | /project | | And in the child POM; | | project | modelVersion4.0.0/modelVersion | groupIdmyorg.com http://myorg.com http://myorg.com/groupId | artifactIdsomeproject/artifactId | version1.0/version | packagingwhatever/packaging | parent | groupIdmyorg.com http://myorg.com http://myorg.com/groupId | artifactIdtools/artifactId | version1.0/version | parent | /project | | But could this work?? Won't the parent try to replace all of the variables ( | e.g. artifactId, etc) with what's defined in it's POM?? Expression resolution takes place *after* intheritance and profiles are applied to the current POM, which means they resolve against the effective POM. If you run: m2 projecthelp:effective-POM (adding, of course, any -D options that might be used to trigger profiles), you will see the POM that is used to resolve the expressions in plugin configurations. Plugin configurations are inherited from parent to child by default, with local overrides taking precedence. It's possible to change this behavior (including merging vs. override of plugin configuration wholesale, and inhibiting plugin inheritance), but in general this statement holds. So, what you've described above will work. HTH, john | Is there a better way to accomplish this in m2?? | | Thanks, | -- Chris | -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFDVQvJK3h2CZwO/4URAni/AKCpDNWy8G0jmT5Gum8VXhuL3ZvCpwCdFkIn kspKuWzofISnBe6eenE+UWU= =x+fs -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] new plugins for m2 RC??
Hi John, I guess what's problematic is that many of us have been working from the HEAD of SVN so that we could workaround this or that bug. So now that we have a release candidate (RC) -- it is only a portion of the picture (no plugins are provided). So do we stick with our current SNAPSHOT plugins (i.epost beta3) ?? Will that combo work correctly?? Thanks, -- Chris
Plugins of plugins
Greetings, Is it possible to write a plugin of plugins?? I.e. a plugin that is simply a composite of other plugins. To make this concrete, imagine that you have a common set of plugins that are used across many projects -- together forming a common build system. For example, in project A you have plugins. plugin/ . plugin X at phase 1 plugin/ . plugin Y at phase 5 plugin/ . plugin Z at phase 7 plugins Now I want to re-use this same build system in project B. I understand that I can move this to a parent POM and use inheritance in both projects A and B -- but this doesn't smell right to me. This is really a has-a relationship, not an is-a relationship What seems to make more sense would be to encapsulate these plugins into a composite plugin, say plugin XYZ. And declare only that in the plugins section. This would allow one to use the Composite Pattern when assembling a build system. Is this possible?? Thanks, -- Chris
Re: Plugins of plugins
Hi Jason, Examples: 1) In our current m2 build we have a specialized rpm build which lays out 4 separate plugins that play into 4 different phases of the build. Together they form a system. Each of these plugins is parametrized, such that using artifactId, etc, they have enough information to do their job. This set of plugins is general enough to apply to a wide range of projects. I don't want to repeat the plugin definitions in each project. Of course, this system is being fleshed out, which is why I'm writing this ;-) 2) In m1 I have a build system which builds Java web services. It slips many extra goals into the standard maven Java build sequence (e.g. WSDL2Java, copy extra test resources, company specific stuff, etc.) I collect these goals into a single maven build file which is imported (using jelly:core import) into a project's vanilla maven.xml. This way I control the build process for my many clients -- who ultimately just want to type maven and don't really care what or how it gets built -- as long as it builds correctly. When I port this to m2, I need something similar -- a composite representing a complete, reusable build solution. Does this make sense?? Thanks, -- Chris On 10/18/05, Brill Pappin [EMAIL PROTECTED] wrote: I've got one for you... I used to have a m1 goal that called several other goals while preparing for a release... the idea was to make a repetitive task (executing several goals) simple by executing one goal. Since I no longer have the maven.xml. I'd love to be able to set up a composit plugin where I could define a set of goals to execute. - Brill Pappin On 10/19/05, Jason van Zyl [EMAIL PROTECTED] wrote: On Tue, 2005-10-18 at 22:00 -0500, Chris Berry wrote: Greetings, Is it possible to write a plugin of plugins?? I.e. a plugin that is simply a composite of other plugins. To make this concrete, imagine that you have a common set of plugins that are used across many projects -- together forming a common build system. For example, in project A you have plugins. plugin/ . plugin X at phase 1 plugin/ . plugin Y at phase 5 plugin/ . plugin Z at phase 7 plugins Do you have a concrete example which may help me understand what you're trying to do before I respond. Looks like you're trying to provide solution before we know what you're really trying to do. -- jvz. Jason van Zyl jason at maven.org http://maven.org http://maven.org http://maven.apache.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Plugins of plugins
So it seems that m2, in it's cutrrent state, has not addressed this use case, right?? So for the time being one must use POM inheritance (i.e. Parent POMs) to share a common build system. BTW: a good way to think about this is aggregation versus inheritance Cheers, -- Chris On 10/19/05, Brian E. Fox [EMAIL PROTECTED] wrote: I can think of another use case. I would like to be able to fire off assembly multiple times from a single command to assemble multiple zips (source, jars, ibiblio bundle). -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 12:12 AM To: Maven Users List Subject: Re: Plugins of plugins On Wed, 2005-10-19 at 00:00 -0400, Brill Pappin wrote: I've got one for you... I used to have a m1 goal that called several other goals while preparing for a release... the idea was to make a repetitive task (executing several goals) simple by executing one goal. Since I no longer have the maven.xml. I'd love to be able to set up a composit plugin where I could define a set of goals to execute. Fair enough, that's a good use case I think. Essentially what we're talking about here is a way make altering the life cycle very flexible. Exactly what Chris is talking about where you might graft a bunch of mojos/goals into the life cycle. You may want to execute some goals that are not part of the life cycle and some that are. So maybe a plugin with a configuration that allowed you to do this would be the solution. I don't think this would be hard to do but would be good to get a couple more concrete use cases first. - Brill Pappin On 10/19/05, Jason van Zyl [EMAIL PROTECTED] wrote: On Tue, 2005-10-18 at 22:00 -0500, Chris Berry wrote: Greetings, Is it possible to write a plugin of plugins?? I.e. a plugin that is simply a composite of other plugins. To make this concrete, imagine that you have a common set of plugins that are used across many projects -- together forming a common build system. For example, in project A you have plugins. plugin/ . plugin X at phase 1 plugin/ . plugin Y at phase 5 plugin/ . plugin Z at phase 7 plugins Do you have a concrete example which may help me understand what you're trying to do before I respond. Looks like you're trying to provide solution before we know what you're really trying to do. -- jvz. Jason van Zyl jason at maven.org http://maven.org http://maven.org http://maven.apache.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- jvz. Jason van Zyl jason at maven.org http://maven.org http://maven.apache.org - 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]
Re: Plugins of plugins
I think the Composite Pattern would fit nicely here... CompositePlugin implements Plugin AbstractPlugin implements Plugin And CompositePlugin contains an array of Plugins Cheers, -- Chris On 10/19/05, Jason van Zyl [EMAIL PROTECTED] wrote: On Wed, 2005-10-19 at 09:45 -0500, Chris Berry wrote: So it seems that m2, in it's cutrrent state, has not addressed this use case, right?? So for the time being one must use POM inheritance (i.e. Parent POMs) to share a common build system. Correct, but if we nail down the desired usage I think a plug-in to deal with this could be made in pretty short order. I'll try to write something up later today for people to peruse. BTW: a good way to think about this is aggregation versus inheritance Cheers, -- Chris On 10/19/05, Brian E. Fox [EMAIL PROTECTED] wrote: I can think of another use case. I would like to be able to fire off assembly multiple times from a single command to assemble multiple zips (source, jars, ibiblio bundle). -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 12:12 AM To: Maven Users List Subject: Re: Plugins of plugins On Wed, 2005-10-19 at 00:00 -0400, Brill Pappin wrote: I've got one for you... I used to have a m1 goal that called several other goals while preparing for a release... the idea was to make a repetitive task (executing several goals) simple by executing one goal. Since I no longer have the maven.xml. I'd love to be able to set up a composit plugin where I could define a set of goals to execute. Fair enough, that's a good use case I think. Essentially what we're talking about here is a way make altering the life cycle very flexible. Exactly what Chris is talking about where you might graft a bunch of mojos/goals into the life cycle. You may want to execute some goals that are not part of the life cycle and some that are. So maybe a plugin with a configuration that allowed you to do this would be the solution. I don't think this would be hard to do but would be good to get a couple more concrete use cases first. - Brill Pappin On 10/19/05, Jason van Zyl [EMAIL PROTECTED] wrote: On Tue, 2005-10-18 at 22:00 -0500, Chris Berry wrote: Greetings, Is it possible to write a plugin of plugins?? I.e. a plugin that is simply a composite of other plugins. To make this concrete, imagine that you have a common set of plugins that are used across many projects -- together forming a common build system. For example, in project A you have plugins. plugin/ . plugin X at phase 1 plugin/ . plugin Y at phase 5 plugin/ . plugin Z at phase 7 plugins Do you have a concrete example which may help me understand what you're trying to do before I respond. Looks like you're trying to provide solution before we know what you're really trying to do. -- jvz. Jason van Zyl jason at maven.org http://maven.org http://maven.org http://maven.org http://maven.apache.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- jvz. Jason van Zyl jason at maven.org http://maven.org http://maven.org http://maven.apache.org - 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] -- jvz. Jason van Zyl jason at maven.org http://maven.org http://maven.apache.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: partial multiproject release
Hi Orjan, I guess the moral of the story is that you should not put dependencies on SNAPSHOTs. Or put another way, if you depend upon SNAPSHOTs then you are coupling yourself to the release cycle of the SNAPSHOT project. Separating generic,a,b, and c into separate projects, you are saying that each of these packages has independent life cycles, and thus, you need to cut real releases. The Release Plugin should not cut releases of projects outside it's current scope. My two cents. Cheers, -- Chris On 10/19/05, Orjan Nygaard Austvold [EMAIL PROTECTED] wrote: We have several multiproject structures holding multiple generic artifacts. Released versions of these artifacts gets used by yet other projects (customizing them in a product installation). The multiproject structures looks somewhat like this (version in parenthesis): generic (1.1-SNAPSHOT) artifact a (1.1-SNAPSHOT) artifact_b (1.2-SNAPSHOT) artifact_c (1.0-SNAPSHOT) In this scenario b and c depends on a (a,b and c have generic as their parent). The generic pom have a dependencyManagement section list artifact a,b and with their versions (makes inter-module dependencies easier to handle). Upon having made some changes on the module b we would like to have it released (new version is 1.2,). This forces us to release both a and the generic pom since we do not want a released version of b to depend on snapshots. As a side-effect the pom of artifact c must also be updated with a new parent version (since the new snapshot versions of a and the parent have changed). I don't see how the release plugin could help here. An attempt to do mvn release:prepare in the b artifact directory only tells me that the parent haven't been released. I really, really hope I'm wrong and that the release plugin could help :-) I know that I could do a complete release on the generic pom thus upgrading all sub-modules. The downside of this is that the artifact c would get a new version number without having any changes. Since a release on the parent pom would force all modules to step up to the next version, I really don't see any reason to why the modules need separate versions anymore... Kind of stuck here. Thanks, Ørjan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Building C++ projects with Maven (2)
This brings up a bigger question; How does maven want to handle OS information in the repo?? To be successful w/ other languages like C, the repo will need to delineate information such as i586 and linux. Are these to be rolled into the groupId?? That doesn't smell right. Seems that we may need new Artifact Resolvers that understand this sort of info natively and can transparently supply the the correct pieces to the URL. Cheers, -- Chris On 11/1/05, dan tran [EMAIL PROTECTED] wrote: Hi David, There is a work in progress for native-maven-plugin http://svn.mojo.codehaus.org/trunk/mojo/maven-native/ You can build it and take a look at some doc. -Dan On 11/1/05, David Jackman [EMAIL PROTECTED] wrote: I've just found out that I'm going to need to expand our Maven build process to include several C++ project (which I believe are built using gcc). I seem to remember seeing some traffic on this list from people doing this sort of thing (which I promptly ignored because I wasn't at the time). Can anyone offer some insight on how you got this to work and how you overcame the problems that came up? What plugins are available to build this way and do they do everything you need? Are you able to have dependencies in the Maven repository and have the build use them from there (similar to .jar dependencies)? How do you access the header files, possible library, and runtime library for the different portions of the build? Is there a mini guide for this kind of project in the works? Thanks, ..David..
Re: Building C++ projects with Maven (2)
I think not. Using groupId or artifactId is insufficient -- at least in it's present form. If I have a dependency on, say, version 1.2 of a shared library -- that dependency is platform independent. If not, then you would have to have different POMs for different platforms. Obviously that doesn't work and is not what a POM is about (a holistic project recipe) Although when I am actually building, maven needs to supply OS specifics to grab the right stuff for my platform. For Java this is a no-op and would thus default to noarch or nothing at all. But for languages like C, the system must somehow transparently fill in OS info when constructing the URL. Cheers, -- Chris On 11/1/05, dan tran [EMAIL PROTECTED] wrote: You can use groupId for platform specific or add platform specific string to your artifact id. -D On 11/1/05, Chris Berry [EMAIL PROTECTED] wrote: This brings up a bigger question; How does maven want to handle OS information in the repo?? To be successful w/ other languages like C, the repo will need to delineate information such as i586 and linux. Are these to be rolled into the groupId?? That doesn't smell right. Seems that we may need new Artifact Resolvers that understand this sort of info natively and can transparently supply the the correct pieces to the URL. Cheers, -- Chris On 11/1/05, dan tran [EMAIL PROTECTED] wrote: Hi David, There is a work in progress for native-maven-plugin http://svn.mojo.codehaus.org/trunk/mojo/maven-native/ You can build it and take a look at some doc. -Dan On 11/1/05, David Jackman [EMAIL PROTECTED] wrote: I've just found out that I'm going to need to expand our Maven build process to include several C++ project (which I believe are built using gcc). I seem to remember seeing some traffic on this list from people doing this sort of thing (which I promptly ignored because I wasn't at the time). Can anyone offer some insight on how you got this to work and how you overcame the problems that came up? What plugins are available to build this way and do they do everything you need? Are you able to have dependencies in the Maven repository and have the build use them from there (similar to .jar dependencies)? How do you access the header files, possible library, and runtime library for the different portions of the build? Is there a mini guide for this kind of project in the works? Thanks, ..David..
Re: Building C++ projects with Maven (2)
Good point Sean. But I think the original question still holds; How should we handle this in the repo itself?? I do not think that one can use either groupId or artifactId without violating the platform independence of the POM. I think this implies a smarter Artifact Resolver than we have to today?? Cheers, -- Chris On 11/1/05, Sean Hennessy [EMAIL PROTECTED] wrote: If one considers an alternative use case scenario where a single host (build server) is cross compiling for multiple targets. Then would not the maven sense the machine architecture solution would only support one target environment? Perhaps a mechanism for management of iterative profiles in order to target environment. -Original Message- From: Roger Hoover [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 01, 2005 12:28 PM To: Maven Users List Subject: Re: Building C++ projects with Maven (2) The concern I would have with this is that you have the same logical package (let's say apr 1.2.2) built for different architectures needing to have a different groupId or artifactId for each architecture type. Unless the groupId or artifactId is constructed dynamically, poms that depend on a native artifact have to depend on a specific architecture type. I think it would be nice to write generic poms that depend on just the logical package (apr 1.2.2 instead of apr 1.2.2 x86_64) and have maven sense the machine architecture (and OS) and fetch the correct native artifact. Roger On 11/1/05, dan tran [EMAIL PROTECTED] wrote: You can use groupId for platform specific or add platform specific string to your artifact id. -D On 11/1/05, Chris Berry [EMAIL PROTECTED] wrote: This brings up a bigger question; How does maven want to handle OS information in the repo?? To be successful w/ other languages like C, the repo will need to delineate information such as i586 and linux. Are these to be rolled into the groupId?? That doesn't smell right. Seems that we may need new Artifact Resolvers that understand this sort of info natively and can transparently supply the the correct pieces to the URL. Cheers, -- Chris On 11/1/05, dan tran [EMAIL PROTECTED] wrote: Hi David, There is a work in progress for native-maven-plugin http://svn.mojo.codehaus.org/trunk/mojo/maven-native/ You can build it and take a look at some doc. -Dan On 11/1/05, David Jackman [EMAIL PROTECTED] wrote: I've just found out that I'm going to need to expand our Maven build process to include several C++ project (which I believe are built using gcc). I seem to remember seeing some traffic on this list from people doing this sort of thing (which I promptly ignored because I wasn't at the time). Can anyone offer some insight on how you got this to work and how you overcame the problems that came up? What plugins are available to build this way and do they do everything you need? Are you able to have dependencies in the Maven repository and have the build use them from there (similar to .jar dependencies)? How do you access the header files, possible library, and runtime library for the different portions of the build? Is there a mini guide for this kind of project in the works? Thanks, ..David.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migrate jelly execute scripts to M2? (was RE: Wanted: Help with documentation on M2)
Hi Siegfried, I think the short answer is; write a plugin. Now if you're like me, and your Jelly was mostly just a bunch of Ant calls with a bit of Jelly glue, then you might consider using the new m2 Ant plugins. This would allow you to transfer the knowledge directly to an Ant buildfile and simply execute that from your plugin. It's pretty straight forward. BTW: you may need to use the Ant Tasks in ant-contrib to fill in some of the script functionality that is missing in Ant. Cheers, -- Chris On 11/1/05, Siegfried Heintze [EMAIL PROTECTED] wrote: I would like to migrate my custom m1 jelly script from m1 to m2 that executes my program. As per Dan's advice, I have been searching with execute and not having much luck. Can I get a few more hints? Also, I've been thinking: what I really want is a way to automatically generate either C++ (using JNI) or bat files or sh files that assemble the monstrous class paths and run my java programs. Would such a code generator be best implemented as a maven plugin or eclipse plugin -- or something else? Thanks, Siegfried -Original Message- From: dan tran [mailto:[EMAIL PROTECTED] Sent: Sunday, October 16, 2005 10:04 AM To: Maven Users List Subject: Re: Wanted: Help with documentation on M2 Siegfried, The development team is actively working on m2 documentation, and I beleive you will see lots doco will be available soon. Voting is going on dev list to load up new doco site layout However, I have seen lot traffic discussion about having a mojo to do exactly what your try to do by invoking java with classpath containing dependency artifacts. Here are some links that my help http://mojo.codehaus.org/maven-execute-plugin/ deprecated http://docs.codehaus.org/display/MAVEN/Maven+Runtime Search the archive for execute, i am sure you will find more info. Assume that the desired plugin/mojo is available, all you need is a pom.xml + the plugin's configuration in the pom Hope it helps -D On 10/16/05, Siegfried Heintze [EMAIL PROTECTED] wrote: I'm reading http://maven.apache.org/maven2/general.html and http://maven.apache.org/maven2/maven1.html#m1-maven-xml and I still don't understand where I learn about converting the following maven.xml file (see below) for use with m2. Can someone point me to the proper URL that contains the M2 documentation that will tell me how to convert a minimal maven 1.1 project to m2 given the maven.xml file below? Thanks, Siegfried ?xml version=1.0 encoding=utf-8? project default=jar xmlns:maven=jelly:maven xmlns:ant=jelly:ant xmlns:j=jelly:core xmlns:u=jelly:util goal name=run prereqs=jar ant:java classname=mdn.testapp.App fork=true ant:classpath ant:pathelement location=${maven.build.dir}/${maven.final.namehttp://maven.final.name http://maven.final.name }.jar/ j:forEach var=lib items=${pom.artifacts} ant:pathelement path=${lib.path}/ /j:forEach /ant:classpath /ant:java /goal /project - 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]
Re: [m2] internal repository docs?
Hi Wendy, I had to do this too and used:: repositories repository idCWB/id urlfile:///C:/cberry/work/3rdparty-repo//url layoutlegacy/layout /repository /repositories Note the /// on windoze. And note the trailing / Cheers, -- Chris On 11/1/05, Wendy Smoak [EMAIL PROTECTED] wrote: I asked Google about 'maven internal repository' and it turned up: http://maven.apache.org/reference/internal-repositories.html It's at the top level of the site, so I'd expect it to apply to m2, but it doesn't seem to. I need to set up an internal repository to be accessed with file:// . I think this might have what I need... http://maven.apache.org/guides/mini/guide-multiple-repositories.html If that's not it, where else should I look? Thanks, -- Wendy
Re: Building C++ projects with Maven (2)
Hi Mark, So, if I have it right, your solution is to transparently augment the versionId on-the-fly?? And you keep all of these artifacts together in the same repo dir i.e. all under the same version subdir (in m2) i.e. openssl/0.9.8/i386-linux-gcc-openssl-nar-0.9.8.nar Thanks, -- Chris On 11/1/05, Donszelmann, Mark [EMAIL PROTECTED] wrote: Hi that is what we did with our NAR (Native Archive) plugin in Maven 1, which we are porting to M2 at this time. See for maven 1: http://java.freehep.org/freehep-nar-plugin we let the user depend on an artifact, and add Architecture-OS-Linkername to it. Regards Mark Donszelmann -Original Message- From: Roger Hoover [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 01, 2005 12:28 PM To: Maven Users List Subject: Re: Building C++ projects with Maven (2) The concern I would have with this is that you have the same logical package (let's say apr 1.2.2) built for different architectures needing to have a different groupId or artifactId for each architecture type. Unless the groupId or artifactId is constructed dynamically, poms that depend on a native artifact have to depend on a specific architecture type. I think it would be nice to write generic poms that depend on just the logical package (apr 1.2.2 instead of apr 1.2.2 x86_64) and have maven sense the machine architecture (and OS) and fetch the correct native artifact. Roger On 11/1/05, dan tran [EMAIL PROTECTED] wrote: You can use groupId for platform specific or add platform specific string to your artifact id. -D On 11/1/05, Chris Berry [EMAIL PROTECTED] wrote: This brings up a bigger question; How does maven want to handle OS information in the repo?? To be successful w/ other languages like C, the repo will need to delineate information such as i586 and linux. Are these to be rolled into the groupId?? That doesn't smell right. Seems that we may need new Artifact Resolvers that understand this sort of info natively and can transparently supply the the correct pieces to the URL. Cheers, -- Chris On 11/1/05, dan tran [EMAIL PROTECTED] wrote: Hi David, There is a work in progress for native-maven-plugin http://svn.mojo.codehaus.org/trunk/mojo/maven-native/ You can build it and take a look at some doc. -Dan On 11/1/05, David Jackman [EMAIL PROTECTED] wrote: I've just found out that I'm going to need to expand our Maven build process to include several C++ project (which I believe are built using gcc). I seem to remember seeing some traffic on this list from people doing this sort of thing (which I promptly ignored because I wasn't at the time). Can anyone offer some insight on how you got this to work and how you overcame the problems that came up? What plugins are available to build this way and do they do everything you need? Are you able to have dependencies in the Maven repository and have the build use them from there (similar to .jar dependencies)? How do you access the header files, possible library, and runtime library for the different portions of the build? Is there a mini guide for this kind of project in the works? Thanks, ..David.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Plugin Inheritance
Greetings, I am looking for guidance on POM inheritance. I know that I can set up a build system where all common functionality is pulled into a Parent POM, so that Child POMs can be remarkably small. What I'm uncertain on is how I override some of the plugins -- leaving the others as is. I see that I can override properties and customize the common plugin use that way. But can I completely override a particular plugin?? Or perhaps add another plugin?? I guess I'm looking for the rules of inheritance... I.e can I override a plugin like this?? Is there a better way to supply different configuration sets?? Parent POM: project build plugins plugin artifactIdmy-plugin/artifactId configuration somethingval1/something /configuration /plugin Child POM project parent/parent build plugins plugin artifactIdmy-plugin/artifactId configuration somethingval2/something somethingelseval3/somethingelse /configuration /plugin Thanks, -- Chris
Re: Plugin Inheritance
I can now answer this myself. It appears that m2 does the right thing -- i.e. what you'd expect All plugins are inherited from the Parent. To override any Plugin, simply declare it in the Child. Those you don't declare remain unchanged. All configuration in the overriding Plugin declaration is inherited. And you can override any config properties or add new ones where necessary. Powerful, good stuff. This, plus the ability to parameterize with properties, makes it really easy to create a malleable build system good job maven guys ;-) Cheers, -- Chris On 11/2/05, Chris Berry [EMAIL PROTECTED] wrote: Greetings, I am looking for guidance on POM inheritance. I know that I can set up a build system where all common functionality is pulled into a Parent POM, so that Child POMs can be remarkably small. What I'm uncertain on is how I override some of the plugins -- leaving the others as is. I see that I can override properties and customize the common plugin use that way. But can I completely override a particular plugin?? Or perhaps add another plugin?? I guess I'm looking for the rules of inheritance... I.e can I override a plugin like this?? Is there a better way to supply different configuration sets?? Parent POM: project build plugins plugin artifactIdmy-plugin/artifactId configuration somethingval1/something /configuration /plugin Child POM project parent/parent build plugins plugin artifactIdmy-plugin/artifactId configuration somethingval2/something somethingelseval3/somethingelse /configuration /plugin Thanks, -- Chris
Re: Migrating from Ant to Maven
Hi, The move from Ant to Maven is relatively painless, particularly with Maven2. I would definitely recommend going with Maven2. Maven1 uses Jelly which is pretty nasty to deal with -- you can call out to Ant with Jelly easily, but Jelly is quite unpredictable and you will spend a lot of time tearing your hair out. Plus, Maven2 is the future, so you might as well start there. Mostr likely Maven implicitly does most of what you do with Ant already. If I were you I would start with a simple project to get my head around Maven. Then do your real project after you know the basics. In general, using Ant from Maven2 is simple. There are plugins which allow you to either 1) embed Ant directly in your POM or 2) use an external Ant buildfile from Maven2. It really depends on whether you need a reusable build system across many projects (i.e. a reusable Plugin), or your system is a one-off. Whether you need the Ant stuff at all really depends on whether you have any non-standard build steps in your sequence, and whether these are not addressed by some existing Plugin that can be wired in... YMMV Cheers, -- Chris On 11/3/05, Sakala, Adinarayana [EMAIL PROTECTED] wrote: Hi, I am new to Maven. We currently use Ant for build system in our open source project called Celtix ( http://celtix.objectweb.org). We are looking to migrate the project to using Maven. Did anybody go through this process before? If so, Any pointers/help? Any known issues? Also, do anybody have any suggestion on which version of Maven should we look at? Appreciate any help on this. Thanks, Adi Sakala - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[continuum] ruby xmlrpc client
Greetings, Has anyone yet created a Ruby-based xmlrpc client for Continuum that they would be willing to share?? Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven-ant-script and bash scripts
Greetings, I need to call a bash script -- from an Ant script -- that I want to roll into a Maven plugin based on maven-ant-script. Sound convoluted ;-) It is, but this is the path of least resistance. I have an existing Ant build to convert. My question; Can one do this from maven-ant-script?? It seems not, since maven-ant-script appears to rely upon finding its resources using the CLASSPATH and these resources are rolled into a JAR (downloaded into the repository). And, AFAIK, one must execute the bash script as a file on the file system?? Does anyone know if this is doable?? Is there another maven plugin that one can use to call shell scripts like this?? Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: maven-ant-script and bash scripts
Thanks Dan. The maven-exec plugin would work to call a script, and could actually solve my problem. But it doesn't really answer the fundamental problem with the maven-ant-script plugin, which works out of a JAR, and thus, just isn't flexible enough. It really needs to unpack the JAR (or pieces of it) into /target so that it can actually use those resources as files. Ultimately, as people convert Ant builds into maven, they will have specialized tasks that are easiest to just call as-is. In general, with Ant this means that it will look for files and not JAR resources. A general build might have a bit of everything in it, a little Ant, a little bash, a little Perl -- whatever it takes to get the job done. We just need a way to deliver the pieces and execute them. The maven-ant-script plugin is almost there. It can package up build pieces into a JAR, and deliver it to a repo, but until that JAR is unpacked, it can only solve a subset of problems. Of course, I could be missing something... Cheers, -- Chris On 10/5/06, dan tran [EMAIL PROTECTED] wrote: exec-maven-plugin ? On 10/5/06, Chris Berry [EMAIL PROTECTED] wrote: Greetings, I need to call a bash script -- from an Ant script -- that I want to roll into a Maven plugin based on maven-ant-script. Sound convoluted ;-) It is, but this is the path of least resistance. I have an existing Ant build to convert. My question; Can one do this from maven-ant-script?? It seems not, since maven-ant-script appears to rely upon finding its resources using the CLASSPATH and these resources are rolled into a JAR (downloaded into the repository). And, AFAIK, one must execute the bash script as a file on the file system?? Does anyone know if this is doable?? Is there another maven plugin that one can use to call shell scripts like this?? Thanks, -- Chris - 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]
Problem w/ HttpUtils
Greetings, I am using HttpUtils to manually fetch dependencies. I do this because maven does not adequately chain dependencies. I.e if A depends on B, and B depends on C, then B should chain in it's own dependencies and not force A to prescribe them (since A should not know this directly) So I create a package (a tarball or a jar), for, say, B, and store a filelist in that tarball listing it's dependencies. Then A depends on B -- and B knows that it has further dependencies and manually brings them in -- using maven's HttpUtils. So far so good. I have all of this working. But when I moved the process forward to a different point in my build cycle (i.e. in my plugin) it fails. I get a class not found for HttpUtils. Can someone please explain how to make this work?? HttpUtils is a part of maven, and I can see it in maven.jar -- and it works at a later point in my process -- so some other plugin I'm using must set stuff up for me. I suspect that there is some magic line of jelly that I need to add, but looking thru plugins, I cannot discern what it is... BTW: The file I'm fetching exists and the maven.repo.remote is correct. I'm confused. Thanks, -- Chris Further info follows:: --- Here is the jelly:: j:catch var=ex j:invokeStatic var=dummy method=getFile className=org.apache.maven.util.HttpUtils j:arg type=java.lang.String value=${remoteFile} / j:arg type=java.io.File value=${localFile}/ j:arg type=boolean value=false/ j:arg type=boolean value=true/ j:arg type=java.lang.String value=${maven.proxy.host} / j:arg type=java.lang.String value=${maven.proxy.port} / j:arg type=java.lang.String value=${maven.proxy.username} / j:arg type=java.lang.String value=${maven.proxy.password} / j:arg type=boolean value=false/ /j:invokeStatic /j:catch And here is the error:: et:expand-jar-dependencies: jws:expand-jarlist-to-dir: [echo] jarsFlist= commons-logging/jars/commons-logging-1.0.3.jar,junit/jars/junit-3.8.1.jar,log4j/jars/log4j-1.2.8.jar,commons-beanutil s/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jars/commons-collections-3.1.jar,commons-dbcp/ja rs/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-poo l/jars/commons-pool-1.2.jar,jms/jars/jms-1.0.2.jar,spiritcache/jars/spirit-cache-2.0.14.jar,dom4j/jars/dom4j-1.4.jar,xalan/jars/xalan-2.5.1. jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, [echo] Trying to load localFile= C:\cberry\work\jws-engine-maven-1.2\jwseng\pkg\shared\lib\commons-logging-1.0.3.jar [echo] os.name = Windows XP [echo] isWindows = true [echo] Trying to download file:/C:/cberry/work/3rdparty-repo/commons-logging/jars/commons-logging-1.0.3.jar [echo] ex= org.apache.commons.jelly.JellyTagException: C:\cberry\.maven\cache\maven-etrade-plugin-1.0.0\plugin.jelly:547:75: lt;j:invok eStaticgt; Could not load class: org.apache.maven.util.HttpUtils. Reason: java.lang.reflect.InvocationTargetException [echo] os.name = Windows XP [echo] isWindows = true [echo] Trying to download http://svn.etrade.com/java-repo/maven/commons-logging/jars/commons-logging-1.0.3.jar [echo] ex= org.apache.commons.jelly.JellyTagException: C:\cberry\.maven\cache\maven-etrade-plugin-1.0.0\plugin.jelly:547:75: lt;j:invok eStaticgt; Could not load class: org.apache.maven.util.HttpUtils. Reason: java.lang.reflect.InvocationTargetException BUILD FAILED File.. C:\cberry\.maven\cache\maven-etrade-plugin-1.0.0\plugin.jelly Element... ant:fail Line.. 568 Column 52 Unable to find jar Total time: 6 seconds Finished at: Sat Jan 29 17:25:39 CST 2005 __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple vesions of a plugin
Greetings, Is it possible for multiple versions of the same plugin to exist simultaneously in a cache?? If so, how does one specify explicitly which plugin to use?? Imagine the following: You are working on several projects simultaneously, all on their own lifecycles. Project A is code frozen and is using verion 1.1 of your plugin. Project B is more fresh and needs 1.3. And you need to be able to switch back and forth seamlessly. Another scenario; You have a project and you must simultaneously support the release in Production (using 1.1 of your plugin) and also the ongoing develeopment which is using version 1.3... Thanks, -- Chris __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem w/ HttpUtils
Unfortunately, that doesn't help. --- Ole Matzura [EMAIL PROTECTED] wrote: Hi! have you tried to add maven-1.0.2.jar to your dependency classpath in your jelly script? Or maybe just create a standard dependency to it in project.xml? ie dependency groupIdmaven/groupId artifactIdmaven/artifactId version1.0.2/version /dependency regards! /Ole From: Chris Berry [mailto:[EMAIL PROTECTED] Sent: Sun 30/01/2005 17:51 To: users@maven.apache.org Subject: Problem w/ HttpUtils Greetings, I am using HttpUtils to manually fetch dependencies. I do this because maven does not adequately chain dependencies. I.e if A depends on B, and B depends on C, then B should chain in it's own dependencies and not force A to prescribe them (since A should not know this directly) So I create a package (a tarball or a jar), for, say, B, and store a filelist in that tarball listing it's dependencies. Then A depends on B -- and B knows that it has further dependencies and manually brings them in -- using maven's HttpUtils. So far so good. I have all of this working. But when I moved the process forward to a different point in my build cycle (i.e. in my plugin) it fails. I get a class not found for HttpUtils. Can someone please explain how to make this work?? HttpUtils is a part of maven, and I can see it in maven.jar -- and it works at a later point in my process -- so some other plugin I'm using must set stuff up for me. I suspect that there is some magic line of jelly that I need to add, but looking thru plugins, I cannot discern what it is... BTW: The file I'm fetching exists and the maven.repo.remote is correct. I'm confused. Thanks, -- Chris Further info follows:: --- Here is the jelly:: j:catch var=ex j:invokeStatic var=dummy method=getFile className=org.apache.maven.util.HttpUtils j:arg type=java.lang.String value=${remoteFile} / j:arg type=java.io.File value=${localFile}/ j:arg type=boolean value=false/ j:arg type=boolean value=true/ j:arg type=java.lang.String value=${maven.proxy.host} / j:arg type=java.lang.String value=${maven.proxy.port} / j:arg type=java.lang.String value=${maven.proxy.username} / j:arg type=java.lang.String value=${maven.proxy.password} / j:arg type=boolean value=false/ /j:invokeStatic /j:catch And here is the error:: et:expand-jar-dependencies: jws:expand-jarlist-to-dir: [echo] jarsFlist= commons-logging/jars/commons-logging-1.0.3.jar,junit/jars/junit-3.8.1.jar,log4j/jars/log4j-1.2.8.jar,commons-beanutil s/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jars/commons-collections-3.1.jar,commons-dbcp/ja rs/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-poo l/jars/commons-pool-1.2.jar,jms/jars/jms-1.0.2.jar,spiritcache/jars/spirit-cache-2.0.14.jar,dom4j/jars/dom4j-1.4.jar,xalan/jars/xalan-2.5.1. jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, [echo] Trying to load localFile= C:\cberry\work\jws-engine-maven-1.2\jwseng\pkg\shared\lib\commons-logging-1.0.3.jar [echo] os.name = Windows XP [echo] isWindows = true [echo] Trying to download file:/C:/cberry/work/3rdparty-repo/commons-logging/jars/commons-logging-1.0.3.jar [echo] ex= org.apache.commons.jelly.JellyTagException: C:\cberry\.maven\cache\maven-etrade-plugin-1.0.0\plugin.jelly:547:75: lt;j:invok eStaticgt; Could not load class: org.apache.maven.util.HttpUtils. Reason: java.lang.reflect.InvocationTargetException [echo] os.name = Windows XP [echo] isWindows = true [echo] Trying to download http://svn.etrade.com/java-repo/maven/commons-logging/jars/commons-logging-1.0.3.jar [echo] ex= org.apache.commons.jelly.JellyTagException: C:\cberry\.maven\cache\maven-etrade-plugin-1.0.0\plugin.jelly:547:75: lt;j:invok eStaticgt; Could not load class: org.apache.maven.util.HttpUtils. Reason: java.lang.reflect.InvocationTargetException BUILD FAILED File.. C:\cberry\.maven\cache\maven-etrade-plugin-1.0.0\plugin.jelly Element... ant:fail Line.. 568 Column 52 Unable to find jar Total time: 6 seconds Finished at: Sat Jan 29 17:25:39 CST 2005 __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail
RE: Problem w/ HttpUtils
These jars are a part of maven itself I don't think that I should have to explicitly declare them. And also, this same code works fine when used slightly differently (in a slightly different call sequence). Regardless, I tried your suggestion, and it has no effect... Is there a way for the plugin.jelly itself to import this class -- i.e. to explicitly make sure that it is present before trying to use it... Thanks, -- Chris --- Ole Matzura [EMAIL PROTECTED] wrote: hmm.. sorry for some basic questions; httputils has dependencies on httpclient and commons-lang, are they all in your plugins' dependency-list? /Ole From: Chris Berry [mailto:[EMAIL PROTECTED] Sent: Sun 30/01/2005 19:25 To: Maven Users List Subject: RE: Problem w/ HttpUtils Unfortunately, that doesn't help. --- Ole Matzura [EMAIL PROTECTED] wrote: Hi! have you tried to add maven-1.0.2.jar to your dependency classpath in your jelly script? Or maybe just create a standard dependency to it in project.xml? ie dependency groupIdmaven/groupId artifactIdmaven/artifactId version1.0.2/version /dependency regards! /Ole From: Chris Berry [mailto:[EMAIL PROTECTED] Sent: Sun 30/01/2005 17:51 To: users@maven.apache.org Subject: Problem w/ HttpUtils Greetings, I am using HttpUtils to manually fetch dependencies. I do this because maven does not adequately chain dependencies. I.e if A depends on B, and B depends on C, then B should chain in it's own dependencies and not force A to prescribe them (since A should not know this directly) So I create a package (a tarball or a jar), for, say, B, and store a filelist in that tarball listing it's dependencies. Then A depends on B -- and B knows that it has further dependencies and manually brings them in -- using maven's HttpUtils. So far so good. I have all of this working. But when I moved the process forward to a different point in my build cycle (i.e. in my plugin) it fails. I get a class not found for HttpUtils. Can someone please explain how to make this work?? HttpUtils is a part of maven, and I can see it in maven.jar -- and it works at a later point in my process -- so some other plugin I'm using must set stuff up for me. I suspect that there is some magic line of jelly that I need to add, but looking thru plugins, I cannot discern what it is... BTW: The file I'm fetching exists and the maven.repo.remote is correct. I'm confused. Thanks, -- Chris Further info follows:: --- Here is the jelly:: j:catch var=ex j:invokeStatic var=dummy method=getFile className=org.apache.maven.util.HttpUtils j:arg type=java.lang.String value=${remoteFile} / j:arg type=java.io.File value=${localFile}/ j:arg type=boolean value=false/ j:arg type=boolean value=true/ j:arg type=java.lang.String value=${maven.proxy.host} / j:arg type=java.lang.String value=${maven.proxy.port} / j:arg type=java.lang.String value=${maven.proxy.username} / j:arg type=java.lang.String value=${maven.proxy.password} / j:arg type=boolean value=false/ /j:invokeStatic /j:catch And here is the error:: et:expand-jar-dependencies: jws:expand-jarlist-to-dir: [echo] jarsFlist= commons-logging/jars/commons-logging-1.0.3.jar,junit/jars/junit-3.8.1.jar,log4j/jars/log4j-1.2.8.jar,commons-beanutil s/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jars/commons-collections-3.1.jar,commons-dbcp/ja rs/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-poo l/jars/commons-pool-1.2.jar,jms/jars/jms-1.0.2.jar,spiritcache/jars/spirit-cache-2.0.14.jar,dom4j/jars/dom4j-1.4.jar,xalan/jars/xalan-2.5.1. jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, [echo] Trying to load localFile= C:\cberry\work\jws-engine-maven-1.2\jwseng\pkg\shared\lib\commons-logging-1.0.3.jar [echo] os.name = Windows XP [echo] isWindows = true [echo] Trying to download file:/C:/cberry/work/3rdparty-repo/commons-logging/jars/commons-logging-1.0.3.jar [echo] ex= org.apache.commons.jelly.JellyTagException: C:\cberry\.maven\cache\maven-etrade-plugin-1.0.0\plugin.jelly:547:75: lt;j:invok eStaticgt; Could not load class: org.apache.maven.util.HttpUtils. Reason: java.lang.reflect.InvocationTargetException [echo] os.name = Windows XP [echo] isWindows = true
RE: Problem w/ HttpUtils
Sorry. Pilot error ;-) Turns out that I was getting fooled by the error message. It had nothing to do with not finding the HttpUtils class. It was that my dest dir was not yet created and the failure was internal to HttpUtils -- but this fact was masked by the InvocationTargetException. I figured this out by switching to Ant's Get Task... Oh well, live and learn. Thanks, -- Chris --- Ole Matzura [EMAIL PROTECTED] wrote: hmm.. judging from your error message and the source code for the InvokeStatic tag (http://cvs.apache.org/viewcvs.cgi/jakarta-commons/jelly/src/java/org/apache/commons/jelly/tags/core/InvokeStaticTag.java?rev=1.9view=auto) it seems your exception is created using the createLoadClassFailedException method (at the bottom). Strangely though, for InvocationTargetException, this should not be the case as it has its own catch clause which does not use that method for creating its exception (or I am just too tired now ??) .. maybe you dont have the latest version of the jelly core? (which on the other hand doesn't fit with your invocation working later on..) sorry for making stupid suggestions.. just trying to help out :-) good luck! /Ole From: Chris Berry [mailto:[EMAIL PROTECTED] Sent: Sun 30/01/2005 19:56 To: Maven Users List Subject: RE: Problem w/ HttpUtils These jars are a part of maven itself I don't think that I should have to explicitly declare them. And also, this same code works fine when used slightly differently (in a slightly different call sequence). Regardless, I tried your suggestion, and it has no effect... Is there a way for the plugin.jelly itself to import this class -- i.e. to explicitly make sure that it is present before trying to use it... Thanks, -- Chris --- Ole Matzura [EMAIL PROTECTED] wrote: hmm.. sorry for some basic questions; httputils has dependencies on httpclient and commons-lang, are they all in your plugins' dependency-list? /Ole From: Chris Berry [mailto:[EMAIL PROTECTED] Sent: Sun 30/01/2005 19:25 To: Maven Users List Subject: RE: Problem w/ HttpUtils Unfortunately, that doesn't help. --- Ole Matzura [EMAIL PROTECTED] wrote: Hi! have you tried to add maven-1.0.2.jar to your dependency classpath in your jelly script? Or maybe just create a standard dependency to it in project.xml? ie dependency groupIdmaven/groupId artifactIdmaven/artifactId version1.0.2/version /dependency regards! /Ole From: Chris Berry [mailto:[EMAIL PROTECTED] Sent: Sun 30/01/2005 17:51 To: users@maven.apache.org Subject: Problem w/ HttpUtils Greetings, I am using HttpUtils to manually fetch dependencies. I do this because maven does not adequately chain dependencies. I.e if A depends on B, and B depends on C, then B should chain in it's own dependencies and not force A to prescribe them (since A should not know this directly) So I create a package (a tarball or a jar), for, say, B, and store a filelist in that tarball listing it's dependencies. Then A depends on B -- and B knows that it has further dependencies and manually brings them in -- using maven's HttpUtils. So far so good. I have all of this working. But when I moved the process forward to a different point in my build cycle (i.e. in my plugin) it fails. I get a class not found for HttpUtils. Can someone please explain how to make this work?? HttpUtils is a part of maven, and I can see it in maven.jar -- and it works at a later point in my process -- so some other plugin I'm using must set stuff up for me. I suspect that there is some magic line of jelly that I need to add, but looking thru plugins, I cannot discern what it is... BTW: The file I'm fetching exists and the maven.repo.remote is correct. I'm confused. Thanks, -- Chris Further info follows:: --- Here is the jelly:: j:catch var=ex j:invokeStatic var=dummy method=getFile className=org.apache.maven.util.HttpUtils j:arg type=java.lang.String value=${remoteFile} / j:arg type=java.io.File value=${localFile}/ j:arg type=boolean value=false/ j:arg type=boolean value=true/ j:arg type=java.lang.String value=${maven.proxy.host} / j:arg type=java.lang.String value=${maven.proxy.port} / j:arg type=java.lang.String value=${maven.proxy.username} / j:arg type=java.lang.String value=${maven.proxy.password} / j:arg type=boolean
mutable properties from a file
Greetings, I am trying to read a mutable property from a file (I use it within a loop). I have tried using the ant-contrib var task with unset=true -- as shown below. But this is not reseting the Ant property?? Does anyone know a maven way of reading properties from a file which allows for the properties to be true, mutable variables?? Thanks, -- Chris - This is what I tried:: ant:echo ENTER jarsFlist= ${jarsFlist} /ant:echo ant:var name=jarsFlist unset=true / ant:echo UNSET jarsFlist= ${jarsFlist} /ant:echo ant:property file=${jarsListFile}/ ant:echo FINAL jarsFlist= ${jarsFlist} /ant:echo - And this is what I see:: [echo] ENTER jarsFlist= commons-beanutils/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jar s/commons-collections-3.1.jar,commons-dbcp/jars/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-logging/jars/c ommons-logging-1.0.3.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-pool/jars/commons-pool-1.2.jar,dom4j/jars/dom4j-1.4 .jar,junit/jars/junit-3.8.1.jar,jms/jars/jms-1.0.2.jar,log4j/jars/log4j-1.2.8.jar,spiritcache/jars/spirit-cache-2.0.14.jar,xalan/jars/xalan- 2.5.1.jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, [echo] UNSET jarsFlist= commons-beanutils/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jar s/commons-collections-3.1.jar,commons-dbcp/jars/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-logging/jars/c ommons-logging-1.0.3.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-pool/jars/commons-pool-1.2.jar,dom4j/jars/dom4j-1.4 .jar,junit/jars/junit-3.8.1.jar,jms/jars/jms-1.0.2.jar,log4j/jars/log4j-1.2.8.jar,spiritcache/jars/spirit-cache-2.0.14.jar,xalan/jars/xalan- 2.5.1.jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, [echo] FINAL jarsFlist= commons-beanutils/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jar s/commons-collections-3.1.jar,commons-dbcp/jars/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-logging/jars/c ommons-logging-1.0.3.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-pool/jars/commons-pool-1.2.jar,dom4j/jars/dom4j-1.4 .jar,junit/jars/junit-3.8.1.jar,jms/jars/jms-1.0.2.jar,log4j/jars/log4j-1.2.8.jar,spiritcache/jars/spirit-cache-2.0.14.jar,xalan/jars/xalan- 2.5.1.jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mutable properties from a file
Answering my own question. Use something like teh following:: u:properties var=props file=${jarsListFile} / j:set var=jarsFlist value=${props.getProperty( 'jarsFlist' )} / Cheers, -- Chris --- Chris Berry [EMAIL PROTECTED] wrote: Greetings, I am trying to read a mutable property from a file (I use it within a loop). I have tried using the ant-contrib var task with unset=true -- as shown below. But this is not reseting the Ant property?? Does anyone know a maven way of reading properties from a file which allows for the properties to be true, mutable variables?? Thanks, -- Chris - This is what I tried:: ant:echo ENTER jarsFlist= ${jarsFlist} /ant:echo ant:var name=jarsFlist unset=true / ant:echo UNSET jarsFlist= ${jarsFlist} /ant:echo ant:property file=${jarsListFile}/ ant:echo FINAL jarsFlist= ${jarsFlist} /ant:echo - And this is what I see:: [echo] ENTER jarsFlist= commons-beanutils/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jar s/commons-collections-3.1.jar,commons-dbcp/jars/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-logging/jars/c ommons-logging-1.0.3.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-pool/jars/commons-pool-1.2.jar,dom4j/jars/dom4j-1.4 .jar,junit/jars/junit-3.8.1.jar,jms/jars/jms-1.0.2.jar,log4j/jars/log4j-1.2.8.jar,spiritcache/jars/spirit-cache-2.0.14.jar,xalan/jars/xalan- 2.5.1.jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, [echo] UNSET jarsFlist= commons-beanutils/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jar s/commons-collections-3.1.jar,commons-dbcp/jars/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-logging/jars/c ommons-logging-1.0.3.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-pool/jars/commons-pool-1.2.jar,dom4j/jars/dom4j-1.4 .jar,junit/jars/junit-3.8.1.jar,jms/jars/jms-1.0.2.jar,log4j/jars/log4j-1.2.8.jar,spiritcache/jars/spirit-cache-2.0.14.jar,xalan/jars/xalan- 2.5.1.jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, [echo] FINAL jarsFlist= commons-beanutils/jars/commons-beanutils-1.7.0.jar,commons-cli/jars/commons-cli-1.0.jar,commons-collections/jar s/commons-collections-3.1.jar,commons-dbcp/jars/commons-dbcp-1.2.1.jar,commons-digester/jars/commons-digester-1.5.jar,commons-logging/jars/c ommons-logging-1.0.3.jar,commons-messenger/jars/commons-messenger-1.0-dev-14.jar,commons-pool/jars/commons-pool-1.2.jar,dom4j/jars/dom4j-1.4 .jar,junit/jars/junit-3.8.1.jar,jms/jars/jms-1.0.2.jar,log4j/jars/log4j-1.2.8.jar,spiritcache/jars/spirit-cache-2.0.14.jar,xalan/jars/xalan- 2.5.1.jar,xerces/jars/xercesImpl-2.6.1.jar,xml-apis/jars/xml-apis-1.0.b2.jar, __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] missing dependency features??
Greetings, Seems that dependencies should provide two features they do not already; 1) the ability to explicitly specify the URL from which to download an artifact (in m1, if I recall, this was handled by the jar element). This is particularly important when one depends upon interface definitions -- particularly WSDLs -- which are typically available from some webserver which does not adhere to the maven style of URL. A client may wish to find these dependencies at the URL first, and leave open the possibility of finding the WSDL locally in a maven-style repo. Looking at the available dependency XML elements; systemPath is System-scope only, but something akin to it (say, path) might work. dependency groupIdorg.myorg.services/groupId artifactIdfoo/artifactId version1.0.0/version typewsdl/type pathhttp://foo.com/wslds/foo.wsdl/path properties transitive=false server.wsdltrue/server.wsdl war.bundletrue/war.bundle /properties /dependency 2) The ability to specify a dependency property (as in m1). For example, in my project must be able to specify that I want a WSDL dependency as either a client or a server. This is an application specific property, which is a good, legitimate use of properties. Others are war.bundle, etc. These properties may be used in all points of the lifecycle. In one case, server.wsdl is a compile-time property, in another war.bundle is a assembly-time property. It seems that these properties could be transitive -- so that, say, war.bundle will pertain to the declaring dependency and all of it's descendants (so that they all end up in the war.bundle). Or perhaps use an XML artifact to control whether it is transitive or not would be useful. I'm probably rehashing old history, but why were dependency properties removed in m2?? Thanks, -- Chris
Re: [m2] missing dependency features??
Inline. Thanks, -- Chris On 11/20/05, Brett Porter [EMAIL PROTECTED] wrote: On 11/21/05, Chris Berry [EMAIL PROTECTED] wrote: Greetings, Seems that dependencies should provide two features they do not already; 1) the ability to explicitly specify the URL from which to download an artifact (in m1, if I recall, this was handled by the jar element). Actually, not quite - the JAR element just let you change the filename, not the repository. This isn't really an artifact as it will have no other meta information (no versioning, no POM, no checksum). What is the use case for having this as a dependency? I can think of 2: - use from a plugin: in which case, passing the URL to the plugin directly and having it manage it seems the best alternative - copied into a webapp/jar/etc: I think this might fit better with a external resources specification we have discussed on the dev list and will consider for 2.1. In the mean time, it will require a custom plugin to download and copy it, or that you manually put it in the repository and look after the versioning. My need is for WSDL file dependencies. If I am building, say, a web service which makes use of other web services, then I need only the WSDL of those web services -- then from it I create the necessary interface code using a code generator (Axis' WSDL2Java). This is a true dependency and should be treated as such. I do not think this should be treated as a external resource when it is truly a dependency. Often WSDLs are published onto some web server somewhere, say, http://svcdefs.myco.com/wsdls/foo.wsdl. There is still no clear way to version WSDLs. Yes, I could copy the WSDL to a maven-style repo. But this violates Don't repeat yourself. So I want to be able to declare a dependency and to also specify a URL from which to grab the file. I'm probably rehashing old history, but why were dependency properties removed in m2?? Well, its our fault for not putting together a FAQ - but you should find plenty of answers in the mail list archives. I'll put a FAQ together :) They were removed because they aren't reliable in a transitive environment. It implies that the dependency knows something about the environment of the dependee, which is back to front. In most cases, granted, the value for war bundle will be the same for a particular dependency - but that relies on the dependency specifying it. In the end, we give control to the actual POM doing the building, trying to use sensible defaults that minimise what needs to be specified, and allowing the use of artifact filters in the configuration of plugins. In my experiece, these properties are application specific and are typically related to the build for the project at hand. And for larger organizations with build systems there is often a uniformity in these properties for all internal projects. What the properties mean in a transitive sense is really up to the project at hand, and thus, it should be switchable behavior. I'll give two concrete examples; 1) I need to speficy which WSDL dependency is my server dependency vs. which are client dependencies because the server dependency is processed differently in WSDL2Java than are the client WSDLs. This is an application specific property. It is not transient. Of course, I could lay in a m2 property -- but this would require that I get things from 2 places. I would far prefer getting a set of WSDL dependencies and then be able to query these dependencies for which are server vs. client. IMO, this is closer to the spirit of what is really happening. 2) I need to proclaim which dependencies are to go into the webapp's /lib ( i.e. war.bundle) This may or may not be transitive, although most likely it is. I.e. put this dependency and all of it's child dependencies into the war bundle. Alternately, we have a base level service engine which has a shared /lib, so many dependencies end up in the shared /lib and not in the war.bundle. Thus, I depend upon the service-engine which has a application specific property; service.engine which I use to process these dependencies differently. I wonder if the answer to this dilemma is to only allow properties at the base project level, and to ignore them at the child levels?? But make no mistake, these properties are important, and removing this capability is a real issue for those us trying to transition from m1 to m2. HTH, Brett - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to disable transitive dependency?
I think the gist of this thread is that, yes, we can add optional or exclusions -- but why not simply add a dependency attribute such as:: dependency transitive=off or even dependencies transitive=off Although it seems that this should be a project-specific property and should not be transitive itself. In other words, it should be ignored if it is found in a child dependency so that if one requests transitive behavior (in the project being assembled) they will get what they expect. On 11/21/05, Eric Jacob [EMAIL PROTECTED] wrote: Hi Carlos, I agree with you. The pom can be improved greatly by specifying only oro and commons-codec as mandatory dependencies. All others should be optional. I'll watch closely this bug :) Thanks. Eric On 11/21/05, Carlos Sanchez [EMAIL PROTECTED] wrote: The problem is that the pom can be improved to add some of them as optional. I'll solve that when solving http://jira.codehaus.org/browse/MEV-161. On 11/21/05, Eric Jacob [EMAIL PROTECTED] wrote: If you want to use all the Acegi's features, sure you need all these jars. But since I don't need single sign on (cas), ldap or jsp support (directory, taglibs) or caching (ehcache), why should I have these dependencies included in my application? I think transitive dependency is great, but sometime it's just better to turn it off and specify by hand the dependencies you want ot use... Eric On 11/21/05, Eric Biesterfeld [EMAIL PROTECTED] wrote: I think there's something more wrong if a jar says it has dependencies and it doesn't actually need them. Are you sure you don't need these? If so, consider using your own repository before ibiblio and strip these of their dependencies. On 11/21/05, Eric Jacob [EMAIL PROTECTED] wrote: Hi John, Thanks for your suggestion. It worths a look! But I still think the ability to disable transitive dependency would be a good thing. It just doesn't feel right to me to exclude more dependencies than I really need. Eric On 11/18/05, John Tolentino [EMAIL PROTECTED] wrote: Hi Eric, If you look at it's pom ( http://www.ibiblio.org/pub/packages/maven2/acegisecurity/acegi-security/0.9.0/acegi-security-0.9.0.pom ), this artifact have 21 direct dependencies. Exclude those and the other transitive dependencies will be excluded as well. You can easily do this if you copy those dependencies from the artifact's pom and paste it to your exclusions. A find and replace for dependency to exclusion within your copied text won't take that much time. Hope this helps. Regards, John Eric Jacob wrote: Hi, Putting the following dependency results in 72 jars downloaded in WEB-INF/lib! dependency groupIdacegisecurity/groupId artifactIdacegi-security/artifactId version 0.9.0/version scoperuntime/scope /dependency Of course, I can exclude unecessary dependencies, but it's a real pain. A better solution would be to disable transitive dependencies all together. Is it supported? Thanks. Eric - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] run a bat file from within a custom plugin
Hi Wim, I had to do something like this as well w/ the antrun Plugin. Ant expects to find a real File for build.xml, and won't extract it from JAR. So I simply used Ant to do all the work. You can ignore the part where I build the ant task. The pertinent part is shown below. BTW. you could even use Ant to exec to run your BAT file. It has all the features you'd eventually need... //- protected void executeTasks( Target target, MavenProject mproject, String msgLevel ) throws MojoExecutionException { verifySetup(); String antFileName = getAntFileName(); String antTargetName = getAntTargetName(); //- // Create the unzip Task //- Task unzipTask = createUnzipTask( antFileName ); addTask( target, unzipTask ); //- // Create the ant Task //- Task antTask = createAntTask( antFileName, antTargetName ); addTask( target, antTask ); //- // Set Ant project properties //- setCommonAntProperties( target ); setAntProperties( target ); //- // Execute the Tasks //- getLog().info( *** target= + target.getTasks().length ); super.executeTasks( target, mproject, msgLevel ); } //- private Task createUnzipTask( String antFileName ) { String pluginGroupId = getPluginGroupId(); String pluginArtifactId = getPluginArtifactId(); String pluginVersion = getPluginVersion() ; ArtifactRepository localRepository = getLocalRepository(); String targetDirectory = getTargetDirectory(); getLog().info( pluginGroupId= + pluginGroupId ); getLog().info( pluginArtifactId= + pluginArtifactId ); getLog().info( pluginVersion= + pluginVersion ); getLog().info( localRepository= + localRepository.getUrl() ); getLog().info( targetDirectory = + targetDirectory ); // First, get build the source JAR file // convert groupId to path (. == /) // FIXME: this is probably possible in maven somewhere?? String groupIdPath = pluginGroupId.replace( '.', '/' ); String slocalRepo = localRepository.getUrl(); // Strip off the file:/ -- there's probably a better way to do this // but converting to a File and pulling the Path was giving incorrect results (on windoze) slocalRepo = slocalRepo.replaceAll( file://, ); getLog().info( \n*** slocalRepo= + slocalRepo ); // build full path to plugin jar -- src=${plugin.artifact} // FIXME: this is probably possible in maven somewhere?? String src = slocalRepo + / + groupIdPath + / + pluginArtifactId + / + pluginVersion + / + pluginArtifactId + - + pluginVersion + .jar ; getLog().info( *** src= + src ); File srcFile = new File( src ); getLog().info( *** srcFile= + srcFile ); //.. // Get the destination dir -- dest=${targetdir} File destFile = new File( targetDirectory ); getLog().info( \n== targetDirectory= + targetDirectory ); getLog().info( \n== destFile= + targetDirectory ); //.. // build the unzip Task // // unzip src=${plugin.artifact} // dest=${targetdir} // patternset // include name=ant/axis-build.xml/ // /patternset // /unzip Expand unzipTask = new Expand(); unzipTask.setTaskName( unzip ); unzipTask.setSrc( srcFile ); unzipTask.setDest( destFile ); unzipTask.setOverwrite( true ); PatternSet pset = new PatternSet(); pset.setIncludes( antFileName ); unzipTask.addPatternset( pset ); return unzipTask; } On 11/22/05, Emmanuel Venisse [EMAIL PROTECTED] wrote: you need to extract your file first (perhaps with plexus-archiver) and then run your script with Commandline Wim Deblauwe a écrit : What do you mean? I see the use of the Commanline class, but it calls an executable that is on the PATH. I'm talking about running a bat file that is delivered with my plugin (in the plugin jar). 2005/11/22, Emmanuel Venisse [EMAIL PROTECTED]: look at release:perform goal. Emmanuel Wim Deblauwe a écrit : Hi, I would like to run a bat file from my plugin. I know that this will make my plugin very unportable to other platforms, but I only need to run on windows. What would be the best way to do this? Since running a bat file from within a jar is not supported, I guess the best way is to extract that bat file from the plugin jar to some temp directory and run it from there. Any other ideas? regards, Wim - 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]
type vs packaging looping over dependencies
Greetings, A couple of questions; 1) Can someone point me at the docs, or if none are available (as it seems), tell me how to create a type of dependency that doesn't actually map directly to it's underlying type -- e.g. say I want to create a type CAR (some hypothetical type) that is actually a TGZ in reality . I think that this has something to do with packaging? But I haven't discovered how to implement this. 2) Since dependencies no longer have arbitrary properties (which IMO is a shame), I need to locate dependencies of a given type (e.g. CAR), since I can simulate properties in this way... Can somebody point me a snippet of Mojo Java code that loops over a project's dependencies, and looks for each dependency of a given type, and then executes some code for that match. I know how to do this in with Jelly, but don't know the corresponding m2 way to do it in Java. So before I go off and scan the Plugin sources (or do a lot of trial and error), I am hoping someone can point me in the right direction... Thanks, -- Chris
Re: type vs packaging looping over dependencies
Thanks Dan, I found some info here as well http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html I had read this before but forgot that this info was there... Thanks, -- Chris On 12/14/05, dan tran [EMAIL PROTECTED] wrote: On 12/13/05, Chris Berry [EMAIL PROTECTED] wrote: Greetings, A couple of questions; 1) Can someone point me at the docs, or if none are available (as it seems), tell me how to create a type of dependency that doesn't actually map directly to it's underlying type -- e.g. say I want to create a type CAR (some hypothetical type) that is actually a TGZ in reality . I think that this has something to do with packaging? But I haven't discovered how to implement this. maven-native at mojo.codehaus.org can map a native-lib to .lib check out the component.xml http://svn.codehaus.org/trunk/mojo/maven-native/native-maven-plugin/?root=mojo 2) Since dependencies no longer have arbitrary properties (which IMO is a shame), I need to locate dependencies of a given type (e.g. CAR), since I can simulate properties in this way... Can somebody point me a snippet of Mojo Java code that loops over a project's dependencies, and looks for each dependency of a given type, and then executes some code for that match. I know how to do this in with Jelly, but don't know the corresponding m2 way to do it in Java. So before I go off and scan the Plugin sources (or do a lot of trial and error), I am hoping someone can point me in the right direction... * NativeLinkMojo.java * ** Set artifacts = this.project.getArtifacts(); Thanks, -- Chris
Re: Is it possible to make pom.xml simpler?
Hi Matt! A big +1 from me. I've been discussing this w/ John, Jason, et al. A push towards simplifying/shortening the XML would be a big help. Cheers, -- Chris On 12/15/05, John Casey [EMAIL PROTECTED] wrote: Actually, an even better thing to do would be to participate in the design for 2.1. The page for some of this discussion is at: http://docs.codehaus.org/pages/viewpage.action?pageId=32108 Cheers, John Allan Ramirez wrote: Please file a jira issue for this http://jira.codehaus.org/browse/MNG -allan Matt Raible wrote: After seeing what the Spring Developers have done to simplify Spring context files, I can't help but think the same thing is possible for Maven 2's pom.xml. Is it possible to add namespaces and make something like the following possible? Before: dependency groupIdspringframework/groupId artifactIdspring/artifactId version1.2.6/version /dependency After: dep:artifact name=org/springframework/spring version=1.2.6/ Or just allow attributes to make things a bit cleaner? dependency groupId=org.springframework artifactId=spring version=1.2.6/ Allowing 1 line instead of 5-6 lines per dependency would allow me to cut my dependencies listing from 140 lines of XML to 37 lines. When the Spring guys allows a couple of elements as attributes (ref and value) - it made writing Spring context files *much* easier. Here's an example of my simplified version: dependencies dependency groupId=cargo artifactId=cargo version=0.6 scope=test/ dependency groupId=commons-lang artifactId=commons-lang version=2.0/ dependency groupId=commons-logging artifactId=commons-logging version=1.0.4/ dependency groupId=displaytag artifactId=displaytag version=1.0 scope=runtime exclusions exclusion artifactId=xalan groupId=xalan/ /exclusions /dependency dependency groupId=uk.ltd.getahead artifactId=dwr version=1.0 scope=runtime/ dependency groupId=org.hibernate artifactId=hibernate version=3.0.5 exclusions exclusion artifactId=jta groupId=javax.transaction/ /exclusions /dependency dependency groupId=geronimo-spec artifactId=geronimo-spec-jta version=1.0.1B-rc4/ dependency groupId=jmock artifactId=jmock version=1.0.1 scope=test/ dependency groupId=junit artifactId=junit version=3.8.1 scope=test/ dependency groupId=jwebunit artifactId=jwebunit version=1.2 scope=test/ dependency groupId=httpunit artifactId=httpunit version=1.6 scope=test exclusions exclusion artifactId=js groupId=rhino/ /exclusions /dependency dependency groupId=log4j artifactId=log4j version=1.2.11/ dependency groupId=postgresql artifactId=postgresql version=8.1-404.jdbc3/ dependency groupId=javax.servlet artifactId=servlet-api version=2.4 scope=provided/ dependency groupId=javax.servlet artifactId=jstl version=1.1.2 scope=runtime/ dependency groupId=taglibs artifactId=standard version=1.1.2 scope=runtime/ dependency groupId=opensymphony artifactId=sitemesh version=2.2.1 scope=runtime/ dependency groupId=springmodules artifactId=springmodules-validator version=0.1 scope=runtime/ dependency groupId=springframework artifactId=spring version=1.2.6/ dependency groupId=springframework artifactId=spring-mock version=1.2.6 scope=test exclusions exclusion artifactId=spring-jdbc groupId=springframework/ exclusion artifactId=spring-web groupId=springframework/ /exclusions /dependency /dependencies Of course, Ivy's syntax is even simpler, so maybe that'll provide some motivation. ;-) dependencies dependency org=apache name=commons-lang rev=2.0 / dependency org=apache name=commons-cli rev=1.0 / /dependencies Matt - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is it possible to make pom.xml simpler?
Agreed. When one has to lean on tools to build a build script, IMO this illuminates a issue. Do not discount the value of readability. When we go from 5-6 lines/dependency to 1 -- then all of a sudden we can see all of the dependencies on a single page -- take Matt's case; from ~140 lines to ~40 -- which implies going from 3 pages of code (60 lines/pg being the norm) to 1. This illustration holds for many things in the pom.xml -- e.g. plugin declaration, etc. IMO, When one has to start scrolling all over the place to figure out a POM, something is amiss. It's not just about taste. It's about a concise, readable, comprehend-able presentation of information. On 12/15/05, Matt Raible [EMAIL PROTECTED] wrote: On 12/15/05, Milos Kleint [EMAIL PROTECTED] wrote: maybe there's just need for tools to help creating the pom content? Tools will solve the problem is never a good solution IMO. Many folks prefer to use simple text editors and they're unlikely to fire up Eclipse just to edit their pom.xml. Matt Milos Chris Berry wrote: Hi Matt! A big +1 from me. I've been discussing this w/ John, Jason, et al. A push towards simplifying/shortening the XML would be a big help. Cheers, -- Chris On 12/15/05, John Casey [EMAIL PROTECTED] wrote: Actually, an even better thing to do would be to participate in the design for 2.1. The page for some of this discussion is at: http://docs.codehaus.org/pages/viewpage.action?pageId=32108 Cheers, John Allan Ramirez wrote: Please file a jira issue for this http://jira.codehaus.org/browse/MNG -allan Matt Raible wrote: After seeing what the Spring Developers have done to simplify Spring context files, I can't help but think the same thing is possible for Maven 2's pom.xml. Is it possible to add namespaces and make something like the following possible? Before: dependency groupIdspringframework/groupId artifactIdspring/artifactId version1.2.6/version /dependency After: dep:artifact name=org/springframework/spring version=1.2.6/ Or just allow attributes to make things a bit cleaner? dependency groupId=org.springframework artifactId=spring version=1.2.6/ Allowing 1 line instead of 5-6 lines per dependency would allow me to cut my dependencies listing from 140 lines of XML to 37 lines. When the Spring guys allows a couple of elements as attributes (ref and value) - it made writing Spring context files *much* easier. Here's an example of my simplified version: dependencies dependency groupId=cargo artifactId=cargo version=0.6 scope=test/ dependency groupId=commons-lang artifactId=commons-lang version=2.0/ dependency groupId=commons-logging artifactId=commons-logging version=1.0.4/ dependency groupId=displaytag artifactId=displaytag version=1.0 scope=runtime exclusions exclusion artifactId=xalan groupId=xalan/ /exclusions /dependency dependency groupId=uk.ltd.getahead artifactId=dwr version=1.0 scope=runtime/ dependency groupId=org.hibernate artifactId=hibernate version=3.0.5 exclusions exclusion artifactId=jta groupId=javax.transaction/ /exclusions /dependency dependency groupId=geronimo-spec artifactId=geronimo-spec-jta version=1.0.1B-rc4/ dependency groupId=jmock artifactId=jmock version=1.0.1 scope=test/ dependency groupId=junit artifactId=junit version=3.8.1 scope=test/ dependency groupId=jwebunit artifactId=jwebunit version= 1.2 scope=test/ dependency groupId=httpunit artifactId=httpunit version= 1.6 scope=test exclusions exclusion artifactId=js groupId=rhino/ /exclusions /dependency dependency groupId=log4j artifactId=log4j version=1.2.11 / dependency groupId=postgresql artifactId=postgresql version=8.1-404.jdbc3/ dependency groupId=javax.servlet artifactId=servlet-api version=2.4 scope=provided/ dependency groupId=javax.servlet artifactId=jstl version=1.1.2 scope=runtime/ dependency groupId=taglibs artifactId=standard version=1.1.2 scope=runtime/ dependency groupId=opensymphony artifactId=sitemesh version=2.2.1 scope=runtime/ dependency groupId=springmodules artifactId=springmodules-validator version=0.1 scope=runtime/ dependency groupId=springframework artifactId=spring version=1.2.6/ dependency groupId=springframework artifactId=spring-mock version=1.2.6 scope=test exclusions exclusion artifactId=spring-jdbc groupId=springframework/ exclusion artifactId=spring-web groupId=springframework/ /exclusions /dependency /dependencies Of course, Ivy's syntax is even simpler, so maybe that'll provide some motivation. ;-) dependencies
[m2] problem with new packaging
Greetings, I am trying to create my own packaging type (named car -- a configuration archive). I need to do this so that I can find all dependencies of type car in a project and process them specially. A car is really just a jar that requires special processing. So I created a special Car Plugin that contains the components.xml shown below. Then I created another project named et-utils-conf that is of this packaging type. I.e. packagingcar/packaging and, of course, depends on my new Car Plugin. But for some unknown reason my car packaging is making a .car file instead of a .jar file. BTW, note that I use the jar plugin directly. What I want is a jar file (so that I can use the maven UnArchiver code) -- but I want the type as car so that I can locate all CAR files in a project's dependencies (using artifact.getType().equals( car )) The following appears in the output when I run mvn install on et-utils-conf, which seems pertinent... [INFO] [install:install] [INFO] Installing c:\cberry\work\etm2\jws\et-utils-conf\target\et- utils-conf-1.0-SNAPSHOT.jar to C:\cberry\.m2\repository\et\et-utils-conf\1.0-SNAPSHOT\et- utils-conf-1.0-SNAPSHOT.car Do I have to setup the install somehow?? Seems that the CAR packaging should do it?? Anyone see what I'm doing wrong?? Thanks, -- Chris component-set components component roleorg.apache.maven.lifecycle.mapping.LifecycleMapping/role role-hintcar/role-hint implementation org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping/implementation configuration phases process-resources org.apache.maven.plugins:maven-resources-plugin:resources /process-resources packageorg.apache.maven.plugins:maven-jar-plugin:jar/package installorg.apache.maven.plugins:maven-install-plugin:install /install deployorg.apache.maven.plugins:maven-deploy-plugin:deploy /deploy /phases /configuration /component component roleorg.apache.maven.artifact.handler.ArtifactHandler/role role-hintcar/role-hint implementation org.apache.maven.artifact.handler.DefaultArtifactHandler/implementation configuration typecar/type extensionjar/extension packagingjar/packaging includesDependenciesfalse/includesDependencies addedToClasspathfalse/addedToClasspath /configuration /component /components /component-set The full output:: [60] ~/work/etm2/jws/et-utils-conf$ mvn install [INFO] Scanning for projects... [INFO] [INFO] Building ET Utils CAR [INFO]task-segment: [install] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [jar:jar] [INFO] Building jar: c:\cberry\work\etm2\jws\et-utils-conf\target\et- utils-conf-1.0-SNAPSHOT.jar [INFO] [install:install] [INFO] Installing c:\cberry\work\etm2\jws\et-utils-conf\target\et- utils-conf-1.0-SNAPSHOT.jar to C:\cberry\.m2\repository\et\et-utils-co nf\1.0-SNAPSHOT\et-utils-conf-1.0-SNAPSHOT.car [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Thu Dec 15 16:50:29 CST 2005 [INFO] Final Memory: 2M/5M [INFO] [61] ~/work/etm2/jws/et-utils-conf$
Re: [m2] problem with new packaging
Thanks Dan !! That did the trick. I'm confused though. The writeup on the m2 site ( http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html) appears to indicate that this XML element is required?? Of course, teh whole components.xml and packaging stuff is a bit like black magic to me ;-) I'm unclear how it all really holds together... Thanks again, -- Chris On 12/16/05, dan tran [EMAIL PROTECTED] wrote: perhaps you should remove packaging in ArtifactHandler component roleorg.apache.maven.artifact.handler.ArtifactHandler/role role-hintcar/role-hint implementation org.apache.maven.artifact.handler.DefaultArtifactHandler/implementation configuration typecar/type extensionjar/extension includesDependenciesfalse/includesDependencies addedToClasspathfalse/addedToClasspath /configuration /component On 12/16/05, Chris Berry [EMAIL PROTECTED] wrote: Greetings, I am trying to create my own packaging type (named car -- a configuration archive). I need to do this so that I can find all dependencies of type car in a project and process them specially. A car is really just a jar that requires special processing. So I created a special Car Plugin that contains the components.xml shown below. Then I created another project named et-utils-conf that is of this packaging type. I.e. packagingcar/packaging and, of course, depends on my new Car Plugin. But for some unknown reason my car packaging is making a .car file instead of a .jar file. BTW, note that I use the jar plugin directly. What I want is a jar file (so that I can use the maven UnArchiver code) -- but I want the type as car so that I can locate all CAR files in a project's dependencies (using artifact.getType().equals( car )) The following appears in the output when I run mvn install on et-utils-conf, which seems pertinent... [INFO] [install:install] [INFO] Installing c:\cberry\work\etm2\jws\et-utils-conf\target\et- utils-conf-1.0-SNAPSHOT.jar to C:\cberry\.m2\repository\et\et-utils-conf\1.0-SNAPSHOT\et- utils-conf-1.0-SNAPSHOT.car Do I have to setup the install somehow?? Seems that the CAR packaging should do it?? Anyone see what I'm doing wrong?? Thanks, -- Chris component-set components component roleorg.apache.maven.lifecycle.mapping.LifecycleMapping/role role-hintcar/role-hint implementation org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping /implementation configuration phases process-resources org.apache.maven.plugins:maven-resources-plugin:resources /process-resources packageorg.apache.maven.plugins:maven-jar-plugin:jar /package installorg.apache.maven.plugins:maven-install-plugin:install /install deployorg.apache.maven.plugins:maven-deploy-plugin:deploy /deploy /phases /configuration /component component roleorg.apache.maven.artifact.handler.ArtifactHandler/role role-hintcar/role-hint implementation org.apache.maven.artifact.handler.DefaultArtifactHandler /implementation configuration typecar/type extensionjar/extension packagingjar/packaging includesDependenciesfalse/includesDependencies addedToClasspathfalse/addedToClasspath /configuration /component /components /component-set The full output:: [60] ~/work/etm2/jws/et-utils-conf$ mvn install [INFO] Scanning for projects... [INFO] [INFO] Building ET Utils CAR [INFO]task-segment: [install] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [jar:jar] [INFO] Building jar: c:\cberry\work\etm2\jws\et-utils-conf\target\et- utils-conf-1.0-SNAPSHOT.jar [INFO] [install:install] [INFO] Installing c:\cberry\work\etm2\jws\et-utils-conf\target\et- utils-conf-1.0-SNAPSHOT.jar to C:\cberry\.m2\repository\et\et-utils-co nf\1.0-SNAPSHOT\et-utils-conf-1.0-SNAPSHOT.car [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Thu Dec 15 16:50:29 CST 2005 [INFO] Final Memory: 2M/5M [INFO] [61] ~/work/etm2/jws/et-utils-conf$
[m2] disabling ibiblio repo search
Greetings, I have an m1 project that I'm converting to m2. And I have a full m1, legacy-style repository. The mail archives tell that supposedly one can disable the use of ibiblio by specifying a repo with the name central. I have tried this, and it's not working for me. This is what I've tried:: profiles profile idet-base/id repositories repository idcentral/id urlfile:///C:/cberry/work/3rdparty-repo//url layoutlegacy/layout /repository /repositories /profile /profiles activeProfiles activeProfileet-base/activeProfile /activeProfiles BTW: Even if this works, this doesn't seem what I'm really after. I'd like to be able to easily turn on/off ibiblio. (i.e. simply specify my explicit repo serach order). This technique feels a bit like a hack to me. It seems that I should be in control -- and m2 shouldn't go off looking at repos without my explicit consent. Thanks, -- Chris
[m2] Repository precedence
Greetings, I would like to prescribe a repository precedence order. I have a legacy-style repo that I want searched first for artifacts -- then second, my ibiblio mirror -- and then possibly ibiblio. How does one set repository precedence in m2?? This was easily and cleanly done in m1 using the maven.repo.remote property. Thanks, -- Chris
[m2] Missing POMs for m1, legacy-style projects
Greetings, AFAICT, m2 goes off and searches for POMs for each artifact it encounters. This is all well and good if the POMs exist, but when one is using a mix of m1 m2 repos, then there will be many artifacts that do not have associated POMs. m2 figures this out and moves on -- as it should -- but it doesn't remember. So every time I build it rediscovers that a POM is missing. This is often ridiculously slow -- as it chains thru the repos, eventually going into the black hole of ibiblio. This can make a build that should take seconds -- take minutes. Does anyone know how to work around this?? BTW: the -offline switch is not working for this. When I use that switch in this situation the build simply dies. BTW: there is another wrinkle to this. If I was able to search my m1 repo first, then m2 should see that an artifact exists and then stop searching for its corresponding POM. This is because you want it to use this artifact, and not mix it up with a POM somewhere down the repo food-chain. Thanks, -- Chris
[m2] add to maven classpath from Ant
Greetings, Is it possible to add to the maven Classpath from Ant. In Jelly we would use:: maven:addPath id=maven.dependency.classpath refid=libEntryPath/ Is there an equivalent way to do this manipulation from Ant script Thanks, -- Chris
Re: [m2] disabling ibiblio repo search
Hi Dan, I figured out what went wrong. On windoze one must put your settings.xmlfile into Documents and Settings/name/.m2. This is true even if you use cygwin and even if you put your local repo into another HOME (i.e. cygwin-based). When I use the settings as shown above, central can be overloaded. Cheers, -- Chris
Re: [m2] Missing POMs for m1, legacy-style projects
Inline. Cheers, -- Chris On 12/18/05, Brett Porter [EMAIL PROTECTED] wrote: On 12/19/05, Chris Berry [EMAIL PROTECTED] wrote: Does anyone know how to work around this?? Previously, we'd written a dummy into the local repository, but this meant that if you then went and corrected it remotely it didn't get picked up. We need an alternative solution there. I think the answer to this is to mark the dummy POM -- or to simply put a touch file in the the local repo -- i.e. no dummy POM at all -- just an indicator that no POM was found. I definitely do not think you should look every time. It makes the builds way too slow -- rediscovering what it just learned the last go around.. Maybe treat them like SNAPSHOTs?? BTW: the -offline switch is not working for this. When I use that switch in this situation the build simply dies. I recall seeing this too. I'm not sure if it found its way to JIRA. It is pretty easy to reproduce. Jason witnessed it when we were hanging out last week ;-) BTW: there is another wrinkle to this. If I was able to search my m1 repo first, then m2 should see that an artifact exists and then stop searching for its corresponding POM. This is because you want it to use this artifact, and not mix it up with a POM somewhere down the repo food-chain. This makes sense - so you want to tie the resolution of the POM to the same JAR? I thought this was how it behaved (POM first, with the repository remembered to get the JAR). I'm not sure how you are seeing this exactly. I actually saw an issue with this today. I have an m1, legacy-style repo, so, of course, there are no POMs in it. The artifact I was after was available in the first repo, but no POM was -- so m2 kept on searching -- it then found a m2-style POM for this artifact. This POM did not match, and in some cases it caused issues. E.g. I had axis-1.3.jar in my local m1 repo, but it found a POM on ibiblio. Or activation-1.0.2.jar which was in jaf/jars, but it found a POM there that said it had moved. I ended up having to delete portions of my local repo, and then forced it to overload central -- after doing this it worked. Thanks, -- Brett - Brett - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] issue w/ dependency mediation
Greetings, Yesterday I saw an issue w/ m2's dependency mediation. Some transitive dependency wanted JUnit 3.7 and I'm assuming 3.8.1. Since this one was seen first, it won. So, of course, my build broke. (Before you ask, I don't directly declare the JUnit dependency in my POM because I have a dependency set of commonly used dependencies ;-) I'm wondering about the status of a couple of Mediators 1) A fail-fast-mediator would simply stop the build when conflicts occur. IMHO, this would make the most sense as the default mediator since it makes debugging a lot easier. No head scratching. 2) A use-latest-mediator would be my choice. The use-first-found-mediator seems somewhat illogical to me?? Thanks, -- Chris
Re: Support for mojos written in Ant
Hi Filip, I think your best bet might be to checkout the Plugin from SVN. IMHO, this is the best way to get the full picture as things are still in flux -- and the docs will likely not have caught up with the code. Of course, you'll need a Subversion Client (I use TortoiseSVN) AFAIK, this should work:: svn co https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-antrun-plugin Some info here:: http://maven.apache.org/guides/mini/guide-using-ant.html And several posts on this list Cheers, -- Chris On 12/22/05, Nitko2 [EMAIL PROTECTED] wrote: Hi, John Casey in 2.0.1 announcement mail said that 2.0.1 includes support for mojos written in Ant. Can someone point me to some documentation or JIRA issue or anything that would be useful info about this. Thanks, Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] m1 - m2 surefire problem
Greetings, I am converting an m1 project to m2. Unfortunately I am getting different behavior in the test phase of the build. In m1, of course, it all runs fine. But under m2 (i.e. surefire) when my test accesses the Internet, it is has Proxy issues and fails, and when I work around that; it has Redirection issues. What is troublesome is that this same code runs without issue under m1. I have gone to great lengths to insure that I am using the exact same set of dependencies in both m1 m2 (CLasspath is the same, etc.) I'm pretty convinced that this is a surefire problem. I've tried setting forkMode to true, but that doesn't help. Does anyone have any idea why surefire would be giving me different results?? Thanks, -- Chris
Re: [m2] Antrun / Javac
Actually, I think this is a bug in the antrun Plugin. Ant, by definition, should have system properties available to it -- such as the ${ java.class.path} property you require or ${user.home} or whatever. In my local version of antrun I had to do the following fix in org.apache.maven.plugin.antrun.components.AntTargetConverter // //initDefinitions( project, target ); project.init(); // so that it properly initializes the Ant project. Cheers, -- Chris On 12/23/05, Giles, Nick [EMAIL PROTECTED] wrote: Thanks, the system dependency worked a treat. I'm surprised that the plugin needs it though... Cheers, Nick -Original Message- From: Scokart Gilles [mailto:[EMAIL PROTECTED] Sent: 23 December 2005 12:24 To: Maven Users List Subject: RE: [m2] Antrun / Javac Here is an example of doing wath you want, I think. plugin artifactIdmaven-antrun-plugin/artifactId executions execution phasegenerate-test-sources/phase configuration tasks ant antfile=src/test/ant/build.xml inheritRefs=true/ /tasks testSourceRoottarget/generated-sources/nextmock/testSourceRoot /configuration goals goalrun/goal /goals /execution /executions dependencies dependency groupIdsun.jdk/groupId artifactIdtools/artifactId version1.5/version scopesystem/scope systemPath${java.home}/../lib/tools.jar/systemPath /dependency /dependencies /plugin -Original Message- From: Giles, Nick [mailto:[EMAIL PROTECTED] Sent: 23 December 2005 11:51 To: users@maven.apache.org Subject: [m2] Antrun / Javac I'm having distinct problems with the Antrun plugin for Maven2, specifically with the inheritance of properties and environment variables. With a simple test where the pom.xml calls a build.xml, which then uses javac, Ant complains about not being able to find com.sun.tools.javac.Main on the classpath. This isn't the usual Ant problem that gives that message, because Ant will run fine from the command line, it's an inheritance from Maven problem. With the files described below, I get a negligible classpath in the Maven part of the operation, and a null classpath in the Ant part. If I run the buildfile from the commandline, I get a full and proper classpath, and execution works. Does anyone have any idea how I can get this to work, and why it does work in one of my projects, but I'm scared to change it to try and find out why, because I'll never get it back to working again... Cheers, Nick Pom.xml: project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion groupIdworkbench/groupId artifactIdworkbench/artifactId packagingjar/packaging version1.0-SNAPSHOT/version build sourceDirectory./sourceDirectory plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-antrun-plugin/artifactId executions execution phasegenerate-sources/phase configuration tasks echo message=Classpath in Antrun task = ${java.class.path}/ ant antfile=build.xml dir=. inheritAll=true /ant /tasks /configuration goals goalrun/goal /goals /execution /executions /plugin /plugins /build /project == Build.xml: project name=Workbench default=run basedir=. target name=run depends=clean,compile java classname=Workbench / /target target name=compile echo message=Classpath in Ant: ${java.class.path} / javac srcdir=. / /target target name=clean delete fileset dir=. include name=*.class / /fileset /delete /target /project = Workbench.java: public class Workbench { public static void main(String[] args) { System.out.println(Hello); } } This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you.
Re: Support for mojos written in Ant
What exactly do you mean written in Ant?? Do you mean using Ant's Java Tasks directly from the Mojo Java?? That is pretty easily done. There is info on using Ant from Java here http://www-128.ibm.com/developerworks/websphere/library/techarticles/0502_gawor/0502_gawor.html FWIW, what I've done is create a specialized Mojo that allows you to create an Ant build.xml and then build a reusable Mojo that use it. I submitted this into JIRA, but don't know if its been integrated yet. You can get the code here (its attached to the Issue)... http://jira.codehaus.org/browse/MNG-897 BTW: this code illustrates using Ant form Java... Cheers, -- Chris On 12/23/05, Nitko2 [EMAIL PROTECTED] wrote: Chris, thank you for your answer. I know about antrun, and I've been using it. But it isn't what I need. I would like to write plugins using ant(mojos written in Ant), not execute ant build files. I can't find anything about that here http://maven.apache.org/guides/mini/guide-using-ant.html Filip Chris Berry wrote: Hi Filip, I think your best bet might be to checkout the Plugin from SVN. IMHO, this is the best way to get the full picture as things are still in flux -- and the docs will likely not have caught up with the code. Of course, you'll need a Subversion Client (I use TortoiseSVN) AFAIK, this should work:: svn co https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-antrun-plugin Some info here:: http://maven.apache.org/guides/mini/guide-using-ant.html And several posts on this list Cheers, -- Chris On 12/22/05, Nitko2 [EMAIL PROTECTED] wrote: Hi, John Casey in 2.0.1 announcement mail said that 2.0.1 includes support for mojos written in Ant. Can someone point me to some documentation or JIRA issue or anything that would be useful info about this. Thanks, Filip - 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]
Re: Running a single test?
mvn -Dtest=MyTest test Note: MyTest is your java test class. Note: Use it unqualified -- without its package name (e.g. without com.myco.) otherwise, this confuses m2 On 12/23/05, Raymond N. Ritz [EMAIL PROTECTED] wrote: Is there a way to run a single junit test case in maven 2? Raymond Ritz
Re: Re: Running a single test?
I don't know why. It could be a bug?? Happy Holidays, -- Chris On 12/23/05, Raymond N. Ritz [EMAIL PROTECTED] wrote: Thanks Chris. This works. I have previously tried the mvn test -dtest=xxx.yyy.classname . do you know why this approach was chosen? This seems strange to me, but I may not know why this was done. Thanks Ray -Original Message- From: Chris Berry [mailto:[EMAIL PROTECTED] Sent: Friday, December 23, 2005 1:39 PM To: Maven Users List; [EMAIL PROTECTED] Subject: Re: Running a single test? mvn -Dtest=MyTest test Note: MyTest is your java test class. Note: Use it unqualified -- without its package name (e.g. without com.myco.) otherwise, this confuses m2 On 12/23/05, Raymond N. Ritz [EMAIL PROTECTED] wrote: Is there a way to run a single junit test case in maven 2? Raymond Ritz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] required JDK version
Greetings, I would like clarification on what version of the JDK is required for m2 -- particularly with respect to creating Plugins. As far as I know, JDK 1.5 is not required -- and maven has a special way to handle annotations. I believe I have read about this somewhere, but can no longer locate it in the docs. AFAIK, 1.4+ is required?? Thanks, -- Chris
[m2] multi-module question
Greetings, Is it possible to specify multiple modules in a POM that are deeper than 1 level. In other words, say I have the following structure: /top/pom.xml == the multi-module POM /top/a/b/c/d/pom.xml== build 1 /top/a/e/f/pom.xml== build 2 /top/g/h/pom.xml == build 3 How can I type maven install in /top and have build 1,2,3 built I have searched the List archives and the site docs, and cannot find any pertinent info. My apologies if I missed it... Thanks, -- Chris
Re: ${project.build.directory} different in M2.0 M2.0.1
We have seen the same issue, and it is a serious PITA. Now we will have to go through any home grown Plugins and modify them accordingly. 1) the absolute path makes more sense, and more importantly, matches all previous behavior, particularly m1!! 2) this sort of change should come with a huge red flag attached, as it breaks peoples code. It certainly shouldn't come in a minor release Thus, I can only assume that this is an bug?? Can we expect this to be fixed in 2.0.2?? Thanks, -- Chris On 1/5/06, Jens Zastrow [EMAIL PROTECTED] wrote: In Maven 2.0 the value containes the whole absolute path to the target dir. C:\windows\system32\target With Maven 2.0.1 only: target\ I use the JavaCC-plugin: plugin groupId org.codehaus.mojo/groupId artifactIdjavacc-maven-plugin/artifactId version0.6.1-SNAPSHOT/version configuration outputDirectory${ project.build.directory}/generated-src/main/java/out putDirectory /configuration /plugin The problem now arise when the project with javacc is part of a multi-module build (with 2.0.1). Because ${project.build.directory}/generated-src/main/java evalulates to target/generated-src/main/java the files are generated to the parent-project target-directory! Which value should ${project.build.directory } contain? Thanks Workaround: Its simple to fix this in the pom.xml using ${basedir}/target/generated-src/main/java. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Maven 2 and Ant classpath issue
Hassan, Please search the list archives -- this has been covered many times recently. If that doesn't answer your question, then please post the POM snippet that shows the ant call. (You may have forgotten inheritRefs=true) Cheers, -- Chris On 1/10/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi I'm using Maven 2.0.1 and trying to use a non-standard Ant task (scriptdef), in my pom.xml. It's giving me this error: Embedded error: Could not create task or type of type: scriptdef. Looks like the Maven classpath is not being used by Ant... Just to confirm, I have the required dependency jar in my pom.xml: dependency groupIdbsf/groupId artifactIdbsf/artifactId version2.3.0/version /dependency Your help is highly highly appreciated. Thanks Haz
Re: Support for mojos written in Ant
I use Ant as a fundamental scripting language for Maven. I use the antrun plugin. I have a hacked up version that allows me to build Plugins that hold an Ant build file and a simple, thin Mojo that extends the Antrun base class. When executed this Plugin unpacks the Ant build.xml and executes targets against it. It works like a charm. The power of Ant plus the power of maven -- no reinventing the wheel... And AFAIK Jason, John, et al have incorporated my changes into the latest/greatest version -- though I've not tried it since my hacked up version is working fine for me... Cheers, -- Chris On 1/11/06, Michael Böckling [EMAIL PROTECTED] wrote: Hi Michal, thank you for your information. Now I tried to do the same, and I get the exact same error as you. It seems the support for mojos written in ANT is unusable in its current state. Maybe some developer can say something? Regards, Michael -Original Message- From: Michael Böckling [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 1:56 PM To: Maven Users List Subject: Support for mojos written in Ant Hi, what happened to the maven-antfile-plugin? I can't find it anywhere... I figured it provides the possiblity to use ANT as mojo language, but the whole thing is a little unclear to me. My attention was raised by the 2.0.1 annoncement, and then I found this on the mailinglist: http://www.nabble.com/Support-for-mojos-written-in-Ant- t791610.html#a2080582 Would be great if someone could shed some light on this... I was trying to write a ant-mojo few weeks ago. I had similar problems with documentation. After little investigation I found the link below. I believe it will be helpful. http://svn.apache.org/viewcvs.cgi/maven/components/trunk/maven-plugin-tools/maven-plugin-tools-ant/integration-tests/ I've tried to write my plugin basing on those test cases, but I'm having following exception. I've also tried to build those test cases, but the problem is the same. Maybe you will have more luck ;) [INFO] [plugin:descriptor] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor.extractMojoDescriptors (Ljava/util/Map;Lorg/apache/maven/plugin/descriptor/PluginDescriptor;)Ljava/util/List; [INFO] [INFO] Trace java.lang.AbstractMethodError: org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor.extractMojoDescriptors (Ljava/util/Map;Lorg/apache/maven/plugin/descri ptor/PluginDescriptor;)Ljava/util/List; at org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtrator.execute (AbstractScriptedMojoDescriptorExtractor.java:32) best regards, -- Michal Stochmialek IT Department, Technology Division Euro Bank S.A. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Giniality AG - Michael Böckling; Steinenberg 21, CH-4051 Basel P: +41 61 226 99 63 - F: +41 61 226 99 69 [EMAIL PROTECTED]; http://www.giniality.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Support for mojos written in Ant
http://maven.apache.org/plugins/maven-antrun-plugin/introduction.html On 1/11/06, Chris Berry [EMAIL PROTECTED] wrote: I use Ant as a fundamental scripting language for Maven. I use the antrun plugin. I have a hacked up version that allows me to build Plugins that hold an Ant build file and a simple, thin Mojo that extends the Antrun base class. When executed this Plugin unpacks the Ant build.xml and executes targets against it. It works like a charm. The power of Ant plus the power of maven -- no reinventing the wheel... And AFAIK Jason, John, et al have incorporated my changes into the latest/greatest version -- though I've not tried it since my hacked up version is working fine for me... Cheers, -- Chris On 1/11/06, Michael Böckling [EMAIL PROTECTED] wrote: Hi Michal, thank you for your information. Now I tried to do the same, and I get the exact same error as you. It seems the support for mojos written in ANT is unusable in its current state. Maybe some developer can say something? Regards, Michael -Original Message- From: Michael Böckling [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 1:56 PM To: Maven Users List Subject: Support for mojos written in Ant Hi, what happened to the maven-antfile-plugin? I can't find it anywhere... I figured it provides the possiblity to use ANT as mojo language, but the whole thing is a little unclear to me. My attention was raised by the 2.0.1 annoncement, and then I found this on the mailinglist: http://www.nabble.com/Support-for-mojos-written-in-Ant- t791610.html#a2080582 Would be great if someone could shed some light on this... I was trying to write a ant-mojo few weeks ago. I had similar problems with documentation. After little investigation I found the link below. I believe it will be helpful. http://svn.apache.org/viewcvs.cgi/maven/components/trunk/maven-plugin-tools/maven-plugin-tools-ant/integration-tests/ I've tried to write my plugin basing on those test cases, but I'm having following exception. I've also tried to build those test cases, but the problem is the same. Maybe you will have more luck ;) [INFO] [plugin:descriptor] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor.extractMojoDescriptors(Ljava/util/Map;Lorg/apache/maven/plugin/descriptor/PluginDescriptor;)Ljava/util/List; [INFO] [INFO] Trace java.lang.AbstractMethodError: org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor.extractMojoDescriptors(Ljava/util/Map;Lorg/apache/maven/plugin/descri ptor/PluginDescriptor;)Ljava/util/List; at org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtrator.execute (AbstractScriptedMojoDescriptorExtractor.java :32) best regards, -- Michal Stochmialek IT Department, Technology Division Euro Bank S.A. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Giniality AG - Michael Böckling; Steinenberg 21, CH-4051 Basel P: +41 61 226 99 63 - F: +41 61 226 99 69 [EMAIL PROTECTED]; http://www.giniality.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unittests and test data files in maven
hi Dave, Make sure that you add /target/test-classes to your CLASSPATH for IntelliJ. Your test resources end up here. Cheers, -- Chris On 1/15/06, Dave Hoffer [EMAIL PROTECTED] wrote: Emmanuel, Thanks, I understand the idea you suggest but I am having some trouble getting it to work. I am having difficulty getting getResource()/getResourceAsStream() to find my resourceName. I am using IntelliJ and I suspect the problem is that my test directory(s) is not being attached to the classpath. Any help regarding this is appreciated. -dh -Original Message- From: Emmanuel Venisse [mailto:[EMAIL PROTECTED] Sent: Saturday, January 14, 2006 4:47 PM To: Maven Users List Subject: Re: Unittests and test data files in maven Standard directory layout is defined there : http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html so, if you want to respect maven best practices, you'll put your test resources in src/test/resources and subdirectories. This directiry can be configured in your pom (http://maven.apache.org/maven-model/maven.html#class_testResource). All test resources will be copied to target/test-classes and attached to classpath when maven will run tests. In your test class, the best way to access to your test resources is to use getClass().getResources( resourceName ) or getClass().getResourceAsStream( resourceName ) Emmanuel Dave Hoffer a écrit : In Maven what is the best practice of referencing test files for use in unit tests? Prior to using Maven, we will typically load test files with code like this in our test classes ./TestData/Parameters/Reflectance.xml. This doesn't work in Maven as the current directory is different. Maven seems to want the files in the \test\resources\ folder but this gets copied to the target folder. What is the best practice given that both Maven and the IDE (in our case IntelliJ) have to be able to run the tests? -dh - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] Repeatable build and plugin version resolution
I agree 100%. The Release Plugin should 1) Insure that all dependency versions, including those of maven itself, are captured for repeatability 2) Insure that no dependencies, including those of maven itself, are SNAPSHOTs, which, by definition, are not repeatable BTW: to truly insure repeatability, one should also create their own maven remote repo and move versions off the Internet, The Internaet is too flaky to assume that some version you require will still be available in 6 months. (I think maven-proxy -- with a backup system -- could help a lot here...) Cheers, -- Chris On 1/16/06, Daniel Kulp [EMAIL PROTECTED] wrote: I'd LOVE an extension to the release plugin or something that would go through the build and create a properties file with the version numbers for ALL dependencies and updates the poms to use it. Thus, we could easily see what versions of stuff is being loaded (important for audits) as well as lock down the versions as you release the code. The properties file could be checked into source control so the build is completely repeatable. Dan On Monday 16 January 2006 06:27, Scokart Gilles wrote: It's also the approach I had in mind. But, I can not be sure that all the plug-in versions are defined in the pom(s). A solution would be to have a parameter on the command line --repeatable. With such a flag asking for plugin version number resolved with information coming from the pom(s) only. Does it make sense? Or did I miss something? Gilles -Original Message- From: Brian E. Fox [mailto:[EMAIL PROTECTED] Sent: 14 January 2006 19:25 To: Maven Users List Subject: RE: [m2] Repeatable build and plugin version resolution I think the standard and easiest to manage is to create a parent pom that your projects inherit from. In this pom, put your plugin and dependency versions in the pluginMangement and dependencyManagement section. Then when you don't specify the version in your child pom's the version from the parent is used. It makes it much easier to control your build environment, especially having control over the plugins. -Original Message- From: Scokart Gilles [mailto:[EMAIL PROTECTED] Sent: Saturday, January 14, 2006 12:17 PM To: Maven Users List Subject: [m2] Repeatable build and plugin version resolution How can we guarantee a repeatable build? I mean, when I build a project, the most recent available versions of the plugins are used. That means that there is a risk that rebuilding a project after 6 months provides a different result. I know that it possible to force the plugins version number in the pom.xml. But how can we guarantee we don't miss one when writing the pom? Is there other approach (Maybe linked with the plugin registry)? Thanks, SCOKART Gilles - 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] -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727 C: 508-380-7194 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] Ant driven plugins and classpath refid's
Did you follow this doc; http://maven.apache.org/plugins/maven-antrun-plugin/classpaths.html Cheers, -- Chris On 1/17/06, Henrik Mejlgaard [EMAIL PROTECTED] wrote: Hi, From the documentation in http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html, I have successfully created the Hello World Ant based plugin. My problem is now to implement a more advanced ant-based mojo. Specifically, I have troubles finding out how to get a ant classpath refid to be used in a taskdef in the *.build.xml. My taskdef looks as follows: target name=generate taskdef name=ejbdoclet classname=xdoclet.modules.ejb.EjbDocletTask classpath path refid=plugin.dependency.classpath/ /classpath /taskdef .. /target How do I inject the plugin.dependency.classpath from the *.mojos.xml? Regards, Henrik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Executing a task before Clean
Hi Paul, You can, you will have attach the task early on in the build process -- say, at the validate phase. Currently, all attached Plugins execute after teh phase they refer to. I am uncertain what the actual lifecycle (i.e. the phases) is for the Clean Plugin, maybe a M2 expert can tell us all?? Cheers, -- Chris On 1/18/06, Paul Hepworth [EMAIL PROTECTED] wrote: Hi Is it possible to run an Ant task using antrun before the clean task is executed?? I need to do this due to a limitation with Windows in that my directory structure is too deep and exceeds the maximum depth so the classes cannot be deleted. I need to run an ant task that will move the classes to a directory C:\t so that they can be deleted. Any suggestions? Cheers Paul This message should be regarded as confidential. If you have received this email in error please notify the sender and destroy it immediately. Statements of intent shall only become binding when confirmed in hard copy by an authorised signatory. The contents of this email may relate to dealings with other companies within the Detica Group plc group of companies. Detica Limited is registered in England under No: 1337451. Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP, England.
custom dependency type
Greetings, I am wondering if there is a standard solution to this problem anywhere. I can't seem to find one, but I could have easily have overlooked it... What we need to do is; download a file, put it in the local repo, and also on the classpath. To make this concrete, I'll explain our use-case. I would like to; 1) create a dependency on a RelaxNG schema (a RNC file) in the POM; dependency typernc/type groupIdcom.foo/groupId artifactIdfoobar/artifactId version1.1/version /dependency 2) hook up some plugin in the POM, telling it to recognize RNC types, and to do its work during resource resolution phase 3) the plugin would 3.1) download the RNC to the local repo 3.2) copy it to target/classes, so that we can use it as Classpath resource (to do RelaxNG validation) This seems like it might be something people would commonly want to accomplish. Not just for RNC files, but for any custom type. We've hacked up a custom plugin to do this. But it doesn't seem like we should have too ??? If we do have to create a custom plugin, could someone give a synopsis of the best practice for accomplishing this?? I'd like to verify that we've done it the best way... Thanks, -- Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]