eclipse - Web service maven build jar does not work -


i build web service project in jar can deployed on jboss server. can done if compile .war project, makes 12mo content content of .war web service

but in pom.xml when want specify .jar project archive makes 10ko , contains nothing picture

content of .jar web service

here's pom.xml file

<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>monwebservicefacility</groupid> <artifactid>monwebservicefacility</artifactid> <version>0.0.1-snapshot</version> <!--<packaging>war</packaging>--> <build>     <sourcedirectory>src</sourcedirectory>     <plugins>         <plugin>             <artifactid>maven-compiler-plugin</artifactid>             <version>3.5.1</version>             <configuration>                 <source>1.7</source>                 <target>1.7</target>             </configuration>         </plugin>     </plugins> </build> <properties>     <cxf.version>3.1.7</cxf.version> </properties> <dependencies>     ...some depenencies... </dependencies> 

so how can build jar archive deployed in jboss server ?

here's project architecture :

project architecture

you need use <packaging>jar</packaging> in pom.xml , need create web.xml webaap>web_inf folder.

<servlet> <servlet-name>myservlet</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param>     <param-name>contextconfiglocation</param-name>     <param-value>classpath:applicationcontext.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> 

<servlet-mapping>     <servlet-name>myservlet</servlet-name>     <url-pattern>/api/*</url-pattern> </servlet-mapping>  <filter>     <filter-name>encoding-filter</filter-name>     <filter-class>org.springframework.web.filter.characterencodingfilter</filter-class>     <init-param>         <param-name>encoding</param-name>         <param-value>utf-8</param-value>     </init-param>     <init-param>         <param-name>forceencoding</param-name>         <param-value>true</param-value>     </init-param> </filter>   <filter-mapping>     <filter-name>encoding-filter</filter-name>     <url-pattern>/*</url-pattern> </filter-mapping>  <welcome-file-list>     <welcome-file>/index.jsp</welcome-file> </welcome-file-list> 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -