jcabi / jcabi-manifests

Java library for convenient reading of MANIFEST.MF files available in classpath
https://manifests.jcabi.com
Other
60 stars 22 forks source link

when compile ,can not read manifests value #42

Open Nyainqentanglha opened 6 years ago

Nyainqentanglha commented 6 years ago

when in mvn complie code ,I read dependency lib mainfests value,can not find value?

0crat commented 6 years ago

@yegor256 please, pay attention to this issue

yegor256 commented 6 years ago

@Zihan0409 can you please show the code? I don't understand what the problem is

Nyainqentanglha commented 6 years ago

@yegor256 thank you very much! 1.I have a java annotation processor lib A,in this I user Manifests.read("frameVersion"); 2.I have a frame lib B,which dependency A , in B pom.xml ,config

  <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <includes>
                        <include>**/lib/**</include>
                    </includes>
                    <archive>
                        <index>true</index>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <frameVersion>${project.version}</frameVersion>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
  1. I hava test project C,which dependency B, when I compile C , read frameVersion is ""; when runtime , I can read frameVersion is B version.

My English is not good, thank you for seeing here, thank you very much!

Nyainqentanglha commented 6 years ago

compile read all key and value: Ant-Version:Apache Ant 1.8.4 Archiver-Version:Plexus Archiver Bnd-LastModified:1409332092134 Build-Jdk:1.6.0_31 Built-By:olamy Bundle-Description:A class loader framework Bundle-DocURL:http://www.codehaus.org/ Bundle-License:http://www.apache.org/licenses/LICENSE-2.0.txt Bundle-ManifestVersion:2 Bundle-Name:Plexus Classworlds Bundle-SymbolicName:org.codehaus.plexus.classworlds Bundle-Vendor:Codehaus Bundle-Version:2.5.2 Created-By:Apache Maven Export-Package:org.codehaus.classworlds,org.codehaus.plexus.classworlds.realm,org.codehaus.plexus.classworlds.strategy,org.codehaus.plexus.classworlds,org.codehaus.plexus.classworlds.launcher Implementation-Title:Maven Compiler Plugin Implementation-Vendor:The Apache Software Foundation Implementation-Vendor-Id:org.apache.maven.plugins Implementation-Version:2.4 Main-Class:org.codehaus.plexus.classworlds.launcher.Launcher Manifest-Version:1.0 Specification-Title:Maven Compiler Plugin Specification-Vendor:The Apache Software Foundation Specification-Version:2.4 Tool:Bnd-1.15.0 Ant-Version:Apache Ant 1.8.4 Archiver-Version:Plexus Archiver Bnd-LastModified:1409332092134 Build-Jdk:1.6.0_31 Built-By:olamy Bundle-Description:A class loader framework Bundle-DocURL:http://www.codehaus.org/ Bundle-License:http://www.apache.org/licenses/LICENSE-2.0.txt Bundle-ManifestVersion:2 Bundle-Name:Plexus Classworlds Bundle-SymbolicName:org.codehaus.plexus.classworlds Bundle-Vendor:Codehaus Bundle-Version:2.5.2 Created-By:Apache Maven Export-Package:org.codehaus.classworlds,org.codehaus.plexus.classworlds.realm,org.codehaus.plexus.classworlds.strategy,org.codehaus.plexus.classworlds,org.codehaus.plexus.classworlds.launcher Implementation-Title:Maven Compiler Plugin Implementation-Vendor:The Apache Software Foundation Implementation-Vendor-Id:org.apache.maven.plugins Implementation-Version:2.4 Main-Class:org.codehaus.plexus.classworlds.launcher.Launcher Manifest-Version:1.0 Specification-Title:Maven Compiler Plugin Specification-Vendor:The Apache Software Foundation Specification-Version:2.4 Tool:Bnd-1.15.0

yegor256 commented 6 years ago

@Nyainqentanglha with all due respect, I have no idea what you're talking about :(