【发布时间】:2015-02-04 01:20:05
【问题描述】:
我正在尝试构建一个要在 WebLogic 上运行的项目(打包为一个耳朵)。然而,虽然构建(mvn clean package)成功,但ear文件只包含一个META-INF文件夹,里面的文件很少。
我对这个项目(或 EJB)不是很熟悉,但它看起来像一个 EJB 项目(我看到了 EJBHome、EJBObject、EJBLocalObject)。
不太确定从这里去哪里 - 我已经在网上和其他帖子中搜索过,但没有找到太多内容。即使是正确方向的一点也会很有用。
构建日志:
C:\Users\LevineJ\Development\default-workspace\reportservice>mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building reportservice 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ reportservice ---
[INFO] Deleting C:\Users\LevineJ\Development\default-workspace\reportservice\target
[INFO]
[INFO] --- maven-ear-plugin:2.8:generate-application-xml (default-generate-application-xml) @ reportservice ---
[INFO] Generating application.xml
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ reportservice ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e.
build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\LevineJ\Development\default-workspace\reportservice\src\main\resources
[INFO]
[INFO] --- maven-ear-plugin:2.8:ear (default-ear) @ reportservice ---
[INFO] Could not find manifest file: C:\Users\LevineJ\Development\default-workspace\reportservice\target\reportservice-0.0.1-SNAPSHOT\META-INF\MANIFEST.MF - Generating one
[INFO] Building jar: C:\Users\LevineJ\Development\default-workspace\reportservice\target\reportservice-0.0.1-SNAPSHOT.ear
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.380 s
[INFO] Finished at: 2015-02-03T19:55:50-05:00
[INFO] Final Memory: 5M/244M
[INFO] ------------------------------------------------------------------------
生成的 EAR:
生成的 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>reportservice</groupId>
<artifactId>reportservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>ear</packaging>
</project>
来自源的 pom.xml
<?xml version="1.0"?>
<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>reportservice</groupId>
<artifactId>reportservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>ear</packaging>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://artifactory.gxsonline.net/libs-release</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://artifactory.gxsonline.net/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://artifactory.gxsonline.net/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://artifactory.gxsonline.net/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\src\main\java</sourceDirectory>
<scriptSourceDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\src\main\scripts</scriptSourceDirectory>
<testSourceDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\src\test\java</testSourceDirectory>
<outputDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\target\classes</outputDirectory>
<testOutputDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\target\test-classes</testOutputDirectory>
<resources>
<resource>
<directory>C:\Users\LevineJ\Development\default-workspace\reportservice\src\main\resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>C:\Users\LevineJ\Development\default-workspace\reportservice\src\test\resources</directory>
</testResource>
</testResources>
<directory>C:\Users\LevineJ\Development\default-workspace\reportservice\target</directory>
<finalName>reportservice-0.0.1-SNAPSHOT</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-install</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<id>default-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>default-ear</id>
<phase>package</phase>
<goals>
<goal>ear</goal>
</goals>
</execution>
<execution>
<id>default-generate-application-xml</id>
<phase>generate-resources</phase>
<goals>
<goal>generate-application-xml</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
<executions>
<execution>
<id>default-site</id>
<phase>site</phase>
<goals>
<goal>site</goal>
</goals>
<configuration>
<outputDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
<execution>
<id>default-deploy</id>
<phase>site-deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<outputDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
</executions>
<configuration>
<outputDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<outputDirectory>C:\Users\LevineJ\Development\default-workspace\reportservice\target\site</outputDirectory>
</reporting>
</project>
【问题讨论】:
-
显示项目 pom.xml
-
@sunysen - 刚刚添加了构建和源 pom.xml 文件。
标签: java build ejb maven-3 ear