Maven Project URL -
i have made ear project maven in neatbeans ide running on glassfish, , problem default url of project, instead of loading:
http://localhost:8080/opine-war
is loading
http://localhost:8080/opine-war-1.0-snapshot
<?xml version="1.0" encoding="utf-8"?> <!doctype glassfish-application public "-//glassfish.org//dtd glassfish application server 3.1 java ee application 6.0//en" "http://glassfish.org/dtds/glassfish-application_6_0-1.dtd"> <glassfish-application> </glassfish-application>
this 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> <parent> <artifactid>opine</artifactid> <groupid>br.edu.infnet</groupid> <version>1.0-snapshot</version> </parent> <groupid>br.edu.infnet</groupid> <artifactid>opine-ear</artifactid> <version>1.0-snapshot</version> <packaging>ear</packaging> <name>opine-ear</name> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-ear-plugin</artifactid> <version>2.8</version> <configuration> <version>6</version> <defaultlibbundledir>lib</defaultlibbundledir> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupid>br.edu.infnet</groupid> <artifactid>opine-ejb</artifactid> <version>1.0-snapshot</version> <type>ejb</type> </dependency> <dependency> <groupid>br.edu.infnet</groupid> <artifactid>opine-war</artifactid> <version>1.0-snapshot</version> <type>war</type> </dependency> </dependencies> </project>
i think there 2 options. 1 change finalname inside pom.xml:
<build> <finalname>${project.artifactid}-${project.version}</finalname>
above shows default.
another option change context name of application derived ear file name. deployed ear not need match context name (which want "opine-war"?
you can customize within ear plugin (which enabled if use <packaging>ear</packaging>
: https://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-context-root.html
Comments
Post a Comment