简体   繁体   English

Maven - 如何在使用 maven-source-plugin 生成的.jar 文件中包含 jsp 文件

[英]Maven - How can I include jsp files in the .jar file generated using maven-source-plugin

I'm trying to pack the source code of my application into a.JAR file, I used the maven-source-plugin for the same.我正在尝试将我的应用程序的源代码打包到一个.JAR 文件中,我也使用了 maven-source-plugin。 I added the following section into pom.xml for the same -我将以下部分添加到 pom.xml

          <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.1.0</version>
                <extensions>false</extensions>
                <inherited>true</inherited>
                <configuration>
                   <outputDirectory>c:\app\workspace</outputDirectory>
                    <finalName>app.jar</finalName>
                    <attach>false</attach>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
           </plugin>

I can see the source files in the jar generated at the outputDirectory location, but the JSP files are missing, I can see only.java files.在 outputDirectory 位置生成的 jar 中可以看到源文件,但是缺少 JSP 文件,我只能看到.java 文件。 How can I also pack.jsp files?我怎样才能打包.jsp 文件? My application has these jsp files stored under src/main/webapps folder.我的应用程序将这些 jsp 文件存储在 src/main/webapps 文件夹下。 I do not see webapps folder in the jar generated.我在生成的 jar 中没有看到 webapps 文件夹。 Please advise.请指教。

I'm trying to pack the source code of my application into a.JAR file, I used the maven-source-plugin for the same.我正在尝试将我的应用程序的源代码打包到一个.JAR 文件中,我也使用了 maven-source-plugin。 I added the following section into pom.xml for the same -我将以下部分添加到 pom.xml

          <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.1.0</version>
                <extensions>false</extensions>
                <inherited>true</inherited>
                <configuration>
                   <outputDirectory>c:\app\workspace</outputDirectory>
                    <finalName>app.jar</finalName>
                    <attach>false</attach>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
           </plugin>

I can see the source files in the jar generated at the outputDirectory location, but the JSP files are missing, I can see only.java files.在 outputDirectory 位置生成的 jar 中可以看到源文件,但是缺少 JSP 文件,我只能看到.java 文件。 How can I also pack.jsp files?我怎样才能打包.jsp 文件? My application has these jsp files stored under src/main/webapps folder.我的应用程序将这些 jsp 文件存储在 src/main/webapps 文件夹下。 I do not see webapps folder in the jar generated.我在生成的 jar 中没有看到 webapps 文件夹。 Please advise.请指教。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有maven-source-plugin的maven-jar-plugin不起作用 - maven-jar-plugin with maven-source-plugin not working 如何使用maven在生成的jar中包含与.class文件并行的源文件(.java文件) - How to include source file(.java file) parallel to .class file in the generated jar using maven maven-source-plugin可以构建sources.jar,但是IDE无法使用 - maven-source-plugin builds sources.jar, but it's unusable by IDEs Maven:如何使用故障安全插件在jar中运行/包含类? - Maven: How can I run/include a class in a jar with the failsafe plugin? Maven Shade 插件:“mvn install”如何在本地存储库中包含通过“mvn package”生成的相同 jar? - Maven Shade Plugin: how 'mvn install' can include in the local repository the same jar generated through 'mvn package'? 在Maven生成的jar中包含一个zip文件 - Include a zip file in the Maven generated jar JOOQ Maven插件-生成的源文件的编码 - JOOQ Maven plugin - encoding of generated source files 如何使用Maven包插件在OSGi包中包含一罐依赖项? - How to include a jar of dependency in an OSGi bundle using maven bundle plugin? Maven:如何创建源文件和测试文件的 jar 文件? - Maven: How to create a jar file of source files and test files? 如何配置maven shade插件以在我的jar中包含测试代码? - How can I configure the maven shade plugin to include test code in my jar?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM