如何编辑pom.xml并创建.jar文件

时间:2014-02-07 14:40:59

标签: java maven jar bluej

我有一个.jar文件,其中包含pom.xml。我想为它添加依赖项。我尝试编辑pom.xml,添加依赖项,压缩文件并将其重命名为.jar。但是当我包含时.jar文件,它给我以下错误“错误读取.jar,打开.zip文件时出错”。我正在使用BlueJ.please帮助:(

我的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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.glassfish.main.extras</groupId>
    <artifactId>javaee-pom</artifactId>
    <version>4.0</version>
</parent>

<name>GlassFish javaee.jar </name>
<artifactId>javaee</artifactId>
<build>
    <plugins>
        <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                <manifestEntries>
            <Class-Path>../modules/javax.servlet-api.jar ../modules/endorsed/javax.annotation-api.jar ../modules/javax.ejb-api.jar ../modules/javax.transaction-api.jar ../modules/javax.enterprise.deploy-api.jar ../modules/javax.management.j2ee-api.jar ../modules/javax.resource-api.jar ../modules/javax.security.auth.message-api.jar ../modules/javax.security.jacc-api.jar ../modules/webservices-osgi.jar ../modules/jaxb-osgi.jar ../modules/endorsed/jaxb-api-osgi.jar ../modules/endorsed/webservices-api-osgi.jar ../modules/javax.xml.rpc-api.jar ../modules/javax.xml.registry-api.jar ../modules/javax.mail.jar ../modules/javax.faces.jar ../modules/javax.servlet.jsp-api.jar ../modules/javax.el.jar ../modules/javax.servlet.jsp.jstl-api.jar ../modules/javax.persistence.jar ../modules/javax.jms-api.jar ../modules/bean-validator.jar ../modules/weld-osgi-bundle.jar ../../mq/lib/jaxm-api.jar ../modules/javax.ws.rs-api.jar ../modules/javax.json.jar ../modules/javax.websocket-api.jar ../modules/javax.enterprise.concurrent-api.jar ../modules/javax.batch-api.jar</Class-Path>
                    <GlassFish-ServerExcluded>true</GlassFish-ServerExcluded>
                </manifestEntries>
                </archive>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
  <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>3.8.1</version>
     <scope>test</scope>
  </dependency></project>

我已经添加了我想要的依赖项。压缩文件夹并将其重命名为jar.but它给了我上面提到的错误。

0 个答案:

没有答案