Code Monkey home page Code Monkey logo

Comments (5)

ndarilek avatar ndarilek commented on July 16, 2024

The more I ponder this, the more I wonder why it's necessary, and think that it adds more complications than it solves. To wit:

  1. There appears to be no standard library to concatenate a version number to in order to pull in a servlet dependency.
  2. To my knowledge, there are only two major servlet API versions in widespread use, and in most cases you want to use 3.0.
  3. Servlet APIs are provided by the container being used (I.e. Jetty.)

I'm running two servlets in my app. The non-Vaadin servlet that handles my non-UI APIs and endpoints requires 3.0, but apparently the automatic pulling in of the 2.5 API breaks things. I also can't override this to 3.0 or pull in a standard replacement.

So perhaps this option should go, and we can just use the API provided by Jetty? That, or add a boolean flag to enable use of 2.5. If set, the 2.5 APIs are pulled in. If not, then configurations are left alone.

Thanks.

from gradle-vaadin-plugin.

johndevs avatar johndevs commented on July 16, 2024

The servlet version was previously used in two places; 1) to resolve the Development Mode internal Jetty server dependencies and 2) to provide eclipse projects with the correct jst.web facet version.

The first point is no longer needed since the Development Mode's internal Jetty server is no longer used and so the dependencies for servlet-api and jsp-api is no longer needed and could be removed. That would also resolve your problems with conflicting dependencies. That could be easily be done for 0.5.1.

The second point is still valid though. The eclipse jst.web facet still needs to be set to the correct servlet version for the facet to work properly. So I still think we should keep the servletVersion option around.

from gradle-vaadin-plugin.

ndarilek avatar ndarilek commented on July 16, 2024

OK, fair point, but as it stands, there doesn't appear to be a way to
use servlet 3.0. Am I just missing it?

So while it may be necessary for Eclipse, there doesn't seem to be a way
to make it work from the console, and there doesn't appear to be a way
to turn it off. My app should work fine without the dependency added
automatically.

I like this plugin generally, but sometimes it seems to do a bit too
much magic behind the scenes. While said magic might be necessary, I'm
not sure it should come at the expense of fixing some things and
breaking others when the former aren't needed by some users and the
latter are.

Maybe if an Eclipse user needs a certain servlet version to be pulled in
explicitly, then they should explicitly do so? The vaadinRun case could
just pull in Jetty 8 only. It makes sense to me that a Vaadin plugin
would pull in Vaadin-specific dependencies, but specific servlet
versions seems to go a bit too far.

Thanks.

from gradle-vaadin-plugin.

johndevs avatar johndevs commented on July 16, 2024

Removed the dependencies to servlet-api so they will not get pulled in.

After that change the servletVersion will only be related to what the eclipse facet uses and does not affect any dependencies in any way. So if you are not using eclipse (or don't care about the Vaadin eclipse plugin facet) then you are not required to set the servlet version. In the future this might change though if more servlet specific functionality is added like CDI support for instance.

from gradle-vaadin-plugin.

johndevs avatar johndevs commented on July 16, 2024

There did appear some issues using servlet 3.0 with the plugin. Mostly the problem is that the jetty8 server is not currently scanning for the @WebServlet annotation so creating web.xml:less projects is not currently possible. Opened #36 about improving the support for servlet 3.0.

from gradle-vaadin-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.