VaidAbhishek
VaidAbhishek

Reputation: 6144

setting up dependencies in a maven project in Netbeans

I have a maven based project, which I need to setup in my netbeans. After many a hours I still cannot figure out following issues.

  1. The tomcat is installed by Netbeans, but still I'm unable to resolve imports for packages like:

import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.HttpContext;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import org.json.JSONObject;
import org.json.JSONTokener;

What I'm struggling to understand is whether all these packages will be provided by Java EE container or we have to manually install them with our app. According to my little understanding of Java Web apps, I suspect that tomcat should have taken care of these dependencies by now. However, it is not appearing so.

I hope someone is able to clarify and at the same time provide some intuition behind structuring of Java based webapps using maven and spring.

Upvotes: 0

Views: 536

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240870

I don't think container provides Spring dependency by default, so add those explicitly, if your container provides some libraries by container or in runtime environment somehow you need to mark maven dependency scope as provided

Upvotes: 1

Related Questions