How to create .war file using maven? - maven

Here is my project consisting of the following maven modules:
model, services, web
Only web module war file is creating under target folder..web module consists of controllers and web pages
My pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.aitrich.learnware</groupId>
<artifactId>Learnware</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Learnware Cloud Application - Master</name>
<description>This is parent pom for Learnware Cloud Application, where all the generic configurations are defined.</description>
<modules>
<module>LearnwareWeb</module>
<module>LearnwareModel</module>
<module>LearnwareServices</module>
</modules>
<organization>
<name>Aitrich Technologies</name>
<url>http://www.aitrich.com</url>
</organization>
<developers>
<developer>
<id>1</id>
<name>Shaheer</name>
<roles>
<role>Technical Leader</role>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>2</id>
<name>Shinas</name>
<roles>
<role>Team Leader</role>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>3</id>
<name>Prasanth AR</name>
<roles>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>4</id>
<name>Jijesh VU</name>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javaee6.web.spec.version>2.0.0.Final</javaee6.web.spec.version>
<spring.version>3.1.2.RELEASE</spring.version>
<hibernate.version>4.1.1.Final</hibernate.version>
<junit.version>4.11</junit.version>
<java-version>1.7</java-version>
<jboss.as.maven.plugin.version>7.4.Final</jboss.as.maven.plugin.version>
</properties>
<repositories>
<repository>
<id>springsource-repo</id>
<name>SpringSource Repository</name>
<url>http://repo.springsource.org/release</url>
</repository>
<repository>
<id>jboss-releases-repository</id>
<name>JBoss Releases Repository</name>
<url>
https://repository.jboss.org/nexus/content/repositories/releases/
</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.aitrich.learnware</groupId>
<artifactId>LearnwareModel</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.aitrich.learnware</groupId>
<artifactId>LearnwareServices</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.aitrich.learnware</groupId>
<artifactId>LearnwareWeb</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
<scope>compile</scope>
</dependency>
<!-- JBoss distributes a complete set of Java EE 6 APIs including a Bill
of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection)
of artifacts. We use this here so that we always get the correct versions
of artifacts. Here we use the jboss-javaee-web-6.0 stack (you can read this
as the JBoss stack of the Java EE Web Profile 6 APIs) -->
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-web-6.0</artifactId>
<version>${javaee6.web.spec.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- JSR-303 (Bean Validation) Implementation -->
<!-- Provides portable constraints such as #Email -->
<!-- Hibernate Validator is shipped in JBoss AS 7 -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<directory>${project.basedir}/target</directory>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<!--Plugin for JBossAs7 -->
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${jboss.as.maven.plugin.version}</version>
<inherited>true</inherited>
<configuration>
<hostname>localhost</hostname>
<port>9999</port>
<filename>${project.build.finalName}.war</filename>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

I assume the web module depends on the model and services module. Then in the web module you should use packaging
<packaging>war</packaging>
which will create a WAR with everything in it. See War Plugin The created WAR contains its dependencies. You can not deploy the model or services projects alone.
If your project already is packaged as war, check if JARs of model and services are inside the WAR/WEB-INF/lib folder. if yes everything is ok and the war is ready to be deployed.

You need to set packaging at pom.xml
<packaging>war</packaging>
Then run the command:
mvn install

Her is what is should look like:
<build>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<unpackTypes>war</unpackTypes>
</configuration>
</plugin>
</plugins>
</build>

Related

Vaadin 8 to 14 migration . ERROR in ../target/flow-frontend/VaadinDevmodeGizmo.js Module not found

I am trying Vaadin 8 to 14 MPR migration for which I have built a simple application which disaplys components created in Vaadin 8 and after migration to 14, I have to show them in UI.
During the Frontend compilation, I get errors as below
ERROR in ../target/flow-frontend/Flow.js
Module not found: Error: Can't resolve '#vaadin/common-frontend' in 'C:\Vaadin14\VaadinMPR\vadin-8-to-14-mpr-ui\target\flow-frontend'
# ../target/flow-frontend/Flow.js 1:0-79 77:60-75 260:8-27 270:52-67 274:56-71 277:56-71 284:52-67
# ../target/index.ts
# ./generated/vaadin.ts
ERROR in ../target/frontend/generated-flow-imports.js
Module not found: Error: Can't resolve '#vaadin/flow-frontend/ConnectionIndicator.js' in 'C:\Vaadin14\VaadinMPR\vadin-8-to-14-mpr-ui\target\frontend'
# ../target/frontend/generated-flow-imports.js 11:0-54
# ../target/index.ts
# ./generated/vaadin.ts
ERROR in ../target/flow-frontend/VaadinDevmodeGizmo.js
Module not found: Error: Can't resolve 'lit' in 'C:\Vaadin14\VaadinMPR\vadin-8-to-14-mpr-ui\target\flow-frontend'
# ../target/flow-frontend/VaadinDevmodeGizmo.js 7:0-53 123:40-50 144:15-18 1143:19-22 1146:19-22 1149:19-22 1152:19-22 1155:19-22 1160:15-19 1170:38-42 1172:14-18 1176:14-18 1190:15-19 1196:35-39 1224:86-93 1233:14-18 1254:14-18 1276:31-35 1276:108-115 1280:15-19 1292:15-19 1332:15-19 1337:39-43 1373:30-33 1374:31-34 1375:30-33 1376:32-35 1377:29-32
ERROR in ../target/flow-frontend/VaadinDevmodeGizmo.js
Module not found: Error: Can't resolve 'lit/decorators.js' in 'C:\Vaadin14\VaadinMPR\vadin-8-to-14-mpr-ui\target\flow-frontend'
# ../target/flow-frontend/VaadinDevmodeGizmo.js 8:0-59 1393:4-12 1396:4-12 1399:4-12 1402:4-12 1405:4-12 1408:4-12 1411:4-12 1414:4-12 1417:4-12 1420:4-12 1423:4-9 1426:4-9 1429:4-9 1432:4-9 1435:4-9 1438:4-9
ERROR in ../target/flow-frontend/VaadinDevmodeGizmo.js
Module not found: Error: Can't resolve 'lit/directives/class-map.js' in 'C:\Vaadin14\VaadinMPR\vadin-8-to-14-mpr-ui\target\flow-frontend'
# ../target/flow-frontend/VaadinDevmodeGizmo.js 9:0-55 1197:24-32
Child HtmlWebpackCompiler:
1 asset
Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
[../node_modules/.pnpm/html-webpack-plugin#4.5.1_webpack#4.46.0/node_modules/html-webpack-plugin/lib/loader.js!../target/index.html] 1.17 KiB {HtmlWebpackPlugin_0} [built]
i 「wdm」: Failed to compile.
------------------ Frontend compilation failed. ------------------
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
Here is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>vadin-8-to-14-mpr-ui</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>vadin-8-to-14-mpr-ui</name>
<prerequisites>
<maven>3</maven>
</prerequisites>
<properties>
<!-- <vaadin.version>8.9.4</vaadin.version>-->
<vaadin.version>14.8.0</vaadin.version>
<vaadin.plugin.version>8.9.4</vaadin.plugin.version>
<jetty.plugin.version>9.4.43.v20210629</jetty.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- If there are no local customizations, this can also be "fetch" or "cdn" -->
<vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>8.13.3</version>
<exclusions>
<exclusion>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-elemental</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
<version>8.13.3</version>
</dependency>
<!-- <dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
</dependency>-->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>8.7.0</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>mpr-v8</artifactId>
</dependency>
<!-- External dependencies-->
0
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-server</artifactId>
<version>6.0.4</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-client</artifactId>
<version>9.0.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Exclude an unnecessary file generated by the GWT compiler. -->
<packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>flow-maven-plugin</artifactId>
<version>2.0.7</version>
<executions>
<execution>
<goals>
<goal>prepare-frontend</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<!-- Clean up also any pre-compiled themes -->
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/themes</directory>
<includes>
<include>**/styles.css</include>
<include>**/styles.scss.cache</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- The Jetty plugin allows us to easily test the development build by
running jetty:run on the command line. -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</project>
Tried following steps:
Deleted the npm modules, package.json, webpack.config.js, webpack.generated.js, target folders and ran
mvn clean package
Ran mvn clean install
Tried solutions as in the links
Cannot find module '#vaadin/flow-frontend/Flow'
https://vaadin.com/forum/thread/17762163/module-not-found#
https://vaadin.com/forum/thread/17883890/webpack-error-can-t-resolve-vaadin-flow-frontend-flow-component-renderer
Nothing helped
Can you please give me leads on how to fix it?

Javax.persistence and hibernate-core maven dependency not working with spring-boot-starter-data-jpa

Since the Bintray and JCenter sunset, I am facing issue with CI/CD Pipeline build.
I identified the issue and fixed it with the help of stackoverflow user by including additional repositories.
Now after adding new repositories, I am facing issue with dependencies for spring-data-jpa (especially hibernate-core and persistence api is not working and I see compile time error). While running mvn clean install command, I got the error package javax.persistence not found. Project structure is multi-module with a parent and many Child module as below -
Parent pom
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.demo</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>sfv</name>
<url>http://maven.apache.org</url>
<modules>
<module>mysql-db</module>
<module>demo-util</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<spring.boot.version>1.3.3.RELEASE</spring.boot.version>
<spring.version>4.2.5.RELEASE</spring.version>
<aws.version>1.9.22</aws.version>
<searchbox.version>2.0.0</searchbox.version>
<mysql.version>5.1.38</mysql.version>
<ehcache.version>2.10.1</ehcache.version>
<commons.net.version>2.0</commons.net.version>
<thumbnailator.version>0.4.8</thumbnailator.version>
<google.api.version>v4-rev9-1.22.0</google.api.version>
<gson.client.version>1.21.0</gson.client.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray</name>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-repo</id>
<name>Spring Repository</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-central</id>
<name>Maven Central</name>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.sfv.App</mainClass>
<arguments>
<argument>argument1</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<inherited>false</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
mysql-db pom -
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.demo.db.mysql</groupId>
<artifactId>mysql-db</artifactId>
<packaging>jar</packaging>
<name>mysql-db</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>com.demo</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
</dependencies>
</project>
All dependency for util and mysql project started breaking somehow. I tried to include missing versions but seems as I fix one, the list keep on growing. For example, to fix javax.persistence error I include below two dependency -
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
But further, in the util project, I got slf4j dependency error. These dependency previous was provided by spring-boot-starter-data-jpa, but not working anymore since moving away from Bintray.
Fortunately, this issue was not related to dependency management but artifactory server. I am managing internal artifactory server which is primary source of repositories.
While using mvn clean install command the error was misleading to dependency issue but the actual issue was Artifactory Server Storage failure which lead to unresolved dependency. Storage space was full on Artifactory server due to which download operations were also impacted.
To resolve this error, we added extra volume to the server and it started working fine there after.

Anypoint studio - error running project using Maven

I'm trying to run mule application in Anypoint studio using Maven.
I configured env variables for Java home and Maven home.
Maven test inside Anypoint studio passed well.
Maven test
JDK path instead of JRE path configured in Anypointstudio preferences. I also
checked all env components to use JDK.
JDK instead of JRE path
Here is my pom.xml file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>test3</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>Mule test3 Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<mule.version>3.8.3</mule.version>
<mule.tools.version>1.2</mule.tools.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-app-maven-plugin</artifactId>
<version>${mule.tools.version}</version>
<extensions>true</extensions>
<configuration>
<copyToAppsDirectory>true</copyToAppsDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/app/</directory>
</resource>
<resource>
<directory>src/main/api/</directory>
</resource>
<resource>
<directory>mappings/</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- Mule Dependencies -->
<dependencies>
<!-- Xml configuration -->
<dependency>
<groupId>com.mulesoft.muleesb</groupId>
<artifactId>mule-core-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Xml configuration -->
<dependency>
<groupId>com.mulesoft.muleesb.modules</groupId>
<artifactId>mule-module-spring-config-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Mule Transports -->
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-file</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-http</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mulesoft.muleesb.transports</groupId>
<artifactId>mule-transport-jdbc-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mulesoft.muleesb.transports</groupId>
<artifactId>mule-transport-jms-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Mule Modules -->
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-scripting</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-xml</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- for testing -->
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Central</id>
<name>Central</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-release</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>http://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
When I run app I get following error in console:
Failed to execute goal on project test3: Could not resolve
dependencies for project com.mycompany:test3:mule:1.0.0-SNAPSHOT: The
following artifacts could not be resolved:
com.mulesoft.muleesb:mule-core-ee:jar:3.8.3,
com.mulesoft.muleesb.modules:mule-module-spring-config-ee:jar:3.8.3,
org.mule.transports:mule-transport-file:jar:3.8.3,
org.mule.transports:mule-transport-http:jar:3.8.3,
com.mulesoft.muleesb.transports:mule-transport-jdbc-ee:jar:3.8.3,
com.mulesoft.muleesb.transports:mule-transport-jms-ee:jar:3.8.3,
org.mule.transports:mule-transport-vm:jar:3.8.3,
org.mule.modules:mule-module-scripting:jar:3.8.3,
org.mule.modules:mule-module-xml:jar:3.8.3,
org.mule.tests:mule-tests-functional:jar:3.8.3: Failure to find
com.mulesoft.muleesb:mule-core-ee:jar:3.8.3 in
http:repo1.maven.org/maven2/ was cached in the local repository,
resolution will not be reattempted until the update interval of
Central has elapsed or updates are forced -> [Help 1]
What could be wrong in configuration? Any Ideas?
you are trying to use enterprise edition libraries without providing the EE repositories. Notice that you also need an account to be able to download the EE repositories.
Get in touch with Mulesoft Support, they should provide you with a valid username / password ( if you are already using EE license) and provide the settings for the EE repository
I'm able to ran your pom file without any issues. Probably you have firewall issues that stopping jar files download check on that?
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>test3</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>Mule test3 Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<mule.version>3.8.3</mule.version>
<mule.tools.version>1.2</mule.tools.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-app-maven-plugin</artifactId>
<version>${mule.tools.version}</version>
<extensions>true</extensions>
<configuration>
<copyToAppsDirectory>true</copyToAppsDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/app/</directory>
</resource>
<resource>
<directory>src/main/api/</directory>
</resource>
<resource>
<directory>mappings/</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- Mule Dependencies -->
<dependencies>
<!-- Xml configuration -->
<dependency>
<groupId>com.mulesoft.muleesb</groupId>
<artifactId>mule-core-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Xml configuration -->
<dependency>
<groupId>com.mulesoft.muleesb.modules</groupId>
<artifactId>mule-module-spring-config-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Mule Transports -->
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-file</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-http</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mulesoft.muleesb.transports</groupId>
<artifactId>mule-transport-jdbc-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mulesoft.muleesb.transports</groupId>
<artifactId>mule-transport-jms-ee</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Mule Modules -->
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-scripting</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-xml</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- for testing -->
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Central</id>
<name>Central</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-release</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>http://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

convert maven pom to gradle build

I am converting one of my maven project into gradle. For doing this I am runngin following command where pom.xml is located
gradle init --type pom
But it is giving me java.lang.NullPointerException
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':init'.
> Could not convert Maven POM /Users/myname/Documents/oAuth+Angular/workspace/feature-oauth_and_security_69/ui/pom.xml to a Gradle build.
> Unable to create Maven project model using POM /Users/myname/Documents/oAuth+Angular/workspace/feature-oauth_and_security_69/ui/pom.xml.
> java.lang.NullPointerException (no error message)
is there anything to perform with init or anything else i am missing?
This is my pom.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test</groupId>
<artifactId>ui</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ui</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>1.0.1.BUILD-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<wro4j.version>1.7.6</wro4j.version>
<java.version>1.7</java.version>
</properties>
<build>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<!-- Serves *only* to filter the wro.xml so it can get an absolute
path for the project -->
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/wro</outputDirectory>
<resources>
<resource>
<directory>src/main/wro</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<cssDestinationFolder>${project.build.directory}/generated-resources/static/css</cssDestinationFolder>
<jsDestinationFolder>${project.build.directory}/generated-resources/static/js</jsDestinationFolder>
<wroFile>${project.build.directory}/wro/wro.xml</wroFile>
<extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
<contextFolder>${basedir}/src/main/wro</contextFolder>
</configuration>
<dependencies>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angularjs</artifactId>
<version>1.3.8</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/libs-release-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
There is a problem with <parent> element, exactly with <relativePath/> inner element in block:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.2.RELEASE</version>
<relativePath />
</parent>
When you remove the <relativePath/> element or set it correctly, the gradle will initialize the project.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.2.RELEASE</version>
<!-- <relativePath>../parent/pom.xml</relativePath> -->
</parent>
The problem was with the incorrectly set relativePath element, which didn't point to the parent pom file as it should.
I don't know why but worked after commenting the "repositories"
Thanks for all help
I feel a cleaner way to convert a maven project with parent module to a gradle one is by following steps below:
Get an effective pom.xml for the project to pom_eff.xml:
mvn help:effective-pom -Doutput=pom_eff.xml
Remove parent tag from pom_eff.xml
Take backup of the original pom.xml and rename pom_eff.xml to pom.xml.
Do gradle init
This way gradle engine gets a flattened version of the pom.xml that is far simpler to decode for the gradle system.
In the Gradle page:
Note Gradle doesn’t support the import scope in the POMs of dependencies, so you’ll have to manually import them using the above syntax.
https://gradle.org/migrating-a-maven-build-to-gradle/
Not only will the Gradle init task allow you to create a new skeleton project, but it will also automatically convert an existing Maven one to Gradle. All you have to do is run the command
$ gradle init

Using Scalatra 2.2.1 with Maven

Has anyone been successful for using Maven and Scalatra 2.2.1?
I found this old archetype https://github.com/Srirangan/scalatra-maven-prototype and tried to update the dependency versions, but I keep hitting incompatibility issues.
I'd like to use:
Scalatra 2.2.1
Scala 2.10
I think that Jetty has some problems to run the produced war.
I would highly appreciate your help on this one.
Here's the example project which I am using:
http://www.scalatra.org/2.2/getting-started/first-project.html
And my current pom.xml:
<?xml version='1.0' encoding='UTF-8'?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-scalatra-web-app</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<scalatra.version>2.2.1</scalatra.version>
</properties>
<build>
<finalName>scalatra-maven-prototype</finalName>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<arg>-make:transitive</arg>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<useFile>false</useFile>
<disableXmlReport>true</disableXmlReport>
<includes>
<include>**/*Test.*</include>
<include>**/*Suite.*</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.17</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.scalatra</groupId>
<artifactId>scalatra_2.10</artifactId>
<version>${scalatra.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.scalatra</groupId>
<artifactId>scalatra-scalate_2.10</artifactId>
<version>${scalatra.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.scalatra</groupId>
<artifactId>scalatra-specs2_2.10</artifactId>
<version>${scalatra.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0.20100224</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.6</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.10.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>SonatypeNexusSnapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>FuseSourceSnapshotRepository</id>
<name>FuseSource Snapshot Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>ScalaToolsMaven2Repository</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases/</url>
</repository>
<repository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
</project>
Ok after a lot of crying, I found the correct versions to use, and the correct artifacts.
Hope that it'll be helpful for someone:
<?xml version='1.0' encoding='UTF-8'?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-scalatra-web-app</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<scalatra.version>2.2.1</scalatra.version>
</properties>
<build>
<finalName>scalatra-maven-prototype</finalName>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<arg>-make:transitive</arg>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<useFile>false</useFile>
<disableXmlReport>true</disableXmlReport>
<includes>
<include>**/*Test.*</include>
<include>**/*Suite.*</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.0.4.v20130625</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.scalatra</groupId>
<artifactId>scalatra_2.10</artifactId>
<version>${scalatra.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.scalatra</groupId>
<artifactId>scalatra-scalate_2.10</artifactId>
<version>${scalatra.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.scalatra</groupId>
<artifactId>scalatra-specs2_2.10</artifactId>
<version>${scalatra.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.servlet</artifactId>
<version>3.0.0.v201112011016</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>9.0.4.v20130625</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.10.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>SonatypeNexusSnapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>FuseSourceSnapshotRepository</id>
<name>FuseSource Snapshot Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>ScalaToolsMaven2Repository</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases/</url>
</repository>
<repository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
</project>

Resources