Manish Basdeo
Manish Basdeo

Reputation: 6269

Generate a web application using maven generate

I have generated a project struture using maven using mvn archetype:generate and the project structure is as follows: webapps -src -main -java -com -web -App.java -test

I have tried following the tutorial on the link create web app

Running mvn dependency:analyze-dep-mgt

but still the project structure differs.

While I use this mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false, I get Pom file missing

Where am I being wrong so that the struture differs and my web.xml not being generated?

C:\Users\user\workspace\webappspringapp\webapp>mvn dependency:analyze-dep-mgt
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.webapp:webapp:1.0-SNAPSHOT (C:\Users\user\workspace\we
bappspringapp\webapp\pom.xml) has 3 errors
[ERROR]     'dependencies.dependency.version' for org.springframework:spring-cor
e:jar must be a valid version but is '${spring.version}'. @ line 14, column 13
[ERROR]     'dependencies.dependency.version' for org.springframework:spring-web
:jar must be a valid version but is '${spring.version}'. @ line 20, column 13
[ERROR]     'dependencies.dependency.version' for org.springframework:spring-web
mvc:jar must be a valid version but is '${spring.version}'. @ line 26, column 13

[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException

Pom.xml part

<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
    <dependency>

Upvotes: 0

Views: 389

Answers (1)

Nikhil A A
Nikhil A A

Reputation: 441

mvn dependency:tree

This is used to view the dependency hierarchy of the project currently being built. It will output the resolved tree of dependencies that the Maven build process actually uses.

Upvotes: 1

Related Questions