0
私はあなたの助けが必要です。 Mavenによるビルドアプリケーション中にサブプロジェクトのバージョンをMANIFEST.MF
ファイルに追加するスクリプトを書く必要があります。Mavenビルド中にMANIFEST.MFファイルに自分の情報を追加
私は必要な情報を取得するMojoクラスを作成しました(私はGenerateVersionPropertyFile.class
という名前です)。今、私はこの情報をマニフェストファイルに入れる方法を知っておく必要があります。
は、ここに私のpom.xml
次のとおりです。
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<ejbVersion>3.1</ejbVersion>
<generateClient>true</generateClient>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
<!--
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
</manifest>
-->
<manifestEntries>
<Built-By />
</manifestEntries>
<manifestSections>
<manifestSection>
<Name>appName</Name>
<manifestEntries>
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
</manifestEntries>
</manifestSection>
<manifestSection>
<Name>exampleApp</Name>
<manifestEntries>
<Implementation-Title>exampleEntry</Implementation-Title>
<Implementation-Version>dupa2</Implementation-Version>
<Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
</manifestEntries>
</manifestSection>
</manifestSections>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>maven.GenerateVersionPropertyFile</mainClass>
<arguments>
<argument>${project.basedir}\src</argument>
<argument>${project.build.directory}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>server-ejb-build-devel</id>
<activation>
<property>
<name>build-devel</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<archive>
<manifestSections>
<manifestSection>
<Name>app1</Name>
<manifestEntries>
<Implementation-Build>${buildNumber}</Implementation-Build>
<Implementation-Timestamp>${timestamp}</Implementation-Timestamp>
</manifestEntries>
</manifestSection>
</manifestSections>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
? – Apostolos
申し訳ありませんmayby私はそれを間違って説明しました。私がサブプロジェクトを言ったとき、私はプロジェクトからjsonスキーマについて考えます。私はこのファイルを解析し、それらから情報を得る必要があるので、私はこれにJavaクラスを使いました。 – user2420602
hmmグラデーションに移動する可能性はありますか?それはそのようなもののために非常に強力です。ただの考え – Apostolos