- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个开发的应用程序,我只是想让构建过程变得简单。父级的 POM 文件如下所示:
<parent>
<groupId>com.shc.obu.ca</groupId>
<artifactId>shcobuca-pom</artifactId>
<version>1.1.0</version> </parent>
<groupId>com.shc.obu.ca.osol</groupId> <artifactId>apps-pom</artifactId> <version>${currVersion}</version> <packaging>pom</packaging> <name>Outlet Apps</name>
<scm>
<connection>scm:svn:https://ushofsvpsvn2.intra.searshc.com/svn/outlet/outlet/trunk/apps</connection>
<developerConnection>scm:svn:https://ushofsvpsvn2.intra.searshc.com/svn/outlet/outlet/trunk/apps</developerConnection> </scm>
<profiles>
<profile> <id>www</id>
<activation> <activeByDefault>true</activeByDefault> </activation>
<modules>
<module>www</module>
<module>modules</module>
</modules>
</profile>
<profile>
<id>mts</id>
<activation> <activeByDefault>true</activeByDefault> </activation>
<modules>
<module>mts</module>
<module>modules</module>
</modules>
</profile>
<profile> <id>search</id>
<activation> <activeByDefault>true</activeByDefault> </activation>
<modules>
<module>modules</module>
<module>search</module>
</modules>
</profile> </profiles>
<repositories>
<repository>
<id>obu.ca.repo.release</id>
<snapshots><enabled>false</enabled></snapshots>
<url>http://maven.cal.intra.sears.com/release</url>
</repository>
<repository>
<id>obu.ca.repo.snapshot</id>
<releases><enabled>false</enabled></releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:5</updatePolicy>
</snapshots>
<url>http://maven.cal.intra.sears.com/snapshot</url>
</repository> </repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<env>trunk</env>
<currVersion>1.2.0</currVersion> </properties> </project>
该文件显示它具有三个配置文件,这三个配置文件基本上是独立的子项目。我将 cargo 插件添加到该文件中,如下所示:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<home>
C:\tools\apache-tomcat-6.0.26
</home>
</container>
<configuration>
<properties>
<cargo.servlet.port>
8082
</cargo.servlet.port>
<cargo.jvmargs>
"-Xdebug" "-Xrunjdwp:transport=dt_socket,address=4646,server=y,suspend=n"
</cargo.jvmargs>
</properties>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
但是当我运行“mvn Cargo:start”时,tomcat 实例运行良好,但没有部署任何子应用程序。有没有办法让我的第一个子应用程序 (www)(生成一个名为 www-webapp-1.2.0.war 的 war 文件)自动部署?
更新:谢谢帕斯卡。我尝试修改构建标签如下:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<home>
C:\tools\apache-tomcat-6.0.26
</home>
</container>
<configuration>
<properties>
<cargo.servlet.port>
8082
</cargo.servlet.port>
<cargo.jvmargs>
"-Xdebug" "-Xrunjdwp:transport=dt_socket,address=4646,server=y,suspend=n"
</cargo.jvmargs>
</properties>
<deployables>
<deployable>
<groupId>com.shc.obu.ca.osol</groupId>
<artifactId>www-webapp-1.2.0</artifactId>
<type>war</type>
<properties>
<context>acontext</context>
</properties>
</deployable>
</deployables>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
但是仍然不起作用。它给出的构建错误如下:
Artifact [com.shc.obu.ca.osol:www-webapp-1.2.0:war] 不是项目的依赖项。我也尝试了“www-webapp”和“www”作为工件 ID,但错误仍然相同。
当我将相同的内容添加到依赖标记时,它会给出某种循环引用错误,如下所示:“ react 器中的项目包含循环引用”
最佳答案
您需要列出您的www
module 作为部署在 <deployable>
内的模块元素。来自 Maven2 Plugin Reference Guide :
If no deployable is specified and the project's packaging is war, ear or ejb and there is no deployer specified then the generated artifact is added automatically to the list of deployables to deploy
由于您的项目有 packaing
类型 pom
,它不是部署的候选者,并且没有部署任何内容。
这是一个例子:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<home>C:\tools\apache-tomcat-6.0.26</home>
</container>
<configuration>
<properties>
<cargo.servlet.port>8082</cargo.servlet.port>
<cargo.jvmargs>
"-Xdebug" "-Xrunjdwp:transport=dt_socket,address=4646,server=y,suspend=n"
</cargo.jvmargs>
</properties>
<deployables>
<!-- application to deploy -->
<deployable>
<groupId>com.acme</groupId>
<artifactId>mywebapp</artifactId>
<type>war</type>
<properties>
<context>acontext</context>
</properties>
</deployable>
</deployables>
</configuration>
</configuration>
</plugin>
更新:
(...) It's giving build error as below
Artifact [com.shc.obu.ca.osol:www-webapp-1.2.0:war] is not a dependency of the project. I tried 'www-webapp' and 'www' as artifact id as well but the error remained the same.
我忘了这一点,但看起来 Cargo 期望 deployable
成为启动 Cargo 的项目的依赖项。
And when I add the same to dependency tags, it gives some kind of cyclic reference error as below: 'The projects in the reactor contain a cyclic reference'
这很正常。工件不能是给定项目的子模块和依赖项,否则您将获得循环依赖项(您需要一个依赖项来构建模块,这就是依赖项,先有鸡还是先有蛋的问题)。
我的建议是将 cargo 配置移至www
模块或为功能测试创建专用模块(这通常是我所做的)并声明 www
作为该模块的依赖项。
关于maven-2 - 如何使用 cargo :start using maven部署特定的子项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3179181/
如何禁用 cargo update或 cargo build试图访问 github.com;但仍然从 crates.io 下载适当的包 我的cargo.toml 中只有一个依赖项 [dependenc
Cargo README陈述如下: Compiling from Source Cargo requires the following tools and packages to build: py
如何禁止 cargo update 或 cargo build 尝试访问 github.com;但仍然从 crates.io 下载合适的包 我的 cargo.toml 中只有一个依赖项 [depend
cargo install 说: error: failed to write /tmp/rustcaq37XH/lib.rmeta: No space left on device (os erro
我不知道为什么这两种情况下的行为相同 最佳答案 找到答案。 cargo init 没有 args 按预期工作:创建文件当前位置。 cargo init 带有 args 的行为类似于 cargo new
我在 VS 代码终端中使用命令 (Cargo run) 运行 Cargo 时遇到了这个问题。我的电脑是 32 位的。 我也尝试使用这个命令分别运行和编译 main.rs 文件,但编译时出现同样的错误。
我编译了 Rust GTK examples这样: $ cargo build --features gtk_3_10 当我尝试运行示例时,出现错误: $ cargo run --bin gtk
我正在尝试使用 CI 构建和测试我的 Rust 代码,我想知道 cargo clippy(可能带有选项)是否涵盖了 cargo check 的所有内容做。我只需要运行 cargo clippy,还是需
我想在我的 Cargo 包裹中捆绑一个纯文本格式的单词列表。我可以编辑 Cargo.toml 来执行此操作吗? 如果我使用 npm,我会将其添加到我的 package.json 中: "files":
现在我有一个包含三个成员的 Cargo 工作区。 [workspace] members = [ "foo", "bar", "baz", ] 如果我在根目录中运行 cargo
我正在学习 Rust 入门,我需要获得 the rand crate在我的系统上。我没有做 Cargo 包装的事情(例如创建 Cargo.toml),因为我对语言感兴趣,而不是包装。 我可以在我的系统
在 cargo check 重新编译许多(但不是全部)依赖项之后立即 cargo build 的可能原因是什么? cargo .toml [package] name = "greeter" vers
cargo 功能允许conditional compilation , 因此最终构建将只包含特定的功能组,最终用户可以过滤这些功能。 现在,根据库 crate 的复杂性,您可能会以形成依赖树的几个功能
所以我有一项任务,要求我编程并创建 cargo ID 并更新每个新订单的状态。 cargo ID:这应该是使用以下简单算法自动生成的唯一编号。 • 使用数字“1939”作为第一个 cargo ID。下
假设我想通过 rust-clippy 对我的所有代码进行 lint。现在,我必须写 #![feature(plugin)] #![plugin(clippy)] 在我的每个来源中。我可以以某种方式配置
集成pom.xml看起来像 org.apache.maven.plugins maven-failsafe-plugin
我正在尝试克隆 SFML github repo在我的本地项目目录中并使用 build.rs Cargo 解决方案构建它,我收到此错误: Could not find Cargo.toml 我没有找到
我创建了一个简单的 hello world 程序: fn main() { println!("Hello, world"); } 当使用 rustc 与 cargo build 编译代码时,
我有一个项目,其中包含一些相关 Assets (Lua 脚本),我需要在运行时找到这些 Assets 。这可能意味着两件事: 在开发过程中(例如cargo run),我想找到它相对于源 当通过 car
我正在尝试使用 cargo 插件在 tomcat8 上部署 war 我的条目如下: org.codehaus.cargo cargo-maven
我是一名优秀的程序员,十分优秀!