<project ...>...<version>v1.1</version>...<dependencies><dependency><groupId>org.vert-x</groupId><artifactId>vertx-core</artifactId><version>1.3.1.final</version></dependency><dependency><groupId>org.vert-x</groupId><artifactId>vertx-lang-java</artifactId><version>1.3.1.final</version></dependency><dependency><groupId>org.vert-x</groupId><artifactId>vertx-lang-groovy</artifactId><version>1.3.1.final</version></dependency>...</dependencies><build><resources><resource><directory>src/main/resources</directory><excludes><exclude>mod.json</exclude></excludes><filtering>false</filtering></resource></resources><plugins>...<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-assembly-plugin</artifactId><version>2.4</version><configuration><appendAssemblyId>false</appendAssemblyId><finalName>mod</finalName><descriptors><descriptor>src/main/assembly/assembly.xml</descriptor></descriptors><attach>true</attach></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin></plugins></build></project>
<assembly><id>mod</id><formats><format>zip</format></formats><baseDirectory>target</baseDirectory><includeBaseDirectory>false</includeBaseDirectory><fileSets><fileSet><directory>${project.build.directory}</directory><outputDirectory>${project.artifactId}-${project.version}/lib</outputDirectory><includes><include>*.jar</include></includes></fileSet><fileSet><directory>${project.basedir}/src/main/resources</directory><outputDirectory>${project.artifactId}-${project.version}</outputDirectory><includes><include>mod.json</include></includes></fileSet><fileSet><directory>${project.basedir}</directory><outputDirectory>${project.artifactId}-${project.version}</outputDirectory><includes><include>README.md</include></includes></fileSet></fileSets></assembly>
Hi,
I'm starting work on the long promised Maven plugins for vert.x and I'd
like to get some feedback and ideally some contributions from the folks
who've already done some work in this area.
As as aside: we have an increasing number of build related components,
so I'm strongly considering a new coordinate group for the build tools.
From reviewing the various discussions about Maven I think we need the
following maven modules:
- org.vert-x.build:maven-safetest-plugin:$version
Integration testing support, to ensure the classpath is applied in such
a way as to prevent vert.x from throwing the
"java.lang.IllegalStateException".
Adding provided+test scopes together, with all vert.x deps in provided
should do this (and is what the Gradle plugin does).
- org.vert-x.build:maven-runtime-plugin:$version
Again composes a classpath from the provided scope, but this time has
configuration for starting a verticle or a module.
- org.vert-x.build:maven-assembly-plugin:$version
Packaging a busmod.
I've also improved the way tests are run. You can now create them as standard JUnit tests and Vert.x will make sure they are automagically run in the container.
On Feb 16, 2013, at 2:50 AM, Tim Fox <timv...@gmail.com> wrote:
�I've also improved the way tests are run. You can now create them as standard JUnit tests and Vert.x will make sure they are automagically run in the container.
This actually doesn't sound like a win. �There should be a distinction made between unit tests and integration tests. �Unit tests should be run outside of the container and should be focused on testing a single "unit" be it a verticle or a piece of supporting code. �Integration tests should be run in the container and can be used to test a configured system as a whole.�
Well-written unit tests can be run very VERY quickly, but there's a lot of overhead in running integration tests. �If you go this route, please move the container integration to a phase that gets run after�the unit tests have been run. �The Maven lifecycle goes like this:
� compile� compile tests� run tests� package everything up� run integration tests� make sure the integration tests passed� deploy the artifacts--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
�
�
I have put together a Gradle template project (see https://groups.google.com/forum/?fromgroups=#!topic/vertx/J6OZ8jYxDrc), the next thing on my list was to do the same for Maven.
I don't know much about Maven, so if you would like to take that task on, please go for it.
Once thing I don't quite understand yet, but I also know little about IDE plugins, is... if we create a standard Maven and Gradle build that shouldn't the Maven/Gradle plugin for Eclipse/IDEA just be able to read that and convert the targets into a form that can be run from the IDE? If so, I'm not sure why we need a specific IDE plugin for Vert.x....
- Based on the spec (https://github.com/vert-x/maven-plugins/wiki/Feature-Spec) & the discussions, are these deliverables final?
- Vertx Maven Archetype -- for creating vertx projects with appropriate structure.
- Vertx Maven Plugin -- for building, testing, doc generation, running, packaging, installing, deploying & registering the modules.
If so, I can take a stab at it starting with the archetype if nobody is working on it.
- Is there a home in GH for this work already?
--
- Based on the spec (https://github.com/vert-x/maven-plugins/wiki/Feature-Spec) & the discussions, are these deliverables final?
- Vertx Maven Archetype -- for creating vertx projects with appropriate structure.
- Vertx Maven Plugin -- for building, testing, doc generation, running, packaging, installing, deploying & registering the modules.
- Is there a home in GH for this work already?
Please send PRs to the repo you refer to above.
Very nice. Just one litle thing, could you rename it to vertx-maven-archtype instead? I nowadays names of plugins and archtypes always start with the intended execution context, in this case vertx. For example, JBoss archtype are: jboss-jaaee-webap-archtype or jboss-html5-mobile-archetype
Ramki,Very nice. Just one litle thing, could you rename it to vertx-maven-archtype instead?
Great work. I'm working on a prototype for the vertx-maven-plugin (based on some work previously done) and soon I'll marry your work with it.
-ramki
- Based on the spec (https://github.com/vert-x/maven-plugins/wiki/Feature-Spec) & the discussions, are these deliverables final?
- Vertx Maven Archetype -- for creating vertx projects with appropriate structure.
The tests throw an exception saying deploymentId cannot be null. What should I do for this?
On Thursday, 21 February 2013 22:49:21 UTC+5:30, ramki wrote:The tests throw an exception saying deploymentId cannot be null. What should I do for this?
Any pointers on the "deploymentId cannot be null" exception? Thats the only thing I'm stuck with currently.
Would it because the module was not packaged as a zip or is not deployed yet?
What does this line mean: container.deployModule("maven:${groupId}:${artifactId}:${version}-SNAPSHOT"?
The tests throw an exception saying deploymentId cannot be null. What should I do for this?
Any pointers on the "deploymentId cannot be null" exception? Thats the only thing I'm stuck with currently.What are you doing when you get that?
Would it because the module was not packaged as a zip or is not deployed yet?
What does this line mean: container.deployModule("maven:${groupId}:${artifactId}:${version}-SNAPSHOT"?Looks old to me. Can you pull from vertx-gradletemplate again?
-ramki
On Friday, 22 February 2013 15:01:44 UTC+5:30, Tim Fox wrote:
The tests throw an exception saying deploymentId cannot be null. What should I do for this?
Any pointers on the "deploymentId cannot be null" exception? Thats the only thing I'm stuck with currently.
What are you doing when you get that?
I'm just doing a `mvn test`.
Would it because the module was not packaged as a zip or is not deployed yet?
What does this line mean: container.deployModule("maven:${groupId}:${artifactId}:${version}-SNAPSHOT"?
Looks old to me. Can you pull from vertx-gradletemplate again?
I will do that and let you know.
-ramki
-ramki
--
On 22/02/13 09:48, ramki wrote:
On Friday, 22 February 2013 15:01:44 UTC+5:30, Tim Fox wrote:
The tests throw an exception saying deploymentId cannot be null. What should I do for this?
Any pointers on the "deploymentId cannot be null" exception? Thats the only thing I'm stuck with currently.
What are you doing when you get that?
I'm just doing a `mvn test`.
A bit more info. stacktrace etc would be helpful.
On 22/02/13 10:37, ramki wrote:This is just a test assertion failing. You've written a test and it includes an assert that the deployment id is not null. In this case the deployment id is null so it fails.
Deployment id would be null if the deployment failed.
On Friday, 22 February 2013 16:22:52 UTC+5:30, Tim Fox wrote:On 22/02/13 10:37, ramki wrote:This is just a test assertion failing. You've written a test and it includes an assert that the deployment id is not null. In this case the deployment id is null so it fails.
Deployment id would be null if the deployment failed.
And thats why I was trying to figure out whats happening when you do container.deployModule("maven:..."). Does it look for module in maven repository or zip file in the build directory or just loading the compiled classes...
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
I am taking a look at your archetype - could you provide some more information on how to actually use it?
$ mvn archetype:generate -DarchetypeRepository=file:///tmp/mvn-repo/ -DarchetypeGroupId=org.vertx.build
-DarchetypeArtifactId=vertx-maven-archetype -DarchetypeVersion=2.0 -DgroupId=com.foo.bar -DartifactId=baz -Dversion=1.0
This is just a test assertion failing. You've written a test and it includes an assert that the deployment id is not null. In this case the deployment id is null so it fails.
Deployment id would be null if the deployment failed.
And thats why I was trying to figure out whats happening when you do container.deployModule("maven:..."). Does it look for module in maven repository or zip file in the build directory or just loading the compiled classes...
The test target should depend on the copyMod target (see Gradle build), so by the time the test target is run the module should already be in the local mods directory.
Btw, why don't you come onto IRC? Would be much easier than using the group :)
On Friday, 22 February 2013 17:16:01 UTC+5:30, Tim Fox wrote:This is just a test assertion failing. You've written a test and it includes an assert that the deployment id is not null. In this case the deployment id is null so it fails.
Deployment id would be null if the deployment failed.
And thats why I was trying to figure out whats happening when you do container.deployModule("maven:..."). Does it look for module in maven repository or zip file in the build directory or just loading the compiled classes...
The test target should depend on the copyMod target (see Gradle build), so by the time the test target is run the module should already be in the local mods directory.
Oh ok. Thats going to be the responsibility of our yet to be done vertx-maven-plugin. The plugin will manage the phases and the deps between them.
So, now I will update the archetype with the latest changes that you have done in vertx-gradle-template and submit a pull request to maven-plugins repo.
On Friday, February 22, 2013 10:16:17 AM UTC-5, ramki wrote:On Friday, 22 February 2013 17:16:01 UTC+5:30, Tim Fox wrote:
This is just a test assertion failing. You've written a test and it includes an assert that the deployment id is not null. In this case the deployment id is null so it fails.
Deployment id would be null if the deployment failed.
And thats why I was trying to figure out whats happening when you do container.deployModule("maven:..."). Does it look for module in maven repository or zip file in the build directory or just loading the compiled classes...
The test target should depend on the copyMod target (see Gradle build), so by the time the test target is run the module should already be in the local mods directory.
Oh ok. Thats going to be the responsibility of our yet to be done vertx-maven-plugin. The plugin will manage the phases and the deps between them.
So, now I will update the archetype with the latest changes that you have done in vertx-gradle-template and submit a pull request to maven-plugins repo.
Tim, help me here.
I was just trying to deploy using the deployModule and in fact, it will look for modules in maven as requested.
But the vertx2-mods is only available in on github, correct? Is that a maven repo as well?
Or, how can I access those modules? is there something like github:group_id:artifact_id:version?
In addition, the focus of a vertx maven plugin is to deploy the verticle or the module being developed, not the ones that are available through repos. So, shouldn't I be using the deployModuleFromZip?
Ramki, I had a quick look into the archtype and it does not seem to include the necessary directory structure for a module. If not, could you use the maven-assembly-plugin for it? I think blalor had a gist somewhere... yeap... here: https://gist.github.com/blalor/4642746
Notice that a lib directory as well as other directories might be required in order to build the module.
Tim, did the module directory structure changed for Vertx 2?
Ramki, I had a quick look into the archtype and it does not seem to include the necessary directory structure for a module. If not, could you use the maven-assembly-plugin for it? I think blalor had a gist somewhere... yeap... here: https://gist.github.com/blalor/4642746
Notice that a lib directory as well as other directories might be required in order to build the module.
This is done now. But few catches with it. In Maven, as you would know, packaging happens after tests but in our project tests depend on packaging first. Packaging (using assembly.xml) is the one which creates the zip file. So we either have to skip the tests (-DMaven.test.skip=true) or vertx-maven-plugin should create the classes, zip them and then run the tests and then package...
<moduleName>${project.artifactId}-${project.version}-mod.zip</moduleName>
--
Template:
1. I'm not sure I understand the different between start and run. Can you clarify?
2. stop - is this necessary? Won't CTRL-C do?
3. Verticles - I am _really_ trying to get away from the idea of users deploying apps as straight verticles. This is almost always a bad idea. We should be pushing a standard application setup and that should be a module. I.e. users should always create their apps as modules. Consequently I think all the stuff about packaging/running verticles should be removed from the plugin. (This will also make things a lot simpler!). This is the way the vertx-gradle-template has been designed (it's all about modules), and I think we should be consistent with the Maven plugin too.
4. <configuration/> I think all (?) of these options can go since they're all related to deploying verticles not modules. (With the possible exception of config). Again, I recommend taking a look at the run target in the standard gradle template for how to model this.
Test project:
1. Related to above... The test project creates a verticle. We should be pushing modules not verticles.
2. No tests. One of the big things about the standard templates is they make in-container testing very easy via the new testtools project. We should have examples of in container tests here (integration tests) in the same way as the Gradle template has them.
3. Not polyglot. The test project should have examples of tests/code written in different languages.
Template:
1. I'm not sure I understand the different between start and run. Can you clarify?
In maven, in order to build your app you do:
mvn clean install
This will go through all the maven phases ( see here for more info http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)The start goal starts in daemon mode and ensures that vert.x will not block the maven phase progress.
The run goal is just a super set of start goal that runs in non-daemon mode and is simply used for convenience. Basically, it allows the user to quickly run it's app with the current maven settings without having to run the full maven phases. In this mode, you will have to do a CTRL-C to kill maven/vert.x
2. stop - is this necessary? Won't CTRL-C do?
When in daemon mode, if you don't use it, then vert.x will keep running until the end of the maven build process.
3. Verticles - I am _really_ trying to get away from the idea of users deploying apps as straight verticles. This is almost always a bad idea. We should be pushing a standard application setup and that should be a module. I.e. users should always create their apps as modules. Consequently I think all the stuff about packaging/running verticles should be removed from the plugin. (This will also make things a lot simpler!). This is the way the vertx-gradle-template has been designed (it's all about modules), and I think we should be consistent with the Maven plugin too.
Yeap, not a problem, I will remove it. Although, and in my humble opinion, I often find myself wanting to quickly deploy a side verticle in order to do some proof of concept.
4. <configuration/> I think all (?) of these options can go since they're all related to deploying verticles not modules. (With the possible exception of config). Again, I recommend taking a look at the run target in the standard gradle template for how to model this.
I had a look in it, but I will look again in order to see if I'm missing something (I know very litle about Gradle and maybe I need to take some time to go through a good introduction). I did notice that it's only deploying modules. I initially thought this was strange but now I understand why.Test project:
1. Related to above... The test project creates a verticle. We should be pushing modules not verticles.
Yes, It was defaulted to verticle. But I can convert it to modules. Unfortunately, there are issues with the maven harness test lib and maven3 and testing it has become more work than I initially expected. Instead I've provided a simple side example that can be easily adapted to any user needs. It was just an example.
2. No tests. One of the big things about the standard templates is they make in-container testing very easy via the new testtools project. We should have examples of in container tests here (integration tests) in the same way as the Gradle template has them.
Yes, Ramki archtype should include the vertx junit annotation.
Also, the user is free to add the tests it requires. I can add an example. For example, run selenium tests during integration test phase.
3. Not polyglot. The test project should have examples of tests/code written in different languages.
True, as of yet I did not had the time to test it with all available languages.
That's still to be added. If it counts, I did test with a mod-lang-scala verticle to,
On 28/02/13 14:14, froz3n wrote:
Template:
1. I'm not sure I understand the different between start and run. Can you clarify?
In maven, in order to build your app you do:
mvn clean install
This will go through all the maven phases ( see here for more info http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)The start goal starts in daemon mode and ensures that vert.x will not block the maven phase progress.
The run goal is just a super set of start goal that runs in non-daemon mode and is simply used for convenience. Basically, it allows the user to quickly run it's app with the current maven settings without having to run the full maven phases. In this mode, you will have to do a CTRL-C to kill maven/vert.x
I still don't follow. The purpose of a run target is just to run the current module as if you have typed vertx runmod at the command line, but using the dependencies from the build. Why would we need a start target too?
2. stop - is this necessary? Won't CTRL-C do?
When in daemon mode, if you don't use it, then vert.x will keep running until the end of the maven build process.
The purpose of run is to run until you stop it.
3. Verticles - I am _really_ trying to get away from the idea of users deploying apps as straight verticles. This is almost always a bad idea. We should be pushing a standard application setup and that should be a module. I.e. users should always create their apps as modules. Consequently I think all the stuff about packaging/running verticles should be removed from the plugin. (This will also make things a lot simpler!). This is the way the vertx-gradle-template has been designed (it's all about modules), and I think we should be consistent with the Maven plugin too.
Yeap, not a problem, I will remove it. Although, and in my humble opinion, I often find myself wanting to quickly deploy a side verticle in order to do some proof of concept.
Sure, verticles are fine for writing trivial small scripts, but the templates are designed for people writing projects which, by definition, are non trivial. If you're just writing a 3 line web server you don't need a build script at all! Just echo <code> > app.js; vertx run app.js
4. <configuration/> I think all (?) of these options can go since they're all related to deploying verticles not modules. (With the possible exception of config). Again, I recommend taking a look at the run target in the standard gradle template for how to model this.
I had a look in it, but I will look again in order to see if I'm missing something (I know very litle about Gradle and maybe I need to take some time to go through a good introduction). I did notice that it's only deploying modules. I initially thought this was strange but now I understand why.Test project:
1. Related to above... The test project creates a verticle. We should be pushing modules not verticles.
Yes, It was defaulted to verticle. But I can convert it to modules. Unfortunately, there are issues with the maven harness test lib and maven3 and testing it has become more work than I initially expected. Instead I've provided a simple side example that can be easily adapted to any user needs. It was just an example.
I'm not sure I understand what you mean.
2. No tests. One of the big things about the standard templates is they make in-container testing very easy via the new testtools project. We should have examples of in container tests here (integration tests) in the same way as the Gradle template has them.
Yes, Ramki archtype should include the vertx junit annotation.
No please don't. Vert.x junit annotations are deprecated. The new build has a _much_ simpler way to run tests. Take a look at the Gradle build for examples.
Also, the user is free to add the tests it requires. I can add an example. For example, run selenium tests during integration test phase.
Yes please. The purpose of the Maven template project is to provide a template that users can adapt for their own modules. Consequently it's important that we show them how to write tests in different languages. Again, see the Gradle template for examples. You should just be able to copy and paste.
3. Not polyglot. The test project should have examples of tests/code written in different languages.
True, as of yet I did not had the time to test it with all available languages.
Just copy and paste from the Gradle project.
Tim,
On Thursday, February 28, 2013 9:26:48 AM UTC-5, Tim Fox wrote:On 28/02/13 14:14, froz3n wrote:
Template:
1. I'm not sure I understand the different between start and run. Can you clarify?
In maven, in order to build your app you do:
mvn clean install
This will go through all the maven phases ( see here for more info http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)The start goal starts in daemon mode and ensures that vert.x will not block the maven phase progress.
The run goal is just a super set of start goal that runs in non-daemon mode and is simply used for convenience. Basically, it allows the user to quickly run it's app with the current maven settings without having to run the full maven phases. In this mode, you will have to do a CTRL-C to kill maven/vert.x
I still don't follow. The purpose of a run target is just to run the current module as if you have typed vertx runmod at the command line, but using the dependencies from the build. Why would we need a start target too?
How do you do a CTRL-C when building in a Jenkins or Hudson server?
2. stop - is this necessary? Won't CTRL-C do?
When in daemon mode, if you don't use it, then vert.x will keep running until the end of the maven build process.
The purpose of run is to run until you stop it.
Again, CTRL-C is not sufficient.3. Verticles - I am _really_ trying to get away from the idea of users deploying apps as straight verticles. This is almost always a bad idea. We should be pushing a standard application setup and that should be a module. I.e. users should always create their apps as modules. Consequently I think all the stuff about packaging/running verticles should be removed from the plugin. (This will also make things a lot simpler!). This is the way the vertx-gradle-template has been designed (it's all about modules), and I think we should be consistent with the Maven plugin too.
Yeap, not a problem, I will remove it. Although, and in my humble opinion, I often find myself wanting to quickly deploy a side verticle in order to do some proof of concept.
Sure, verticles are fine for writing trivial small scripts, but the templates are designed for people writing projects which, by definition, are non trivial. If you're just writing a 3 line web server you don't need a build script at all! Just echo <code> > app.js; vertx run app.js
True, it's just a convenience. But now imagine the case where you have multiple vert.x projects. Some are 2.0 and some are of older versions. You obviously cannot have all versions in the same search PATH, so you either have prepared scripts of your own or, you simply start it using maven, which will already have exactly what you need, without having to be switching PATH or including extra external scripts.
Supporting Vert.x 1.x is not a requirement. No-one will be writing modules in 1.x in a few months time.
https://github.com/crazyfrozenpenguin/vertx-maven-plugin-test
Ramki, please notice that the test is not yet making use of your archtype.
Notice that I have used the assembly plugin to create a zipped module and a uncompressed module in the target directory. The user can then choose which one he would like to use. Also, the target directory is by default the vertx modules directory.
Hi froz3n,
Its a great start! I took a look at the internals and found that it is way more work than expected.
My comments are inline.
On Thursday, 28 February 2013 04:03:15 UTC+5:30, froz3n wrote:
- Please change the dependencies to io.vertx from org.vertx in the above repo. It doesn't compile and deploy because of this.https://github.com/crazyfrozenpenguin/vertx-maven-plugin-test- Add the sonatype repository in the pom.
- Again fix the deps to io.vertx from org.vertx.
Sonatype Repo for pom.xml:
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
Ramki, please notice that the test is not yet making use of your archtype.
I think it should be me integrating your stuff. From a developer perspective, here is what I think it should be.
$ > mvn archetype:generate -DarchetypeGroupId=org.vertx.build -DarchetypeArtifactId=vertx-maven-archetype -DgroupId=com.foo.bar -DartifactId=baz
$ > mvn vertx:start //this will run the sample verticle we have in the gradle-template project myVerticle.
Now, the developer can just go modify the samples we have in any language and take it for a spin. Isn't that the right thing to do?
Notice that I have used the assembly plugin to create a zipped module and a uncompressed module in the target directory. The user can then choose which one he would like to use. Also, the target directory is by default the vertx modules directory.
I'm not sure if its a good idea to keep the target directory default to vertx modules directory. I believe any maven user will expect the output to be in target directory. We unnecessarily don't need to educate developers to look for the module in vertx module directory. And while in development we will do countless builds, why should we put something thats being tested and unstable in the default vertx mods directory? From the gradle-template project, there is a copyMod() which will copy to local mods directory. So I guess we should just use that. What do you guys think?
On Friday, 1 March 2013 15:54:33 UTC, ramki wrote:Hi froz3n,
Its a great start! I took a look at the internals and found that it is way more work than expected.I'm honestly surprised this appears to be so much more work for Maven, the build is actually pretty simple. Here is the code for the Gradle version https://github.com/vert-x/vertx-gradle-template/blob/master/gradle/vertx.gradle - I'd expect something similar in complexity for Maven.
--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/0zpRd-nB1Jg/unsubscribe?hl=en-GB.
To unsubscribe from this group and all of its topics, send an email to vertx+un...@googlegroups.com.
Finally, got the maven archetype completely working including tests, packaging and install. The archetype now auto creates the mods directory before tests and runs the test after that.
I'm thinking this makes the maven archetype 100% complete. Let me know if there is something more to be added or missing.
Froz3n, you might want to take a look at the way the mods directory is created without using the mods-exploded assembler. It is way more easier like this I guess. And looks like we are never able to meet in IRC given the time zones. Let me know if you need help on plugin independently.
Tim,
Few observations from vertx-gradle-template project:
1) Looks like the "SNAPSHOT" is hard wired in the code. If I give my module's version as 1.0.0-SNAPSHOT, it takes it as 1.0.0-SNAPSHOT-SNAPSHOT when trying deploy the module.
Any reason behind the hard-wiring? Wouldn't it be ok to just take the module's version and let the developers add SNAPSHOT in their version?
2) When I saw something like deployModule("maven:...), I thought the "maven" part in the string was some kind of an indicator that it needs to be downloaded from maven repositories (remote or local). But it is basically wired in the directory name of the deployed module. If this is the case, do we really need "maven" part in the string? Or is it for future use? Or am I blind? :)
3) Every time I do a clean build, the dependent modules are being downloaded and written to mods directory. Is there a way we can avoid the download everytime?
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
A module name starts with a prefix. The current valid values are "maven", "bintray", and "old". It represents where your module is destined to go. The assumption is that Maven users will probably upload (and download) their modules to Maven since that's what they're used to.
Without the prefix, Vert.x wouldn't know where to look when downloading modules either. (Vert.x can look in maven local, maven remote, bintray and the old Vert.x 1.x repo)
On Tuesday, March 5, 2013 6:13:06 AM UTC+13, Tim Fox wrote:
A module name starts with a prefix. The current valid values are "maven", "bintray", and "old". It represents where your module is destined to go. The assumption is that Maven users will probably upload (and download) their modules to Maven since that's what they're used to.
Without the prefix, Vert.x wouldn't know where to look when downloading modules either. (Vert.x can look in maven local, maven remote, bintray and the old Vert.x 1.x repo)
With Maven - VertX itself should never be downloading modules, it should let Maven do that. I'm struggling with this part of VertX and it is a show stopper to us adopting us - this packaging stuff. I need our devs to be able to have their IDE open, their main VertX project open with any number of mods also open and Maven being able to recognize them locally in their respective directories (as both Eclipse and IDEA do),
On Tuesday, March 5, 2013 6:13:06 AM UTC+13, Tim Fox wrote:
A module name starts with a prefix. The current valid values are "maven", "bintray", and "old". It represents where your module is destined to go. The assumption is that Maven users will probably upload (and download) their modules to Maven since that's what they're used to.
Without the prefix, Vert.x wouldn't know where to look when downloading modules either. (Vert.x can look in maven local, maven remote, bintray and the old Vert.x 1.x repo)
With Maven - VertX itself should never be downloading modules, it should let Maven do that. I'm struggling with this part of VertX and it is a show stopper to us adopting us - this packaging stuff. I need our devs to be able to have their IDE open, their main VertX project open with any number of mods also open and Maven being able to recognize them locally in their respective directories (as both Eclipse and IDEA do), tie them together on run (without the need to package them up - they should just run unexploded, auto picking up the dependency tree required for the mod from the mod's pom and the exploded classes from the class directory of the project). As class files change, they should be able to be reloaded by JRebel. Once we decide to package them up, it should run entirely from inside a runnable jar file (like a runnable war file does already) - it should never ever download anything, you should just be able to type "java -jar website.jar" - pass some system properties and have it run.
This works as you describe when using the Standard Gradle template - I can seamlessly run, test and debug into Vert.x modules without having to rebuild anything when the code changes. The Maven template should be done before too long and will allow you to do exactly the same thing.
void deployVerticle(String main,JsonObject config, URL[] classpath,int instances,String includes,Handler<String> doneHandler);andvoid deployWorkerVerticle(boolean multiThreaded, String main,JsonObject config, URL[] classpath,int instances,String includes,Handler<String> doneHandler);exposed - this looks like it would do it?
Are you talking about something other than the linked vertx gradle template linked to in the included posting? Because that appears to copy the mods into your directory and run then from there. It won't detect any changes in the original project, or any dependency updates.
Also, is this vertx 2 (which is not out yet?)
Is there something else I can look at? I have already re-written the standard Maven plugin for Vertx so it works in an expected fashion for Maven, if the API provides some mechanism to just hand it a classloader and a module name and have it NOT try and get files from anywhere else, that will probably largely solve the problem.
On Tuesday, March 5, 2013 10:33:35 PM UTC+13, Tim Fox wrote:This works as you describe when using the Standard Gradle template - I can seamlessly run, test and debug into Vert.x modules without having to rebuild anything when the code changes. The Maven template should be done before too long and will allow you to do exactly the same thing.
> I'm honestly surprised this appears to be so much more work for Maven, the
> build is actually pretty simple. Here is the code for the Gradle version
> https://github.com/vert-x/vertx-gradle-template/blob/master/gradle/vertx.gradle
> - I'd expect something similar in complexity for Maven.
>
On 05/03/13 09:47, Richard Vowles wrote:
Are you talking about something other than the linked vertx gradle template linked to in the included posting? Because that appears to copy the mods into your directory and run then from there. It won't detect any changes in the original project, or any dependency updates.
It does detect changes in the original project, since in Vert.x 2.0 resources can be loaded from the system classpath, which in the IDE will be setup to include all the resources of the application.
Also, is this vertx 2 (which is not out yet?)
Yes, all of this is Vert.x 2.0. A major thrust of Vert.x 2.0 is to make developer experience a lot easier. This includes seamless build/test/run/debug.
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Hi froz3n,
I've taken a look at the latest stuff here https://github.com/crazyfrozenpenguin/vertx-maven-plugin-test.git
To be honest, I'm not sure where to begin. It doesn't seem to have any resemblance to the structure of the example Gradle project (they should be almost identical). I can't see the new test framework being used.
I also don't understand the relation between vertx-maven-plugin and vertx-maven-plugin-test. Can you walk me through this? I also don't understand why all the code about starting servers is necessary - this should just be one-liner using the PlatformManager as the Gradle task does.
I guess I'm missing something? Or I'm looking in the wrong place maybe?
Tim
On Tuesday, March 5, 2013 5:07:07 AM UTC-5, Tim Fox wrote:Hi froz3n,
I've taken a look at the latest stuff here https://github.com/crazyfrozenpenguin/vertx-maven-plugin-test.git
To be honest, I'm not sure where to begin. It doesn't seem to have any resemblance to the structure of the example Gradle project (they should be almost identical). I can't see the new test framework being used.
Keep in mind that this is not based on archtype to be used (not yet anyway). This is just something that I have put together to simply test the plugin being developed.
I also don't understand the relation between vertx-maven-plugin and vertx-maven-plugin-test. Can you walk me through this? I also don't understand why all the code about starting servers is necessary - this should just be one-liner using the PlatformManager as the Gradle task does.
I guess I'm missing something? Or I'm looking in the wrong place maybe?
Yes, I think you're missing how maven really works. Maven works in a much different way than Gradle.
They are not apples-to-apples. Gradle, very much like ANT, uses the concepts of tasks and tasks dependencies in order to allow developers to create a desired build setup. In addition, Gradle is scriptable and Maven is not. In Maven tasks do not exist. What exists is a Maven lifecycle that goes through pre-defined phases during the build process. To these phases you can hook plugins that implement goals. So, for all effects, the closest thing you have to a task in Gradle or ANT is a plugin goal.
Also, let me explain how to work with the provided test. There two ways to work with it and they are both required.
Both examples assume that you compiled the vertx-maven-plugin and that it available in your local maven repo. If you have not, please check the code out from github (https://github.com/crazyfrozenpenguin/vertx-maven-plugin) and, from the created directory do" "mvn clean install".
Example 1: Running the full maven lifecycle
This working mode is useful for creating a release, source delivery or simply for running it in a CI environment since it will basically execute all phases from the maven lifecycle (compile, test, etc).
open a terminal/command window and navigate into the vertx-maven-plugin-test directory.Do: "mvn clean install".
During the process you will notice maven going through the several phases and calling the respective plugin goals. At the "pre-inegration-test" phase two plugins will be executed. One is the Selenium server plugin that will start the Selenium server and the other is the Vert.x server that will start the vert.x server and deploy the module in development. Notice that Vert.x will not block and wait for a CTRL-C. This is because doing so would stop the maven lifecycle from proceeding. Hence, the during the next phase, the "integration-test" phase, the integration tests are executed and you should notice a Firefox window come up and execute a selenium test. After that the "post-integration-test" is executed and so on...
Example 2: Development mode
This working mode is useful for development.open two terminal/command windows and navigate into the vertx-maven-plugin-test directory.In one terminal you do: "mvn selenium:start-server -Dport=8888".
In the other terminal you do: "mvn vertx:run"
Notice that both the Selenium server and vertx server are now blocking and waiting for a CTRL-C to stop it.In eclipse, import the vertx-maven-plugin-test directory as a maven project into your eclipse workspace (you'll need m2e plugin for eclipse installed. If you are using something like Spring STS or JBoss Dev Studio, then you should be good to go). In eclipse, open the selenium test class (CTRL - SHIFT - t) named VertxTest and put a debug point anywhere in the code. Then just run the test as a JUnit test.
On 05/03/13 14:16, froz3n wrote:
Tim
On Tuesday, March 5, 2013 5:07:07 AM UTC-5, Tim Fox wrote:Hi froz3n,
I've taken a look at the latest stuff here https://github.com/crazyfrozenpenguin/vertx-maven-plugin-test.git
To be honest, I'm not sure where to begin. It doesn't seem to have any resemblance to the structure of the example Gradle project (they should be almost identical). I can't see the new test framework being used.
Keep in mind that this is not based on archtype to be used (not yet anyway). This is just something that I have put together to simply test the plugin being developed.
I also don't understand the relation between vertx-maven-plugin and vertx-maven-plugin-test. Can you walk me through this? I also don't understand why all the code about starting servers is necessary - this should just be one-liner using the PlatformManager as the Gradle task does.
I guess I'm missing something? Or I'm looking in the wrong place maybe?
Yes, I think you're missing how maven really works. Maven works in a much different way than Gradle.
I'm referring to the project structure - it's completely different in your template.
I've used a standard Maven project structure in the Gradle template, so there's no reason why they can't be followed. I notice Ramki's archectype does mirror the Gradle template closely.
They are not apples-to-apples. Gradle, very much like ANT, uses the concepts of tasks and tasks dependencies in order to allow developers to create a desired build setup. In addition, Gradle is scriptable and Maven is not. In Maven tasks do not exist. What exists is a Maven lifecycle that goes through pre-defined phases during the build process. To these phases you can hook plugins that implement goals. So, for all effects, the closest thing you have to a task in Gradle or ANT is a plugin goal.
Also, let me explain how to work with the provided test. There two ways to work with it and they are both required.
Both examples assume that you compiled the vertx-maven-plugin and that it available in your local maven repo. If you have not, please check the code out from github (https://github.com/crazyfrozenpenguin/vertx-maven-plugin) and, from the created directory do" "mvn clean install".
Example 1: Running the full maven lifecycle
This working mode is useful for creating a release, source delivery or simply for running it in a CI environment since it will basically execute all phases from the maven lifecycle (compile, test, etc).
open a terminal/command window and navigate into the vertx-maven-plugin-test directory.Do: "mvn clean install".
During the process you will notice maven going through the several phases and calling the respective plugin goals. At the "pre-inegration-test" phase two plugins will be executed. One is the Selenium server plugin that will start the Selenium server and the other is the Vert.x server that will start the vert.x server and deploy the module in development. Notice that Vert.x will not block and wait for a CTRL-C. This is because doing so would stop the maven lifecycle from proceeding. Hence, the during the next phase, the "integration-test" phase, the integration tests are executed and you should notice a Firefox window come up and execute a selenium test. After that the "post-integration-test" is executed and so on...
No, no, no. We already have a way of running Vert.x tests in the container (the Gradle template and Ramki's archetype uses it). If Maven can run Junit tests then it will be able to run them. You don't need any special starting up of servers in order to do this. The in container test framework has also been designed so tests will run seamlessly in IDEs without any special setup. Also debugging is supported. Please use that.
Example 2: Development mode
This working mode is useful for development.open two terminal/command windows and navigate into the vertx-maven-plugin-test directory.In one terminal you do: "mvn selenium:start-server -Dport=8888".
In the other terminal you do: "mvn vertx:run"
Notice that both the Selenium server and vertx server are now blocking and waiting for a CTRL-C to stop it.In eclipse, import the vertx-maven-plugin-test directory as a maven project into your eclipse workspace (you'll need m2e plugin for eclipse installed. If you are using something like Spring STS or JBoss Dev Studio, then you should be good to go). In eclipse, open the selenium test class (CTRL - SHIFT - t) named VertxTest and put a debug point anywhere in the code. Then just run the test as a JUnit test.
I don't even know what Selenium is but have no idea how it's relevant to a standard build template for Vert.x!
On Tuesday, March 5, 2013 9:38:09 AM UTC-5, Tim Fox wrote:On 05/03/13 14:16, froz3n wrote:
Tim
On Tuesday, March 5, 2013 5:07:07 AM UTC-5, Tim Fox wrote:Hi froz3n,
I've taken a look at the latest stuff here https://github.com/crazyfrozenpenguin/vertx-maven-plugin-test.git
To be honest, I'm not sure where to begin. It doesn't seem to have any resemblance to the structure of the example Gradle project (they should be almost identical). I can't see the new test framework being used.
Keep in mind that this is not based on archtype to be used (not yet anyway). This is just something that I have put together to simply test the plugin being developed.
I also don't understand the relation between vertx-maven-plugin and vertx-maven-plugin-test. Can you walk me through this? I also don't understand why all the code about starting servers is necessary - this should just be one-liner using the PlatformManager as the Gradle task does.
I guess I'm missing something? Or I'm looking in the wrong place maybe?
Yes, I think you're missing how maven really works. Maven works in a much different way than Gradle.
I'm referring to the project structure - it's completely different in your template.
That's correct, That archtype is in development and there are things that are different. The structure does follow the maven way of organizing src and test directories. Unfortunatly, maven only allows for one source directory and one test directory.
Extra source directories will have to be added as resources. So, and as I recall, if you want to have a src/main/java and a src/main/groovy one of them will have to added as a resource directory.I've used a standard Maven project structure in the Gradle template, so there's no reason why they can't be followed. I notice Ramki's archectype does mirror the Gradle template closely.
Yes, and when we are done, this test will be implemented from a specialization of the archtype that Ramki is working on.They are not apples-to-apples. Gradle, very much like ANT, uses the concepts of tasks and tasks dependencies in order to allow developers to create a desired build setup. In addition, Gradle is scriptable and Maven is not. In Maven tasks do not exist. What exists is a Maven lifecycle that goes through pre-defined phases during the build process. To these phases you can hook plugins that implement goals. So, for all effects, the closest thing you have to a task in Gradle or ANT is a plugin goal.
Also, let me explain how to work with the provided test. There two ways to work with it and they are both required.
Both examples assume that you compiled the vertx-maven-plugin and that it available in your local maven repo. If you have not, please check the code out from github (https://github.com/crazyfrozenpenguin/vertx-maven-plugin) and, from the created directory do" "mvn clean install".
Example 1: Running the full maven lifecycle
This working mode is useful for creating a release, source delivery or simply for running it in a CI environment since it will basically execute all phases from the maven lifecycle (compile, test, etc).
open a terminal/command window and navigate into the vertx-maven-plugin-test directory.Do: "mvn clean install".
During the process you will notice maven going through the several phases and calling the respective plugin goals. At the "pre-inegration-test" phase two plugins will be executed. One is the Selenium server plugin that will start the Selenium server and the other is the Vert.x server that will start the vert.x server and deploy the module in development. Notice that Vert.x will not block and wait for a CTRL-C. This is because doing so would stop the maven lifecycle from proceeding. Hence, the during the next phase, the "integration-test" phase, the integration tests are executed and you should notice a Firefox window come up and execute a selenium test. After that the "post-integration-test" is executed and so on...
No, no, no. We already have a way of running Vert.x tests in the container (the Gradle template and Ramki's archetype uses it). If Maven can run Junit tests then it will be able to run them. You don't need any special starting up of servers in order to do this. The in container test framework has also been designed so tests will run seamlessly in IDEs without any special setup. Also debugging is supported. Please use that.
This is different. Vert.x now offeres in-container tests (similar concept to what archillian is to jboss). Still, in some cases, you still want to hit the server from the outside. That's the sample test I've provided.
assembly/mod.xml:* Everything from src/main/resources should be included in jar, not just mod.json (Isn't that the default anyway?)
* src/test/resources should not be included
Tests:* GroovyIntegrationTests/JavaScriptIntegrationTests/PythonIntegrationTests/RubyIntegrationTests - the regexp seems to have been munged, e.g. 'filenameFilter=".+${symbol_escape}${symbol_escape}.groovy"This probably explains why only the JavaIntegrationTest is being run when I execute mvn test?* Test report - I can't see any html test report produced after running mvn test. Can we have something similar to what the Gradle build produces?* A system property should be used (vertx.moduleName) when deploying modules - this means the user doesn't have to hardcoded the module name in there which would make tests brittle like this:container.deployModule("maven:org.myorg:my-project:1.0-SNAPSHOT")* clean target doesn't delete the mods directory
* The mod zip file produced has the wrong structure - it contains a mods/mod-name directory - this should not be there.
* Where is the target to run the module? (i.e. equivalent of runMod target in Gradle build)* A lot of what is in pom.xml is just boilerplate - is it possible to separate this out into a separate file since it won't change - I'd rather see an approach like that (as we did in the Gradle template)* GroupId, module-directory and mods-directory seem to have the group id duplicated:<groupId>io.vertx</groupId><module-directory>io.vertx.my-project-v1.0</module-directory><mods-directory>maven:io.vertx:my-project:1.0-SNAPSHOT</mods-directory>
* Typo <id>sonatypet</id>
should be sonatype - Have you tried pushing to sonatype?
* Pull in deps target is missing
You only need one source and test dir. I think Ramki has got it right in his archetype.
Yes, and when we are done, this test will be implemented from a specialization of the archtype that Ramki is working on.
I think the key thing to do is to get the template demonstrating how to run unit and integration tests. I can't see either of those in your template currently. Other types of test can come later.
I don't even know what Selenium is but have no idea how it's relevant to a standard build template for Vert.x!
Selenium is a web test framework that allows you to automate web page tests. It is not relevant to the standard build of Vert.x and that's why I did not provide it initially. But you did ask me to include it in one of our previous discussions. So I did!
This pretty much covers most development and CI needs. But Richard does raise some good points, specially when it comes to have the module hot deployed on source code changes.
On Wednesday, March 6, 2013 4:11:34 AM UTC+13, Tim Fox wrote:You only need one source and test dir. I think Ramki has got it right in his archetype.No you don't - you want as many as there are sources and test directories.Yes, and when we are done, this test will be implemented from a specialization of the archtype that Ramki is working on.I think the key thing to do is to get the template demonstrating how to run unit and integration tests. I can't see either of those in your template currently. Other types of test can come later.These should just be the surefire and failsafe plugins, they shouldn't be included in an archetype in the end anyway,