Re: Adding files to target before creating war
The target directory is probably created in the generate-resources phase, before the compile phase. What about trying it in the package phase? You can also try the pre-integration-test phase, but this will only be called if you run maven with a target higher than package. Here are the various phases, scroll down to Default Lifecycle: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html Csaba On 21.3.2011 15:55, Sam Adams wrote: Hi, I'm pretty new to Maven user but have been using it in a simple case for a while now to create a web based project. Currently I use war:exploded for local development and install for creating a distributable. I'm now in a situation where I want to overwrite some standard files (properties, etc) for certain profiles. I was hoping I could do this with antrun. I origionally bound the plugin to run at the prepare-package phase but it looks as if this is too early. The target directory gets created after this and the copied files are over ridden. Is there a way I can run this after the target directory is created but before the war is built? Thanks, Sam - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to override the default logger?
Hi there, I would like to verride Maven's default logger with my own. How to do this? I see that Mojo has a setLog() method, so I was thinking of making a mojo that executes in the first phase (validate), it would set the log with setLog()... and then all the other mojos that execute in the later phases would use this logger. Would this work? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Configure logging in custom mojo
Is there a way to configure logging in a properties file? Something like log4j.properties? I would want, for example, to output to a file, in DEBUG level... Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: m2eclipse plugin builder or launcher
That's brilliant! Thank you very much, it works perfectly! Csaba On 21.12.2010 9:16, Lucas Persson wrote: Hi Here is some code snippet that launches a maven goal. (It is easy to for instance launch an Ant target, it is just another launch configuration that must be used) This snippet does not really has any dependency to the m2eclipse plugin. import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchesListener2; import org.eclipse.jface.operation.IRunnableWithProgress; public class Maven2Runner { private static final String MAVEN_LAUNCH_CONFIG_TYPE = "org.maven.ide.eclipse.Maven2LaunchConfigurationType"; //$NON-NLS-1$ /** * Run a maven goal for the project. After the goal has been run, the * project is refreshed * * @param project * @param mavenGoalString */ public static void runMavenGoal(final IProject project, final String mavenGoalString) { final ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager() .getLaunchConfigurationType(MAVEN_LAUNCH_CONFIG_TYPE); //$NON-NLS-1$ final String launchName = project.getName(); IRunnableWithProgress runnable = new IRunnableWithProgress() { @SuppressWarnings("unchecked") public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { monitor.beginTask("Running maven goal '" + mavenGoalString + "'", 100); ILaunchConfigurationWorkingCopy config = null; config = type.newInstance(null, launchName); List options = new ArrayList(); config.setAttribute( "org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND", true); config.setAttribute("M2_PROPERTIES", options); config.setAttribute("org.eclipse.jdt.launching.WORKING_DIRECTORY", "${workspace_loc:/" + project.getName() + "}"); config.setAttribute("M2_GOALS", mavenGoalString); config.setAttribute("M2_PROFILES", ""); // Launch the goal ILaunch launch = config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); // add listener so the project can be refreshed later when the maven // goal is terminaded DebugPlugin.getDefault().getLaunchManager().addLaunch(launch); LaunchesListener.PostLaunchAction pla = new LaunchesListener.PostLaunchAction() { public void execute() throws Exception { project.refreshLocal(IResource.DEPTH_INFINITE, null); } }; ILaunchesListener2 launchesListener = new LaunchesListener(launch, pla); DebugPlugin.getDefault().getLaunchManager().addLaunchListener( launchesListener); monitor.worked(100); } catch (CoreException ce) { // TODO } } }; // Launch the task with progress try { Progress progress = new Progress(MyPlugin.getShell(), runnable); progress.run(); } catch (InvocationTargetException ite) { // TODO } catch (InterruptedException ie) { // TODO } } This code can be called from a context menu item i.e. an org.eclipse.ui.actions.ActionDelegate implmentation of your own. Cheers Lucas On 12/21/2010 08:27 AM, Gajo Csaba wrote: Hi, I have a question regarding the m2eclipse plugin. Let me know if this is not the right place to ask. I'm writing my own custom plugin, and I would like to execute the "mvn package" command. Meaning: I want to run the m2eclipse
m2eclipse plugin builder or launcher
Hi, I have a question regarding the m2eclipse plugin. Let me know if this is not the right place to ask. I'm writing my own custom plugin, and I would like to execute the mvn package command. Meaning: I want to run the m2eclipse builder, so that it would run the Run As-Maven package. Anyone has some source code or can give me a tip how to do this? I'm guessing that I would need to create a new LaunchConfiguration, but I've no idea how to start... Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Creating a custom lifecycle
Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can we use maven in offline environment?
1. create a dummy maven project 2. in the pom.xml add in the dependencies, plugins and reporting ALL the files you'll need... possibly include all the versions as well 3. go to a computer that does have internet and run mvn clean site package install deploy dependency:go-offline and a handful of other commands you can think of 4. package your local .m2 directory into a zip file and copy on your usb flash 5. go to your local offline computer and extract the zip file 6. in .m2/settings.xml set the offlinetrue/offline This is how you work with Maven in offline mode... Cheers, Csaba On 1.12.2010 11:51, maven apache wrote: 2010/12/1 Antonio Petrelliantonio.petre...@gmail.com 2010/12/1 maven apacheapachemav...@gmail.com: In a word,all development related machine can not access the internet. But they can access each other in the Local Area Network. I mean the build machine as my own work machine. It can access the repository machine through Local Area Network. But the repository machine should access the Internet at least once. Isn't it possible? No. Once. All the jars can only be downloaded in a online machine then transfered to the repository machine by usb-dirver :(. If it can access the Internate once,I would not have these problems. Stupid security reasons :-D :( Antonio - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
I want to delete the deploy goal. Make it exist as much as mvn apple does On 1.12.2010 12:14, Antonio Petrelli wrote: It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csabacsaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
I didn't try it yet, but I'll try it now. I think this will not solve the problem. If you write mvn deploy, you will probably have the compile, test etc. phases executed. What I need is, to not run any of these phases, but immediately print out this is not supported and end the execution. The only way to do is, as far as I know, is to create my own lifecycle. Csaba On 1.12.2010 12:31, Simone Tripodi wrote: take a look at the maven deploy plugin configuration[1] and set skiptrue/skip hope this helps Simo [1] http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Wed, Dec 1, 2010 at 12:18 PM, Gajo Csabacsaba.g...@cosylab.com wrote: I want to delete the deploy goal. Make it exist as much as mvn apple does On 1.12.2010 12:14, Antonio Petrelli wrote: It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csabacsaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
Yes, I've created a new packaging. In my test project pom.xml, I now have: packagingapple/packaging build plugins plugin groupIdcom.test.phases/groupId artifactIdAppleLifecycle/artifactId extensionstrue/extensions /plugin /plugins /build The AppleLifecycle project defines the apple lifecycle. However, contrary to how custom lifecycles are usually defined, my components.xml looks like this: plexus components component roleorg.apache.maven.lifecycle.mapping.LifecycleMapping/role role-hintapple/role-hint implementationcom.test.phases.HelloLifecycle/implementation /component /components /plexus The HelloLifecycle is my custom lifecycle, which supports only the compile phase. So if you write mvn package, it will skip all the phases, and execute only compile. The lifecycle.xml looks like this: lifecycles lifecycle idapple/id /lifecycle /lifecycles This works, the test project uses my custom lifecycle for building itself. However, the compile, test, package etc. goals are still there. I want to redefine them. The problem is, that if I write mvn deploy, it will execute also mvn compile (because compile test package install deploy). What I want is, when I write mvn deploy, that it doesn't execute compile. Instead, it should just print out a message. How to do this? I know that this is possible. For example, the site command is outside the scope of the default lifecycle. If you write mvn deploy, then the site phase will not get executed. Also, if you write site, it will not invoke deploy. What I want is, when I write deploy, that it doesn't invoke the test, compile, package etc. phases, but instead print out a message. Csaba On 1.12.2010 12:48, Tamás Cservenák wrote: Not sure what you aiming for, but you could introduce new packaging, and that new packaging might introduce completely new lifecycle also. If you build some custom packaging, this would be the best, since it gives you freedom to do all what you need in your custom build, but also freedom to map whatever you want in there. Thanks, ~t~ On Wed, Dec 1, 2010 at 12:34 PM, Gajo Csabacsaba.g...@cosylab.com wrote: I didn't try it yet, but I'll try it now. I think this will not solve the problem. If you write mvn deploy, you will probably have the compile, test etc. phases executed. What I need is, to not run any of these phases, but immediately print out this is not supported and end the execution. The only way to do is, as far as I know, is to create my own lifecycle. Csaba On 1.12.2010 12:31, Simone Tripodi wrote: take a look at the maven deploy plugin configuration[1] and set skiptrue/skip hope this helps Simo [1] http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Wed, Dec 1, 2010 at 12:18 PM, Gajo Csabacsaba.g...@cosylab.com wrote: I want to delete the deploy goal. Make it exist as much as mvn apple does On 1.12.2010 12:14, Antonio Petrelli wrote: It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csabacsaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How do redefine the path to an element, in a custom mojo?
I took Stephen's advice and looked at the maven-ant-plugin to see how I can override the parsing of a plugin's configuration. Now I have a parser which works just fine, and can parse the following: configuration packages package name=xxx dependency name=aaa version=1.0 type=abc / ... /package /packages /configuration This all works fine for the objects Package and Dependency. The problem is these two objects must be located in the same Java package as where the main mojo is. What I mean is, if mojo is in com.company.plugin.HelloWorldMojo, then I must also have com.company.plugin.Package. I would like to have com.company.plugin.model.Package. I'm guessing that I should override something in components.xml to redefine the location of the model object? Anyway, I couldn't find it myself, so does anyone know what should I do to make this work? I've looked at the source code of org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter and the way the object is loaded is basically this: retValue = classLoader.loadClass( classname ); So I guess I could make some changes here myself, so that it would loadClass( packageName + classname ); but I was wondering if there's some prettier way to do it, possibly by declaring something in components.xml Thanks for any help, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to set log level when testing a custom mojo?
I know that I can set the log level to DEBUG mode with the -X option, but then I get thousands of lines of useless output. Is there a way I can limit the output to only my class? Something like -Dlog.level.com.mycompany=DEBUG ? I've also attempted using log4j but it seems there's no easy way to make log4j realize where the lo4j.properties file is, when testing a custom mojo. Anyway, what is the best way to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
XML node attributes when writing a custom mojo
Hello there! Is it possible to design a custom Maven plugin in such a way that the nodes in its configuration use xml attributes? For example, instead of configure include namesomefile.txt/name /include /configure I would like to have configure include name=somefile.txt/ /configure Is there some built-in support for this in Maven 2? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Using a Veloctity template in a custom Maven report
To build a website with mvn site, you need to put your custom .vm file somewhere in your project directory, and then in your pom.xml configure the maven-site-plugin to use that .vm file. build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-site-plugin/artifactId version2.1.1/version configuration templateFile${basedir}/src/my-custom-template.vm/templateFile /configuration /plugin Try this and maybe the velocity component will just work. Cheers, Csaba On 08/25/2010 12:54 PM, jasnook wrote: Hi, I am trying to write a report plugin for Maven which will run during the 'site' stage in the lifecycle. The plugin needs to be able to use a Velocity template to create a HTML file. I have created a Mojo which extends AbstractMavenReport and within that I have /** * @component */ private VelocityComponent velocityComponent; so that I can get hold of the Plexus velocity component. I am currently passing this into a method and using this as: public void createReport(VelocityComponent velocityComponent) throws Exception { VelocityContext context = new VelocityContext(); // put stuff into the context. Template template = null; try { Properties props = new Properties(); props.setProperty(resource.loader, classpath); //makes no difference if set or not props.setProperty(classpath.resource.loader.class, org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader); // makes no difference if set or not velocityComponent.getEngine().init(props); template = velocityComponent.getEngine().getTemplate(report.vm); } catch (ResourceNotFoundException rnfe) { System.out.println(Example : error : cannot find template report.vm); } catch (ParseErrorException pee) { System.out.println(Example : Syntax error in template report.vm: + pee); } BufferedWriter writer = writer = new BufferedWriter( new OutputStreamWriter(System.out)); //testing by writing to the screen if (template != null) { template.merge(context, writer); } writer.flush(); writer.close(); } I am getting a ResourceNotFoundException when running this. Where do I need to put the vm file so that it is picked up or how should I be using the velocitycomponent? btw. I am using Maven 2.2.1. Thanks, Jacqui - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
JUnit test fails with Javamail
Hello, I wrote a simple JUnit 4 test. It just sends a plain email with JavaMail. When I run this test class from Eclipse, it passes without problems. However, when I run it with mvn test, the test will fail. Here is part of the stack trace: DEBUG SMTP: trying to connect to host mail.website.com, port 465, isSSL false java.lang.AssertionError at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1578) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412) at javax.mail.Service.connect(Service.java:248) at javax.mail.Service.connect(Service.java:105) By following the stack trace, I saw that in SMTPTransport.java:1578 there is the following line: assert Thread.holdsLock(this); This is why it fails. Any idea how to run Maven so that this doesn't fail? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: build problem
Hi, Maven should output the javac compilation error to you. If you didn't see it, it means Maven hasn't reached the point to compile it yet. Maybe you could send us the complete output you get from Maven to see why it doesn't work. It seems to me that you've installed the jar file correctly (maybe check if the file really is there, in ~/.m2/repository/com/oracle/ojdbc6/11.2.0/ ). Csaba On 03/02/2010 12:23 PM, Bámer Balázs wrote: Hi All, I have problems building the Geotools 2.5.8 source. It requires Maven 2.1.0, I have 2.2.1. It is just out of the box without Oracle jars, which I have to add to it. I installed them in the local repository with commands like mvn install:install-file -Dfile=/home/balazs/georaster/product/11.2.0/dbhome_1/jdbc/lib/ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar and put fragments like dependency groupIdcom.oracle/groupId artifactIdojdbc6/artifactId version11.2.0/version typejar/type optionalfalse/optional /dependency into the pom.xml in geotools source root. However, Maven keeps complaining about missing classes. What can be wrong? Can I have Maven output somehow the javac and similar steps of the build to be able to repeat it by hand? thank you in advance, best regards: Balázs Bámer Telefon, mobil TV, SMS, internet egy havi díjért. MédiaMánia díjcsomagok most dupla benne foglalt forgalommal. T-Mobile - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: build problem
Well it can't find oracle.spatial.georaster and some other packages. But looks like you can't build this project at all with your version of Maven: http://www.mail-archive.com/geotools-gt2-us...@lists.sourceforge.net/msg07357.html Maybe try downgrading to version 2.0.9 or try with a newer version of the Geotools source code. Csaba On 03/02/2010 01:27 PM, kolaloka wrote: Hi Csaba, This is what I find in the repository: bal...@black:~/.m2/repository/com/oracle$ find . ./sdoapi ./sdoapi/11.2.0 ./sdoapi/11.2.0/sdoapi-11.2.0.jar ./sdoapi/maven-metadata-local.xml ./xdb ./xdb/11.2.0 ./xdb/11.2.0/xdb-11.2.0.jar ./xdb/maven-metadata-local.xml ./sdotype ./sdotype/11.2.0 ./sdotype/11.2.0/sdotype-11.2.0.jar ./sdotype/maven-metadata-local.xml ./xmlparserv2 ./xmlparserv2/11.2.0 ./xmlparserv2/11.2.0/xmlparserv2-11.2.0.jar ./xmlparserv2/maven-metadata-local.xml ./sdoutl ./sdoutl/11.2.0 ./sdoutl/11.2.0/sdoutl-11.2.0.jar ./sdoutl/maven-metadata-local.xml ./sdooutl ./sdooutl/11.2.0 ./georasterapi ./georasterapi/11.2.0 ./georasterapi/11.2.0/georasterapi-11.2.0.jar ./georasterapi/maven-metadata-local.xml ./dummy_spatial ./dummy_spatial/8.1.8 ./dummy_spatial/8.1.8/dummy_spatial-8.1.8.jar.sha1 ./dummy_spatial/8.1.8/dummy_spatial-8.1.8.pom.sha1 ./dummy_spatial/8.1.8/dummy_spatial-8.1.8.pom ./dummy_spatial/8.1.8/dummy_spatial-8.1.8.jar ./ojdbc6 ./ojdbc6/11.2.0 ./ojdbc6/11.2.0/ojdbc6-11.2.0.jar ./ojdbc6/maven-metadata-local.xml and this is the output: bal...@black:/usr/local/src/geotools-2.5.8$ mvn compile [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Geotools [INFO] Build tools for Geotools 2 [INFO] Maven plugins for Geotools 2 ... [INFO] [INFO] Building Geotools [INFO]task-segment: [compile] [INFO] [INFO] No goals needed for project - skipping [INFO] [INFO] Building Build tools for Geotools 2 [INFO]task-segment: [compile] [INFO] [INFO] No goals needed for project - skipping [INFO] [INFO] Building Maven plugins for Geotools 2 [INFO]task-segment: [compile] [INFO] [INFO] No goals needed for project - skipping [INFO] [INFO] Building Geotools Archetype [INFO]task-segment: [compile] [INFO] [INFO] [plugin:descriptor {execution: default-descriptor}] [INFO] Using 2 extractors. [INFO] Applying extractor for language: java [INFO] Extractor for language: java found 0 mojo descriptors. [INFO] Applying extractor for language: bsh [INFO] Extractor for language: bsh found 0 mojo descriptors. [WARNING] [WARNING] *** [WARNING] Deprecation Alert: [WARNING] No mojo descriptors were found in this project which has a packaging type of maven-plugin. [WARNING] In future versions of the plugin tools, this will fail the build. [WARNING] If this project is an archetype, change the packaging type from maven-plugin to maven-archetype. [WARNING] many similar blocks follow [INFO] [INFO] Building imagemosaic-jdbc module [INFO]task-segment: [compile] [INFO] [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] snapshot org.h2database:h2:1.0-SNAPSHOT: checking for updates from maven2-repository.dev.java.net [INFO] snapshot org.h2database:h2:1.0-SNAPSHOT: checking for updates from osgeo [INFO] snapshot org.h2database:h2:1.0-SNAPSHOT: checking for updates from opengeo [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 31 source files to /usr/local/src/geotools-2.5.8/modules/plugin/imagemosaic-jdbc/target/classes [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] Compilation failure /usr/local/src/geotools-2.5.8/modules/plugin/imagemosaic-jdbc/src/main/java/org/geotools/gce/imagemosaic/jdbc/GeoRasterThread.java:[25,31] package oracle.spatial.georaster does not exist /usr/local/src/geotools-2.5.8/modules/plugin/imagemosaic-jdbc/src/main/java/org/geotools/gce/imagemosaic/jdbc/GeoRasterThread.java:[26,31] package oracle.spatial.georaster does not exist
Expand environment variable in parent's version
Hello, I would like to use an environment variable to define the parent project. So I wrote that it's version is parent ... version${env.VERSION_NUMBER}/version /parent The environment variable is set, when I write echo $VERSION_NUMBER in the console, I get its value. According to the POM Reference manual: Their values are accessible anywhere within a POM by using the notation ${X}, where X is the property. http://maven.apache.org/pom.html#Properties So obviously, it should work. However, when I start building the project, it tries to download com.xxx.MyProject.${env.VERSION_NUMBER}.pom from the repository. It did not expand the environment variable! Is this a Maven bug perhaps? I'm using version 2.2.1. Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Expand environment variable in parent's version
On 02/26/2010 02:09 PM, Wendy Smoak wrote: 2010/2/26 Gajo Csabacsaba.g...@cosylab.com: I would like to use an environment variable to define the parent project. So I wrote that it's version is parent ... version${env.VERSION_NUMBER}/version /parent In short, you can't do that. Take a look at http://jira.codehaus.org/browse/MNG-2569 and the linked issues, as well as previous discussions (probably on the dev list) for more info. Hmm bug reported in 2006 and last message is from 2008. Is it really such a complicated issue? Maybe I can give it a try and fix it? - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Plugin configuration element is duplicating itself
Hello, I'm using the rpm plugin for creating rpms. One project is divided into 3 rpms, so I have a configuration like plugin configuration mappings ... /mappings /configuration executions execution .../execution /executions /plugin There is 1 main configuration, and 2 separate ones in 2 executions. The main configuration contains a mapping with a softlinkSource element. This is the only time this element appears in the whole pom.xml. Now what happens next is that the soft link will appear in all 3 rpms. I've debugged the source, and all 3 executions contain the softlinkSource element! It's not in the pom.xml, but somehow the xml is parsed so that the same element is added to all 3 executions. The softlinkSource element will always get appended to the last mapping element. So if I have like: mapping ... stuff 1 /mapping mapping ... stuff 2 /mapping mapping ... stuff 3 /mapping then in the mapping containing stuff 3, there will also be a softlinkSource. How to make it run normally? Why is this happening in the first place? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Plugin configuration element is duplicating itself
I've looked a bit deeper into the source code. The mapping element is mapped by a Mapping class. This class has a setSources() method. This method is invoked by org.codehaus.plexus.component.configurator.converters.ComponentValueSetter with the method setValueUsingSetter(). Is there a bug in this component? Because in the pom.xml, the specific mapping has just one source element, while the setSources() method is forwarded a list of two source elements! I'm not sure from which package it comes from, perhaps org.codehaus.plexus:plexus-utils:1.5.7 ? Regards, Csaba Gajo Csaba wrote: Hello, I'm using the rpm plugin for creating rpms. One project is divided into 3 rpms, so I have a configuration like plugin configuration mappings ... /mappings /configuration executions execution .../execution /executions /plugin There is 1 main configuration, and 2 separate ones in 2 executions. The main configuration contains a mapping with a softlinkSource element. This is the only time this element appears in the whole pom.xml. Now what happens next is that the soft link will appear in all 3 rpms. I've debugged the source, and all 3 executions contain the softlinkSource element! It's not in the pom.xml, but somehow the xml is parsed so that the same element is added to all 3 executions. The softlinkSource element will always get appended to the last mapping element. So if I have like: mapping ... stuff 1 /mapping mapping ... stuff 2 /mapping mapping ... stuff 3 /mapping then in the mapping containing stuff 3, there will also be a softlinkSource. How to make it run normally? Why is this happening in the first place? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org -- _ _ _ _ _ |_| |_| |_| |_| |_| Csaba Gajo Cosylab Email: csaba.g...@cosylab.com http://www.cosylab.com Phone: +386 (70) 226-357 Teslova ulica 30 Skype ID: gcsaba2SI-1000 Ljubljana Yahoo! IM: gcsaba2Slovenia Web page: http://users.cosylab.com/~cgajo __ _ _ _ _ __ _ _ _ _ __ |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Filtering a file in maven mojo
Hello, One of our custom mojos is generating a file, and the template for this file is stored in the jar file of the mojo. What is done is that the resource is read with getClass().getResourceAsStream(), and then printed into a real file line by line. What I would like to do is, before writing the line, to process the line with maven's filter. I was looking at the source code of the resources plugin [1], and as far as I can see, it is using a MavenResourcesFiltering component for filtering. However, it doesn't explicitly filter line by line (which is a requirement for me, because we also do other stuff with it). How can I do this? Thanks, Csaba [1] - http://svn.apache.org/viewvc/maven/plugins/tags/maven-resources-plugin-2.4.1/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java?view=markup - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Custom plugin - resolve variables loaded from a file
Hello, We're using the rpm plugin for packaging, and we have a problem with its install script. There are two ways to include a script. One is the (deprecated) install tag. In this case, we would put the bash script into the pom.xml, which is rather ugly, but it works. The bash script itself contains Maven variables, and these are replaced by maven before the script is used by the rpm plugin. The other way is to user the installScriptlet tag. This tag required the name of an external file, which contains the contents of the bash script. This is a much cleaner approach. However, the problem is the maven variables are not replaced in the external file, so the script doesn't work. I've looked at the source code of the rpm plugin, and it seems that it simply opens the external script file, and prints it line-by-line into the generated spec file, with no modification to the line. I think it would be a good idea to modify the rpm plugin code at this point, so that the line is first processed, expanding all maven variables. How can I do this? How is maven expanding its variables? Is there a method somewhere like MavenEnv.expandVariables(str) ? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Custom plugin - resolve variables loaded from a file
Well on initial testing it doesn't seem to work. Maybe the rpm plugin is supposed to load the file through some maven resource interface? Right now, it's doing this: final Reader reader = new FileReader( scriptFile ); Where scriptFile is a java.io.File. I think this way, it's bypassing Maven's framework. This could be yet another bug... Thanks for the help, Csaba Ryan Connolly wrote: Hi. I have no experience with this plugin but it would seem that you could first filter the file as a typical maven resource and then have the plugin point to the filtered version? On 12/16/09, Gajo Csaba csaba.g...@cosylab.com wrote: Hello, We're using the rpm plugin for packaging, and we have a problem with its install script. There are two ways to include a script. One is the (deprecated) install tag. In this case, we would put the bash script into the pom.xml, which is rather ugly, but it works. The bash script itself contains Maven variables, and these are replaced by maven before the script is used by the rpm plugin. The other way is to user the installScriptlet tag. This tag required the name of an external file, which contains the contents of the bash script. This is a much cleaner approach. However, the problem is the maven variables are not replaced in the external file, so the script doesn't work. I've looked at the source code of the rpm plugin, and it seems that it simply opens the external script file, and prints it line-by-line into the generated spec file, with no modification to the line. I think it would be a good idea to modify the rpm plugin code at this point, so that the line is first processed, expanding all maven variables. How can I do this? How is maven expanding its variables? Is there a method somewhere like MavenEnv.expandVariables(str) ? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to download every dependency we need at once?
Hello, We have a problem that some computers are not connected to the internet, so Maven cannot download dependencies from there. Because of this, by default, maven is running in offline mode. Currently, Maven is set up by an installation script, which installs maven and does some changes to its settings.xml etc. During setup, an internet connection does exist. The idea is to change this script, so that once everything is set up, it would run several maven commands, like mvn clean, mvn deploy etc. to force Maven to download all necessary files into the local .m2 directory. Is there some cleaner way to do this? I know exactly which dependencies are needed (it's a large list), so is there some maven command to not build anything, just download these dependencies into the local .m2 directory? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to download every dependency we need at once?
This seems to be almost perfect except it requires a project to exist. But I'll use it if there's nothing else :) Thanks, Csaba Jesse Farinacci wrote: Hi Gajo, 2009/12/15 Gajo Csaba csaba.g...@cosylab.com: Is there some cleaner way to do this? I know exactly which dependencies are needed (it's a large list), so is there some maven command to not build anything, just download these dependencies into the local .m2 directory? Check out the maven-dependency-plugin:go-offline goal: http://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html -Jesse Farinacci - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Plugin to start a jar?
The exec plugin? Thomas Sundberg wrote: Hi! I want to start a jar during the 'pre-integration-test' pretty much as starting a Tomcat with Cargo or similar. But this is a standalone jar that contains a server that i want to have available for integrationstests that I want to run later. I want the server jar to be shut down in the 'post-integration-test' phase I could live with it beeing shut down when Maven terminates so the post-integration-test phase isn't the most important part. Any tips on plugins I could use? /Thomas - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to download m2eclipse plugin?
Hello, I would like to download the m2eclipse plugin, and I don't mean through the update site. We need to provide our Eclipse pre-packaged with m2eclipse, so we need to have the files handy. Anyone knows the url from where we can download it? All I could find is the update site... Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Create multiple JARs from different src directories
Hello, I don't know specifically for the JAR plugin, but according to its website at http://maven.apache.org/plugins/maven-jar-plugin/usage.html you can configure which files to include/exclude. So you could create separate execution elements for each jar file you want to generate, and set their configuration to include only the files you want. You create executions like this: plugin artifactId/artifactId executions execution idsome-unique-id/id phasetest/phase goalsgoaljar/goal/goals configuration do your thing here /configuration /execution ... and now create another execution... /plugin Hope this helped, Csaba florian.gru...@icw.de wrote: Hi there! I'm quite new to maven and have the following question: Maven generates test JARs from the test directories that can be specified via the build-helper-maven-plugin. Is it possible to generate seperate JARs (for integration tests in my case) from different test folders? I don't want everything that is a test in my final *-tests.jar, I want to specify what (folder) will reside in my unit test JAR and what should be in a seperate let's say *-itest.jar. Is that possible? Working with eclipse and maven2 / maven3. Cheers, Florian InterComponentWare AG: Vorstand: Dr. Lutz Kleinholz (Vors.), Dr. Georg Ralle, Jörg Stadler / Aufsichtsratsvors.: Prof. Dr. Christof Hettich Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 351761 / USt.-IdNr.: DE 198388516 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to change the plugin config from a mojo?
Hello, I have a mojo which requires a project. When it starts, it gets the project's build plugins, searches for a specific one, and then takes its configuration and changes is. The configuration is an Xpp3Dom object, which I convert to String with toString()... but how do I convert that String back to Xpp3Dom? This is what I mean: String config = plugin.getConfiguration().toString(); config = doStuff(config); plugin.setConfiguration(config); Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Global shared memory
Hello, Is there a way I can share some values between mojos, and so that they aren't Strings? I know that there is a mavenProject.getProperties() thing which can be used, but in this case I would like to share a HashMap. Regards, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Plugin to terminate another plugin
Hello, I use the exec plugin to run some external processes. It is possible for one of these processes to get into an eternal loop, so the build will hang. Is there a way to terminate this goal after, let's say, 10 seconds? If there's no thing that's already made, is there a way to write a custom plugin which would terminate the exec plugin after 10 seconds? I would not want to modify the exec plugin itself. Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Replace the deploy phase with my own plugin
Hello, I was looking at components.xml of the rpm plugin, and see that it uses Maven's standard deploy plugin for the deploy phase. Is there a way to replace that phase in the pom.xml with a plugin of my own, without modifying components.xml, or I have to change the plugin itself? Regards, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to include images into Doxia generated site?
Hello, I'm generating a PDF from DocBook XML, and I don't know how to include images, as in, where should they be located? I've tried next to the xml file, in the root directory... http://maven.apache.org/doxia/book/index.html Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
One project, two outputs, how to do it?
Hello, Usually when I build a project and install it to my local repository, I have one jar file there. In one specific case, I would like two jars to be created, and they should both be installed into the repository. Is there a way to do this? Creating two jars is not so much a problem, the problem is how to tell the project to use both during installation. Regards, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: One project, two outputs, how to do it?
No, different, one containing one part of the compiled code, the other the rest. Alexander wrote: Two identical jar? 2009/11/24 Gajo Csaba csaba.g...@cosylab.com Hello, Usually when I build a project and install it to my local repository, I have one jar file there. In one specific case, I would like two jars to be created, and they should both be installed into the repository. Is there a way to do this? Creating two jars is not so much a problem, the problem is how to tell the project to use both during installation. Regards, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Skip dependencies
Regarding this subject, I've managed to resolve dependencies by removing them from the project. So my plugin will check if an rpm is installed, and if not, it will fail. If everything is ok, then the rpm dependency will be removed from the project, so that Maven cannot do the check on its own. This way, it will skip all rpm dependencies. ListDependency deps = mavenProject.getDependencies(); IteratorDependency diter = deps.iterator(); while (diter.hasNext()) { Dependency dep = diter.next(); if (rpm.equals(dep.getType())) { diter.remove(); // make Maven forget about this dependency checkDependencyOnMyOwn(dep); } } I'm now waiting for comments why this is a horrible butchering of Maven :) Regards, Csaba Gajo Csaba wrote: Ah cool, some of my colleagues are experimenting with it, I'll ask them tomorrow! Csaba Madai wrote: Have you tried Artifactory? It's not a plugin, but I assume it will do the job for you :) Csaba 2009/11/23 Gajo Csaba csaba.g...@cosylab.com: Hello Csaba :) The problem I might potentially have is that we use two repositories, one is Maven and the other is YUM. So it is possible for an artifact (rpm) to be in YUM, but not in the Maven repository. In this case, my plugin would check if it's in YUM and download it... otherwise it would fail. But it should not fail if it's not in the Maven repository. Regards, Csaba Csaba Madai wrote: Hi, I think thats the point of the dependency, to be there, why do you use a dependency in your pom when it's not necesarry? :) Csaba 2009/11/23 Gajo Csaba csaba.g...@cosylab.com: Hello, Is there a way to write a plugin or something, which would check if a dependency exists, and if it doesn't, then just skips it? Currently if a dependency is missing and cannot be downloaded, then the build will fail. Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Skip dependencies
Because they're not optional, they just cannot be installed by Maven because they're in a YUM repository. But I guess the effect would be the same? Stephen Connolly wrote: why don't you just set optionaltrue/optional on your dependencies? 2009/11/24 Gajo Csaba csaba.g...@cosylab.com: Regarding this subject, I've managed to resolve dependencies by removing them from the project. So my plugin will check if an rpm is installed, and if not, it will fail. If everything is ok, then the rpm dependency will be removed from the project, so that Maven cannot do the check on its own. This way, it will skip all rpm dependencies. ListDependency deps = mavenProject.getDependencies(); IteratorDependency diter = deps.iterator(); while (diter.hasNext()) { Dependency dep = diter.next(); if (rpm.equals(dep.getType())) { diter.remove(); // make Maven forget about this dependency checkDependencyOnMyOwn(dep); } } I'm now waiting for comments why this is a horrible butchering of Maven :) Regards, Csaba Gajo Csaba wrote: Ah cool, some of my colleagues are experimenting with it, I'll ask them tomorrow! Csaba Madai wrote: Have you tried Artifactory? It's not a plugin, but I assume it will do the job for you :) Csaba 2009/11/23 Gajo Csaba csaba.g...@cosylab.com: Hello Csaba :) The problem I might potentially have is that we use two repositories, one is Maven and the other is YUM. So it is possible for an artifact (rpm) to be in YUM, but not in the Maven repository. In this case, my plugin would check if it's in YUM and download it... otherwise it would fail. But it should not fail if it's not in the Maven repository. Regards, Csaba Csaba Madai wrote: Hi, I think thats the point of the dependency, to be there, why do you use a dependency in your pom when it's not necesarry? :) Csaba 2009/11/23 Gajo Csaba csaba.g...@cosylab.com: Hello, Is there a way to write a plugin or something, which would check if a dependency exists, and if it doesn't, then just skips it? Currently if a dependency is missing and cannot be downloaded, then the build will fail. Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
post-integration-test must be executed
Hello, We're doing some integration tests with bash scripts, and these are executed with Maven's exec plugin. When the test works, it returns 0, when it fails, it returns 1. When it returns 1, the exec plugin will fail and the post-integration-test goal will not be executed. It is crucial for it to be executed to clean up the environment. I saw this issue came up 3 years ago at http://jira.codehaus.org/browse/MNG-2142 but the fix is available only for Maven version 3? Is there a way to force the execution of post-integration-test even if the integration-test fails? Or I have to write my own plugin? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: post-integration-test must be executed
The problem is Surefire and, as far as I can see, this failsafe plugin, are made for Java unit tests, while in our case we test C++ applications. As far as Maven is concerned, we just execute a script with exec plugin, which returns 0 or 1, and if it returns 1, then the deploy should fail, BUT NOT the post-integration-test. So the solution would probably be to write our own plugin which does the hack you mentioned? Stephen Connolly wrote: wrap your bash scripts in a bash script that checks the exit code and creates a file based on the exit code. then attach an execution to the verify phase that checks your file. Essentially, the rule for integration-test is to _never_ fail the build... hence: failsafe-maven-plugin as an alternative to surefire... it splits the test execution from the test result checking to ensure that the post-integration-test phase always runs -Stephen 2009/11/23 Gajo Csaba csaba.g...@cosylab.com: Hello, We're doing some integration tests with bash scripts, and these are executed with Maven's exec plugin. When the test works, it returns 0, when it fails, it returns 1. When it returns 1, the exec plugin will fail and the post-integration-test goal will not be executed. It is crucial for it to be executed to clean up the environment. I saw this issue came up 3 years ago at http://jira.codehaus.org/browse/MNG-2142 but the fix is available only for Maven version 3? Is there a way to force the execution of post-integration-test even if the integration-test fails? Or I have to write my own plugin? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RPM dependencies
Hello, We would like to use RPMs similarly to JARs. This means that, when we install a project, its rpm would go into the repository. When another project is using this project, then the rpm should be fetched from the repository and installed. Is there a good way to do this? The problem might also be that we need to install the rpms in su mode, though this can be solved for now by running sudo mvn All ideas are welcome! Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: RPM dependencies
I have been actually using the rpm plugin, found a few bugs in it etc... The problem is, when you install C++ projects, you want some .h files to be copied to /usr/include, some .so files to /usr/lib etc. so it cannot work as easily as for Java projects. I'm guessing it's easy for Perl as well, since you've got packages... eyal edri wrote: you can try playing with the rpm plugin from mojo: http://mojo.codehaus.org/rpm-maven-plugin/ i'm actually in the same boat as you are. we've been programming in perl till now, using rpm yum for deployment. but from what i learned so far about Maven, you might find that it can replace any functionality you got from rpm/yum, thus rendering the use of rpm packaging redundant. Eyal. 2009/11/23 Gajo Csaba csaba.g...@cosylab.com Hello, We would like to use RPMs similarly to JARs. This means that, when we install a project, its rpm would go into the repository. When another project is using this project, then the rpm should be fetched from the repository and installed. Is there a good way to do this? The problem might also be that we need to install the rpms in su mode, though this can be solved for now by running sudo mvn All ideas are welcome! Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: RPM dependencies
I see, you're copying all resources to the include etc. dirs when you write mvn install. I guess I would need something similar (I'll have to confirm). I was actually thinking of fetching rpms in the first phase (copy-resources?), before compiling. Then I'd try to install the rpm, if it's already installed then just skip it, and then do the compile (by calling make). Thanks for the idea! eyal edri wrote: i found that the rpm plugin only worked with maven 2.0.6 - 2.0.10. i found a solution for coping file using the resouces:copy-resoucres plugin or use the assembly pluging to create a dist pkg of .tar.gz. here's a 'build' for pom.xml i've created: build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-dependency-plugin/artifactId executions execution idcopy-dependencies/id phasepackage/phase goals goalcopy-dependencies/goal /goals configuration outputDirectory/usr/lib/ctch/java/outputDirectory overWriteReleasesfalse/overWriteReleases overWriteSnapshotsfalse/overWriteSnapshots overWriteIfNewertrue/overWriteIfNewer /configuration /execution /executions /plugin plugin artifactIdmaven-resources-plugin/artifactId version2.4.1/version executions execution idcopy-conf/id phaseinstall/phase goals goalcopy-resources/goal /goals configuration outputDirectory/etc/ct-urlf-increase-priority//outputDirectory resources resource directorysrc/main/resources/directory filteringtrue/filtering includes include**/*.properties/include /includes /resource /resources /configuration /execution execution idcopy-cron/id phaseinstall/phase goals goalcopy-resources/goal /goals configuration outputDirectory/etc/cron.d//outputDirectory resources resource directorysrc/main/resources/directory filteringtrue/filtering includes include**/*.cron/include /includes /resource /resources /configuration /execution /executions /plugin plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-jar-plugin/artifactId configuration outputDirectory/usr/local/ct-urlf-increase-priority/outputDirectory archive manifest mainClasscom.commtouch.url.unknowns.IncreasePriority/mainClass addClasspathtrue/addClasspath classpathPrefix/usr/lib/ctch/java/classpathPrefix /manifest /archive /configuration /plugin /plugins /build On Mon, Nov 23, 2009 at 3:47 PM, Gajo Csaba csaba.g...@cosylab.com wrote: I have been actually using the rpm plugin, found a few bugs in it etc... The problem is, when you install C++ projects, you want some .h files to be copied to /usr/include, some .so files to /usr/lib etc. so it cannot work as easily as for Java projects. I'm guessing it's easy for Perl as well, since you've got packages... eyal edri wrote: you can try playing with the rpm plugin from mojo: http://mojo.codehaus.org/rpm-maven-plugin/ i'm actually in the same boat as you are. we've been programming in perl till now, using rpm yum for deployment. but from what i learned so far about Maven, you might find that it can replace any functionality you got from rpm/yum, thus rendering the use of rpm packaging redundant. Eyal. 2009/11/23 Gajo Csaba csaba.g...@cosylab.com Hello, We would like to use RPMs similarly to JARs. This means that, when we install a project, its rpm would go into the repository. When another project is using this project, then the rpm should be fetched from the repository and installed. Is there a good way to do this? The problem might also be that we need to install the rpms in su mode, though this can be solved for now by running sudo mvn All ideas are welcome! Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Skip dependencies
Hello, Is there a way to write a plugin or something, which would check if a dependency exists, and if it doesn't, then just skips it? Currently if a dependency is missing and cannot be downloaded, then the build will fail. Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Skip dependencies
Hello Csaba :) The problem I might potentially have is that we use two repositories, one is Maven and the other is YUM. So it is possible for an artifact (rpm) to be in YUM, but not in the Maven repository. In this case, my plugin would check if it's in YUM and download it... otherwise it would fail. But it should not fail if it's not in the Maven repository. Regards, Csaba Csaba Madai wrote: Hi, I think thats the point of the dependency, to be there, why do you use a dependency in your pom when it's not necesarry? :) Csaba 2009/11/23 Gajo Csaba csaba.g...@cosylab.com: Hello, Is there a way to write a plugin or something, which would check if a dependency exists, and if it doesn't, then just skips it? Currently if a dependency is missing and cannot be downloaded, then the build will fail. Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Skip dependencies
Ah cool, some of my colleagues are experimenting with it, I'll ask them tomorrow! Csaba Madai wrote: Have you tried Artifactory? It's not a plugin, but I assume it will do the job for you :) Csaba 2009/11/23 Gajo Csaba csaba.g...@cosylab.com: Hello Csaba :) The problem I might potentially have is that we use two repositories, one is Maven and the other is YUM. So it is possible for an artifact (rpm) to be in YUM, but not in the Maven repository. In this case, my plugin would check if it's in YUM and download it... otherwise it would fail. But it should not fail if it's not in the Maven repository. Regards, Csaba Csaba Madai wrote: Hi, I think thats the point of the dependency, to be there, why do you use a dependency in your pom when it's not necesarry? :) Csaba 2009/11/23 Gajo Csaba csaba.g...@cosylab.com: Hello, Is there a way to write a plugin or something, which would check if a dependency exists, and if it doesn't, then just skips it? Currently if a dependency is missing and cannot be downloaded, then the build will fail. Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Excluding repositories
Hello, One of the dependencies is trying to access a repository at download.java.net, and this site is blocked by our firewall. Is there a way to tell Maven to skip this repository? Either in settings.xml or pom.xml Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Alternative output directory for javadocs
The example from the website worked fine for me, it placed the javadocs into an alternative directory, though maybe I didn't understand what exactly you're trying to archive. Regards, Csaba Sebastian Hoß wrote: On Fri, 20 Nov 2009 11:48:09 +0100 Sebastian Hoß m...@shoss.de wrote: Hey list! .. So how do you specify alternative output directories for javadocs? Any help on that is appreciated :-) Ah well, I've done it: Using reportSets you can specify the destDir for the javadoc:javadoc goal and the javadoc:test-javadoc goal independently [1]. So I ended up with something like this: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-javadoc-plugin/artifactId version2.6.1/version reportSets reportSet idmain-html/id configuration destDirapi/destDir /configuration reports reportjavadoc/report /reports /reportSet reportSet idtest-html/id configuration destDirtestapi/destDir /configuration reports reporttest-javadoc/report /reports /reportSet /reportSets /plugin That gives me the desired result but I still think that the plugin documentation mentioned in my last mail is wrong.. [1]: http://maven.apache.org/plugins/maven-javadoc-plugin/examples/test-javadocs.html - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Maven plugin version number
Hello, I'm writing a plugin which is generating certain files, and I would like to add something like a Generated by xxx version 1.2.3 string to each file it generates. The problem is, how can the plugin know its own version (without hardcoding it)? Regards, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven plugin version number
Good idea, I did that approach and it works great! Anders Hammar wrote: I would go the normal Java way. Store the version in the manifest and then use the java.lang.Package object, like this: clazz.getPackage().getImplementationVersion() There are loads of discussion about this on the net. Here's one: http://forums.sun.com/thread.jspa?threadID=642761 /Anders 2009/11/18 Gajo Csaba csaba.g...@cosylab.com Hello, I'm writing a plugin which is generating certain files, and I would like to add something like a Generated by xxx version 1.2.3 string to each file it generates. The problem is, how can the plugin know its own version (without hardcoding it)? Regards, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Maven RPM plugin changes all file permissions to 644
Hello, I'm using the Maven RPM plugin for creating rpms. It's working fine, but it overwrites the permissions of all files to 664. So for example, an executable file becomes non-executable. I've added these tags to the configuration: defaultFilemode-/defaultFilemode defaultDirmode-/defaultDirmode defaultUsernameroot/defaultUsername defaultGroupnameroot/defaultGroupname And the generates spec file is ok, it indeed adds %defattrs(-,root,root,-) However, the problem is that the files it uses, which are based in target/rpm/buildroot are all 664. I'm guessing the plugin copies the required files into this directory, and during it the permissions are lost. I'll look at the source code to be sure. Is there any way to fix this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven RPM plugin changes all file permissions to 644
OK as far as I can see, the problem is that the RPM Plugin uses Plexus Archiver version 1.0-alpha-5, which copes files by opening and output stream and writing to it, and no chmod is done. This is fixed in version 1.0-alpha-12, where the Plexus Archiver explicitly executes the chmod command from the console. But changing the RPM Plugin's pom.xml to the newer version makes the JUnit tests fail. I'll try and see if it creates the rpm correctly though... - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven RPM plugin changes all file permissions to 644
I ran the RPM Plugin with the patched version of the archiver, and it works. However, the tests fail, so I had to run it with the -Dmaven.test.skip=true parameter. Gajo Csaba wrote: OK as far as I can see, the problem is that the RPM Plugin uses Plexus Archiver version 1.0-alpha-5, which copes files by opening and output stream and writing to it, and no chmod is done. This is fixed in version 1.0-alpha-12, where the Plexus Archiver explicitly executes the chmod command from the console. But changing the RPM Plugin's pom.xml to the newer version makes the JUnit tests fail. I'll try and see if it creates the rpm correctly though... - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to delegate the execution to other Mojos?
Hello, I would like to create a maven plugin, which would delegate to other plugins based on parameters. Something like mvn mymojo:dotask -Dtask=xxx and then in the dotask mojo I would see what the value of task is, and if it's xxx then execute Mojo1, if it's yyy then Mojo2 etc... How can I do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to delegate the execution to other Mojos?
OK so my use case would be mvn do-task -Dtask=xxx Do you suggest I change that into mvn do-task-xxx? Regards, Csaba Stephen Connolly wrote: Short answer: Don't Long answer: for a mojo to extend another maven plugin, it will need to depend on that maven plugin. The maven plugin classloader only loads a plugin once, and the first version loaded is the version used forever more (until maven exits). When a newer version of the plugin you depend on is released, you will either force the older version on anyone using your plugin, or the newer version will be forced on you. In either case, the build will probably be broken in a hard to figure out way -Stephen 2009/11/11 Gajo Csaba csaba.g...@cosylab.com: Hello, I would like to create a maven plugin, which would delegate to other plugins based on parameters. Something like mvn mymojo:dotask -Dtask=xxx and then in the dotask mojo I would see what the value of task is, and if it's xxx then execute Mojo1, if it's yyy then Mojo2 etc... How can I do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Plugin to detect if called from the shell
Hello, Is there a way for a Maven plugin (Mojo) to detect if it has been called from the console, and not from pom.xml as part of the lifecycle? I have a Mojo which has @requiresProject false, and I execute it like mvn pluginname:dostuff But it also can be called from pom.xml, as part of a lifecycle. If it's called from the shell, I would like the user to input some parameters from the console. Is there a way to detect how the plugin was called? It would obviously not make sense to ask the user anything during the build lifecycle, especially if it's being done by Continuum etc... Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Maven Archetype: run script after creation
Hello, I would like to create an archetype with a default directory structure. After the directories are created, I'd like the archetype to execute a Perl script. How can I do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Maven archetypes and Velocity
Hello, I have a very simple question regarding archetypes. I've created my own basic archetype, and in archetype-resources/src/main/java/App.java I wrote the following: package $xxx Installed the archetype, created a new project with it and also added the -Dxxx=abc parameter... and it remained $xxx. I was expecting $xxx to be replaced with abc. Is this not how it's supposed to work? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven archetypes and Velocity
Looks like I'm doing something very wrong, cause I followed that tutorial and it still won't work. In class com.cosylab.App.java I defined this: String name = ${xxx}; note that I've also tried doing it like this: String name = $xxx; So it's just a simple project. I've created an archetype.properties file, which defines xxx=my specific value and after that ran mvn archetype-create-from-project, went to target/generated-sources/archetype, installed the generated archetype, created a new project with it, and still, it remains String name = ${xxx}; The xxx was not replaced by my specific value So what am I doing wrong? This is the source code if you're interested, but basically it's just an application generated from the quickstart archetype: http://users.cosylab.com/~cgajo/archt.zip Thanks, Csaba Adam Leggett (UPCO) wrote: I think to define custom filtered properties you need to create an archetype.properties file: http://maven.apache.org/plugins/maven-archetype-plugin/examples/create-with-property-file.html Thanks, Adam On Mon, 2009-11-09 at 14:21 +0100, Gajo Csaba wrote: Hello, I have a very simple question regarding archetypes. I've created my own basic archetype, and in archetype-resources/src/main/java/App.java I wrote the following: package $xxx Installed the archetype, created a new project with it and also added the -Dxxx=abc parameter... and it remained $xxx. I was expecting $xxx to be replaced with abc. Is this not how it's supposed to work? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Archetype: run script after creation
I'm familiar with that plugin, but what I'm asking is completely different. I want to create an archetype, and when I create a new project based on that archetype, the archetype should invoke an external script. So the archetype would create the basic directory structure and files, and when it's all done, a Perl script is executed to do some more work... Jamie Whitehouse wrote: You may want to look at the exec-maven-plugin which can execute programs outside of Maven: http://mojo.codehaus.org/exec-maven-plugin/ -Original Message- From: Gajo Csaba [mailto:csaba.g...@cosylab.com] Sent: Monday, November 09, 2009 5:13 AM To: Maven Users List Subject: Maven Archetype: run script after creation Hello, I would like to create an archetype with a default directory structure. After the directories are created, I'd like the archetype to execute a Perl script. How can I do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org --- CONFIDENTIALITY NOTICE: This e-mail and any files attached may contain confidential and proprietary information of Alcatel-Lucent and/or its affiliated entities. Access by the intended recipient only is authorized. Any liability arising from any party acting, or refraining from acting, on any information contained in this e-mail is hereby excluded. If you are not the intended recipient, please notify the sender immediately, destroy the original transmission and its attachments and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Copyright in this e-mail and any attachments belongs to Alcatel-Lucent and/or its affiliated entities. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Same plugin, different phases
Hello, I use the exec plugin, and I need to pass it different parameters based on the target I define. So for example, if I write mvn test, then exec should forward one set of arguements to the command it executes, and if I write mvn compile, then it sends another arguement. How to do this? I though about writing the plugin definition twice, one with phase test, and another with compile, and writing two different configuraitons, but this didn't work, only the first config is executed in both cases. Is there a way to do this or I need to write my own plugin? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Same plugin, different phases
If I put the configuration element inside the execution element, I get an error saying that it needs to be inside the plugin element. This is what I've tried: build plugins plugin groupIdorg.codehaus.mojo/groupId artifactIdexec-maven-plugin/artifactId version1.1/version executions execution phasetest/phase goals goalexec/goal /goals configuration executableecho/executable workingDirectory/home/cgajo/tmp/protest/workingDirectory arguments argumentaaa/argument argumentgt;/argument argumentout.txt/argument /arguments /configuration /execution /executions /plugin /plugins /build Anders Hammar wrote: Most likely you've put the configuration element wrong. It should be inside the execution section. /Anders 2009/11/4 Gajo Csaba csaba.g...@cosylab.com Hello, I use the exec plugin, and I need to pass it different parameters based on the target I define. So for example, if I write mvn test, then exec should forward one set of arguements to the command it executes, and if I write mvn compile, then it sends another arguement. How to do this? I though about writing the plugin definition twice, one with phase test, and another with compile, and writing two different configuraitons, but this didn't work, only the first config is executed in both cases. Is there a way to do this or I need to write my own plugin? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Same plugin, different phases
Ah ok, got it to work. Looks like I needed to define a global execution as well - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: [Fwd: Threads in a plug-in]
Which is the main class of maven? I found in org.apache.maven.cli.MavenCli this as the last line of the public static void main method, so maybe this is it: System.exit( result ); Regards, Csaba Nick Stolwijk wrote: I think Maven executes a System.exit at the end, which will terminate all threads, regardless of daemon state. With regards, Nick Stolwijk ~Java Developer~ IPROFS BV. Claus Sluterweg 125 2012 WS Haarlem http://www.iprofs.nl On Thu, Oct 29, 2009 at 1:09 PM, James Russo j...@halo3.net wrote: Hello, Actually it is the other way around. Daemon threads will not hold up JVM from exiting, but non-deamon threads will. Marks this thread as either a daemon thread or a user thread. The Java Virtual Machine exits when the only threads running are all daemon threads. The daemon flag will be set if the creating thread is a daemon thread. Maybe force the setDaemon to false on the newly created thread and that may give you desired effect. -jr Brian Fox wrote: Maven just exits when it's done and then the jdk pulls everything down. Isn't there a flag you can set on a thread to mark it as a daemon thread, and then the system waits before killing it? On Wed, Oct 28, 2009 at 9:20 AM, Gajo Csaba csaba.g...@cosylab.com wrote: Good idea! I was actually hoping there was some switch I can set in Maven to tell it not to terminate my thread, but I guess your idea would work fine as well. Thanks! Csaba Stephen Connolly wrote: add a second goal the first goal will store some thread completion object in MavenSession or in a Class level static field When all threads are finished the completion object will be updated by the last thread The second goal blocks until the completion object is completed. Then add the second goal execution to your project at the appropriate phase where you need the execution to have completed... for example if you start the threads in the process-sources phase, you might be happy to let them run in the background until the test phase has completed, but they must be finished by the time the package phase runs, so I would bind your execution of the second goal to the test phase -Stephen 2009/10/28 Gajo Csaba csaba.g...@cosylab.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
[Fwd: Threads in a plug-in]
Hello all, Could someone please answer my question? I don't believe it's that complicated... Thanks, Csaba ---BeginMessage--- Hello, I've developed a plug-in which executes some shell commands. I would like to run these commands in parallel with the rest of the build process, because they don't affect the other files. So I was thinking of creating a thread in the execute() method, starting it, and let it do its job. The problem is this works for some time, and Maven keeps on doing its job, but if Maven's lifecycle ends before the thread has finished its job, then the thread will be terminated as well. Is there a way to instruct Maven to not terminate until the thread has finished, or at least to not terminate the thread itself? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org ---End Message--- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: [Fwd: Threads in a plug-in]
Good idea! I was actually hoping there was some switch I can set in Maven to tell it not to terminate my thread, but I guess your idea would work fine as well. Thanks! Csaba Stephen Connolly wrote: add a second goal the first goal will store some thread completion object in MavenSession or in a Class level static field When all threads are finished the completion object will be updated by the last thread The second goal blocks until the completion object is completed. Then add the second goal execution to your project at the appropriate phase where you need the execution to have completed... for example if you start the threads in the process-sources phase, you might be happy to let them run in the background until the test phase has completed, but they must be finished by the time the package phase runs, so I would bind your execution of the second goal to the test phase -Stephen 2009/10/28 Gajo Csaba csaba.g...@cosylab.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Threads in a plug-in
Hello, I've developed a plug-in which executes some shell commands. I would like to run these commands in parallel with the rest of the build process, because they don't affect the other files. So I was thinking of creating a thread in the execute() method, starting it, and let it do its job. The problem is this works for some time, and Maven keeps on doing its job, but if Maven's lifecycle ends before the thread has finished its job, then the thread will be terminated as well. Is there a way to instruct Maven to not terminate until the thread has finished, or at least to not terminate the thread itself? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org