Weird maven warning even with the official archetype

I am trying to understand what is needed for a typical war project that generates its own custom widgetset. It most probably needs the vaadin-client and does not require the vaadin-client-compiled since we compile our own.

I have used the archetype for 7.0.5 and when I build I get the same warning as in my setup

i.e.
[WARNING]
Failed to retrieve com.vaadin:vaadin-client-compiler based on project POM


INFO] ------------------------------------------------------------------------
[INFO]
 Building Vaadin Web Application 1.0
[INFO]
 ------------------------------------------------------------------------
[INFO]

[INFO]
 --- maven-clean-plugin:2.4.1:clean (default-clean) @ project-name ---
[INFO]
 Deleting c:\temp\3\project-name\target
[INFO]
 Deleting c:\temp\3\project-name\src\main\webapp\VAADIN\widgetsets (includes = [], excludes = []
)
[INFO]

[INFO]
 --- maven-resources-plugin:2.5:resources (default-resources) @ project-name ---
[debug]
 execute contextualize
[INFO]
 Using 'UTF-8' encoding to copy filtered resources.
[INFO]
 skip non existing resourceDirectory c:\temp\3\project-name\src\main\resources
[INFO]

[INFO]
 --- vaadin-maven-plugin:7.0.5:resources (default) @ project-name ---
[INFO]
 auto discovered modules [your.company.AppWidgetSet]

[INFO]
 1 source files from GWT module your.company.AppWidgetSet
[INFO]

[INFO]
 --- maven-compiler-plugin:2.3.2:compile (default-compile) @ project-name ---
[INFO]
 Compiling 1 source file to c:\temp\3\project-name\target\classes
[INFO]

[INFO]
 --- vaadin-maven-plugin:7.0.5:update-widgetset (default) @ project-name ---
[INFO]
 auto discovered modules [your.company.AppWidgetSet]

[INFO]
 Updating widgetset your.company.AppWidgetSet
[WARNING]
 Ignoring missing resource directory: c:\temp\3\project-name\src\main\resources
[WARNING]
 Failed to retrieve com.vaadin:vaadin-client-compiler based on project POM
[INFO]
 Using com.vaadin:vaadin-client-compiler version 7.0.5
[ERROR]
 16-mai-2013 10:48:09 com.vaadin.server.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[ERROR]
 INFO: Widgetsets found from classpath:

I haven’t changed the pom. Any idea?

Thanks.

If the project POM does not refer to vaadin-client-compiler explicitly, you get the warning and the Maven plugin will try to deduce the correct version of it to use from the version of vaadin-shared. When you use and compile your own widgetset, you should change the vaadin-client-compiled dependency to vaadin-client-compiler with scope “provided.”

Whether the default project should refer to vaadin-client-compiler and always compile a widgetset instead of using vaadin-client-compiled is another topic for discussion, and there have been strong opinions either way. My personal opinion is that the application project should be a multi-module project with a widgetset in a separate module, but some others have been opposed to that due to the additional complexity of the initial project. Personally, I find that argument irrelevant outside of demo or “hello world” situations as real-world projects are almost always split in modules and doing the splitting later is considerably more complicated.

I am sorry, I wrote the thread a bit too fast; I saw that changelist in the maven plugin that does that.

I agree with you and that’s what we use here internally. However, there might be another alternative for you. I tried this


<plugin>
                    <groupId>com.vaadin</groupId>
                    <artifactId>vaadin-maven-plugin</artifactId>
                    <version>${vaadin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.vaadin</groupId>
                            <artifactId>vaadin-client-compiler</artifactId>
                            <version>${vaadin.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

and I still get the warning because you look for the project dependencies. How about looking the plugin dependencies. After all that thing is only used by the plugin right? It will never be used by the project itself?

the same might work for vaadin-client as well and since you’re releasing the plugin every time you release vaadin you could event get the defaults right by adding that to the plugin dependency directly.

Of course, I haven’t looked to the code of the plugin. That might now work for you due to classloader issue and such but it’s worth investigating IMO.

The reason why defining the dependency inside the plugin worked for the GWT plugin and older versions of the Vaadin plugin is that the plugin used a dependency of its own for the GWT/vaadin-client* JARs, which in my opinion was always a bad way to do it with Maven. That also required new versions of the plugin for each version of Vaadin.

The latest Vaadin plugin does not use its own dependency to specify which versions of vaadin-client* to include on project classpath for widgetset compilation etc. Instead, it uses project dependencies (if vaadin-client* defined there, directly or indirectly) and deduces the correct version from the version of vaadin-shared if nothing else is specified. With the new approach, it would not be necessary anymore to always build a new plugin version, although for now we are doing that.

A (non-“provided”) dependency to vaadin-client-compiler is needed in the project when using SuperDevMode. Otherwise, it can be left for the plugin to manage or can be specified as a “provided” scope dependency.

okay that make sense. In that case I would suggest to lower the warning to INFO then because what you do is a sensitive default. Unless you feel that this resolving based on vaadin-shared is a last resort option and users should fix their dependencies.