1

I want to run a Java-Applet. I use a JBoss Server. I use Maven. I use Eclipse. I deploy my Web-Archive inside an Enterprise Archive onto the Server by using Eclipse.

For the Applet I need the Applet's .class-file in an accessible folder for the applet.html. My idea was to copy the .class-from the target-folder to the resources-folder of my Web-Archive. So I added following plugin to the pom.xml of the Web-Maven-Project:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4</version>
                            <goals>
                                <goal>deploy</goal>
                            </goals>
            <executions>
                <execution>
                    <id>copy-applet-related-classes</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>

                       <outputDirectory>${basedir}/target/LMS-Admin-Web-  0.0.1/resources/applet</outputDirectory>
                        <resources>
                            <resource>
                                <directory>${basedir}/target/classes/de/test/lms/applet</directory>
                                <filtering>true</filtering>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

I think I'm messing up the phase and the goal. It worked once when I had the goal "install" for the package and executed "mvn clean install" inside my project-folder. The problem is when I use right-click->publish in Eclipse. I don't know, what goals are run than. I tried a lot around, but it doesn't apply in the JBoss' standalone/deployments/... file-system. Turns out this is also really hard to google. So I'd be thankful for any ideas, links or other help!

EDIT: I found out, that the classes-folder in the target-folder is edited when I publish, but the WEB-Folder which is packaged to the WAR-File isn't. Maybe I need a phase, which is before packaging? I'm to investigate further tomorrow.

4

2 に答える 2

1

私のプロジェクトでは、ディレクトリにコピーする必要があるアプレットも必要でしたclasses。唯一の違いは、アプレットをアーティファクトとして (したがって jar に) 保存したことです。process-resourcesそのためにフェーズを使用しています。あなたの場合もおそらくそうです。

アプレットをパッケージ化する場合に備えて、私のソリューションを追加します。署名したい場合は、これを行う必要があります。

            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.2</version>
                    <executions>
                        <execution>
                            <id>copy-signed-applet</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>copy</goal>
                            </goals>
                            <configuration>
                                <artifactItems>
                                    <artifactItem>
                                        <groupId>mygroupid</groupId>
                                        <artifactId>myapplet</artifactId>
                                        <version>${myapplet.version}</version>
                                        <outputDirectory>${project.build.outputDirectory}/path/to/applet</outputDirectory>
                                        <destFileName>myapplet.jar</destFileName>
                                    </artifactItem>
                                </artifactItems>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>

Eclipse を使用している場合は、プラグインのライフサイクル マッピングを (まだ持っていない場合) に追加する必要がありますpluginManagementcopyゴールにアクションがあることを確認してくださいexecute

                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-dependency-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>copy</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute/>
                                    </action>
                                </pluginExecution>
...
于 2013-01-08T21:10:14.670 に答える
0

Git Param Plugin を使用してみてください: https://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin

それはあなたを助けるはずです。

于 2013-01-11T16:53:24.360 に答える