关于外部罐子和 MAVEN 的问题

发布于 2024-10-09 22:29:47 字数 408 浏览 0 评论 0原文

我有两个GWT项目项目A和项目B。这些项目的依赖关系由MAVEN负责。项目B依赖于项目A,这部分已经被处理了。

现在我需要将外部 Jar 添加到项目 AI 中,不想为此使用 Maven。我只想将外部 jar 文件添加到项目 A 中并更新我的 ProjectA.gwt.xml 以继承该 jar。

所以我将 jar 文件包含在项目 A 中。但是项目 B 无法识别 jar 中的类。所以我继续执行以下步骤

1) 右键单击​​项目 A 并选择构建路径 2)单击配置构建路径 3)订购并导出jar文件

然后这样做之后,我的项目B可以编译JAR文件中使用的类。但是在运行时它崩溃了。它无法识别JAR文件中的类。

谁能告诉我该怎么做? 请为我提供使用/不使用 MAVEN 的解决方案。我更喜欢不使用 MAVEN。

谢谢

I have two GWT projects Project A and Project B.The dependencies of these projects are taken care by MAVEN.Project B depends on Project A ,and this part is already taken care of.

Now i need to add an external Jar into Project A.I do not want to use Maven for this .I just want to add the external jar file into Project A and update my ProjectA.gwt.xml to inherit the jar.

So i included the jar file in Project A.But Project B was not recognizing the classes in the jar.So i went ahead and followed the following steps

1) Right Clicked on Project A and selected Build Path
2) Click on Configure Build Path
3) Order and Export the jar file

Then after doing so ,my Project B could compile the classes used from the JAR file.But at Runtime its crashing.Its not able to recognize the classes from the JAR file.

Can anyone provide me what to do on this?
Please provide me solution with/without using MAVEN.I would prefer without using MAVEN.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

歌入人心 2024-10-16 22:29:47

我认为你应该将所有依赖管理保留在 Maven 中。

Eclipse Maven 插件管理 Eclipse 项目的构建路径配置,不应手动修改它。

您可以使用此配置将外部库添加到存储库:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    <version>2.3</version>
    <executions>
        <execution>
            <id>deploy-on-local-repo1</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>install-file</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
                <file>src/your-librairie.jar</file>
                <groupId>com.yourlibrairiegroupID</groupId>
                <artifactId>librairie-name</artifactId>
                <version>1.0</version>
                <packaging>jar</packaging>
                <generatePom>true</generatePom>
            </configuration>
        </execution>
    </executions>
</plugin>

希望它能解决您的问题。

I think you should keep all the dependency management in Maven.

The Eclipse Maven plugin manage the Build Path Configuration of your Eclipse project, it should be not modified manually.

You could use this configuration to add external librairies to the repository :

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    <version>2.3</version>
    <executions>
        <execution>
            <id>deploy-on-local-repo1</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>install-file</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
                <file>src/your-librairie.jar</file>
                <groupId>com.yourlibrairiegroupID</groupId>
                <artifactId>librairie-name</artifactId>
                <version>1.0</version>
                <packaging>jar</packaging>
                <generatePom>true</generatePom>
            </configuration>
        </execution>
    </executions>
</plugin>

Hope it will fix your problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文