Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Using own MANIFEST.MF file or adding dependencies with grails-maven-plugin #79

Open
ghost opened this issue May 2, 2018 · 0 comments
Open

Comments

@ghost
Copy link

ghost commented May 2, 2018

I am trying to convert a grails project from ant build to maven build and I am unable to add any dependencies to MANIFEST.MF file. Is there a way I can add dependencies to the MANIFEST.MF or use my own MANIFEST.MF file with grails-maven-plugin? I have tried to use the maven-resources-plugin for copying the file, but its not working. Any pointers on this would really help :)

Plugins in my pom.xml look like:

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <compilerId>groovy-eclipse-compiler</compilerId>
        <source>${jdk.version}</source>
        <target>${jdk.version}</target>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.9.1-01</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>2.3.7-01</version>
        </dependency>
    </dependencies>
</plugin>
<plugin>
    <groupId>org.grails</groupId>
    <artifactId>grails-maven-plugin</artifactId>
    <version>2.4.4</version>
    <configuration>
        <skipTests>true</skipTests>
        <fork>true</fork>
    </configuration>
    <extensions>true</extensions>
    <executions>
        <execution>
            <goals>
                <goal>clean</goal>
                <goal>maven-war</goal>
                <goal>validate</goal>
            </goals>
        </execution>
    </executions>
</plugin>
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>cobertura-maven-plugin</artifactId>
    <version>2.7</version>
    <configuration>
        <formats>
            <format>html</format>
            <format>xml</format>
        </formats>
    </configuration>
</plugin>
<plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.6</version>
    <configuration>
        <warSourceDirectory>web-app</warSourceDirectory>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.4.2</version>
    <executions>
        <execution>
            <id>default-copy-resources</id>
            <phase>process-resources</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <overwrite>true</overwrite>
                <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/META-INF/</outputDirectory>
                <resources>
                    <resource>
                        <directory>${project.basedir}/src/META-INF</directory>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>

MANIFEST.MF generated by maven looks like

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.4
Created-By: 1.8.0_144-b01 (Oracle Corporation)
Import-Package: javax.servlet;version="[3.0,4.0)",javax.servlet.http;v
 ersion="[3.0,4.0)",javax.servlet.resources;version="[3.0,4.0)",javax.
 servlet.jsp;version="[2.2,3.0)";resolution:=optional,javax.servlet.js
 p.el;version="[2.2,3.0)";resolution:=optional,javax.servlet.jsp.jstl;
 version="[2.2,3.0)";resolution:=optional,javax.servlet.jsp.jstl.core;
 version="[2.2,3.0)";resolution:=optional,javax.servlet.jsp.jstl.fmt;v
 ersion="[2.2,3.0)";resolution:=optional,javax.servlet.jsp.jstl.sql;ve
 rsion="[2.2,3.0)";resolution:=optional,javax.servlet.jsp.jstl.tlv;ver
 sion="[2.2,3.0)";resolution:=optional,javax.servlet.jsp.tagext;versio
 n="[2.2,3.0)";resolution:=optional,javax.servlet.jsp.resources;versio
 n="[2.2,3.0)";resolution:=optional,javax.xml.parsers,org.w3c.dom,org.
 xml.sax,org.xml.sax.ext,org.xml.sax.helpers
Webapp-Context: empdet
Bundle-ClassPath: .,WEB-INF/classes,WEB-INF/lib/activation-1.1.jar,WEB
 -INF/lib/antlr-2.7.7.jar,WEB-INF/lib/aopalliance-1.0.jar,WEB-INF/lib/
 aspectjrt-1.8.2.jar,WEB-INF/lib/aspectjweaver-1.8.2.jar,WEB-INF/lib/c
 lassmate-1.0.0.jar,WEB-INF/lib/common-0.0.12.jar,WEB-INF/lib/commons-
 beanutils-1.9.1.jar,WEB-INF/lib/commons-codec-1.6.jar,WEB-INF/lib/com
 mons-collections-3.2.1.jar,WEB-INF/lib/commons-fileupload-1.3.1.jar,W
 EB-INF/lib/commons-httpclient-3.0.jar,WEB-INF/lib/commons-io-2.2.jar,
 WEB-INF/lib/commons-lang-2.6.jar,WEB-INF/lib/commons-lang3-3.2.1.jar,
 WEB-INF/lib/commons-validator-1.4.0.jar,WEB-INF/lib/concurrentlinkedh
 ashmap-lru-1.4.jar

Name: Grails Application
Implementation-Title: empdet
Implementation-Version: 0.0.1-SNAPSHOT
Grails-Version: 2.4.4

Along with this content in MANIFEST.MF, I also need to have the dependencies section as below

Dependencies: common,deployment.ValidationService.jar
@ghost ghost changed the title Using own MANIFEST.MF file with grails-maven project Using own MANIFEST.MF file or adding dependencies with grails-maven-plugin Mar 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants