首页 \ 问答 \ 如何让Maven构建版本从不变(How to make maven build take version from constant)

如何让Maven构建版本从不变(How to make maven build take version from constant)

我有一个多模块项目。 我已经在pom.xml中引入了一个属性app.version ,而不是版本中的任何版本:版本标记和模块部分中的依赖项。

我在哈德逊环境中使用maven 3.1.1。

${app.version}替换写入的值(1.6.0-SNAPSHOT)后,真正通过的构建顺序没有出错。

是什么导致了这个问题

我从一开始就得到了这些警告,可能会有影响吗?

[WARNING] Some problems were encountered while building the effective model     for com.mycompany.project:project-module:jar:2.4.0
[WARNING] 'version' contains an expression but should be a constant. @ com.mycompany.project:project-module:${app.version}, /var/lib/hudson/jobs/myJob TRUNK Maven/workspace/project-module/pom.xml, line 20, column 11

我需要解析太多的pom.xml:s,所以层次结构如下,我给它:

main_pom
  |
   --- modules
  |      |
  |       --- all other modules
   --- test        |
                     module A
                   |   |
                   |    module B
                     module C

我给哈德森从main_pom开始。 它最后处理main_pom。 为什么? 它从所有其他模块部分中的随机一个开始,构建其他模块,然后是模块,测试和main_pom。 为什么这个疯狂的命令?

失败在模块A中。它首先构建而不是模块B.

正确的顺序是从main_pom - >模块B - >模块A等开始,但它直接从模块A开始。

编辑:

我的pom.xmls具有以下结构:

 <parent>
    <groupId>com.mycompany.project</groupId>
    <artifactId>modules or parent_pom</artifactId>
    <version>${app.version}</version>
    <relativePath>../modules or parent_pom</relativePath>
 </parent>

<dependency>
    <groupId>com.mycompany.project</groupId>
    <artifactId>some other module</artifactId>
    <version>${app.version}</version>
</dependency>

I have a multi module project. I have introduced a property app.version which I use instead of version everywhere in the pom.xml: in version tag and in dependencies in modules part.

I use maven 3.1.1 in Hudson environment.

After substituting written values (1.6.0-SNAPSHOT) with ${app.version}, the build order that really goes through without error, is gone.

What caused the issue?

I got these kind of warnings in the begin, may it affect?

[WARNING] Some problems were encountered while building the effective model     for com.mycompany.project:project-module:jar:2.4.0
[WARNING] 'version' contains an expression but should be a constant. @ com.mycompany.project:project-module:${app.version}, /var/lib/hudson/jobs/myJob TRUNK Maven/workspace/project-module/pom.xml, line 20, column 11

I would need to parse too much the pom.xml:s, so the hierarchy is like follows, I give it:

main_pom
  |
   --- modules
  |      |
  |       --- all other modules
   --- test        |
                     module A
                   |   |
                   |    module B
                     module C

I give for hudson to start from main_pom. It handles main_pom as last. Why? It starts now from random one in all other modules part, builds the others, then modules, test and main_pom. Why this insane order?

The fail is in module A. It builds that first and not module B.

Correct order would be to start from main_pom -> module B -> module A etc but it starts directly from module A.

Edit:

My pom.xmls have the following structure:

 <parent>
    <groupId>com.mycompany.project</groupId>
    <artifactId>modules or parent_pom</artifactId>
    <version>${app.version}</version>
    <relativePath>../modules or parent_pom</relativePath>
 </parent>

<dependency>
    <groupId>com.mycompany.project</groupId>
    <artifactId>some other module</artifactId>
    <version>${app.version}</version>
</dependency>

原文:https://stackoverflow.com/questions/40907845
更新时间:2023-09-04 22:09

最满意答案

GitHub当前的开发版本显然是Python 3兼容的(Python 3.5及更高版本)。

安装它:

pip3 install git+https://github.com/webpy/webpy#egg=web.py

20166月起 ,该项目使用Travis进行持续集成, 并已配置Python 3.5为每次提交运行测试套件。


The web.py project is now publishing a pre-release version to PyPI that is Python 3 compatible; install it with:

pip install web.py==0.40-dev1

as outlined in their Getting Started section. You can also install the latest pre-release with

pip install --pre web.py

These releases are Python 3 compatible (Python 3.5 and up).

You can also install the current GitHub under-development codebase with:

pip3 install git+https://github.com/webpy/webpy#egg=web.py

The project uses Travis for continuous integration has configured Python 3.5 to run the test suite for each commit, since June 2016; the configuration has since been updated regularly to add new Python 3.x releases.

相关问答

更多
  • help> web Help on package web: NAME web - web.py: makes web apps (http://webpy.org) PACKAGE CONTENTS application browser contrib (package) db debugerror form http httpserver net py3helpers session template test utils webapi webopenid wsgi wsgiserver (packa ...
  • GitHub当前的开发版本显然是Python 3兼容的(Python 3.5及更高版本)。 安装它: pip3 install git+https://github.com/webpy/webpy#egg=web.py 自2016年6月起 ,该项目使用Travis进行持续集成, 并已配置Python 3.5为每次提交运行测试套件。 The web.py project is now publishing a pre-release version to PyPI that is Python 3 comp ...
  • 我把它变成了一个多 处理过程,并从生成的进程中为子 进程执行p.wait() ,并且生成的进程负责其余的步骤并将结果更新到数据库中。 web.py进度页面将在数据库中检查执行进度,从而解决了问题。 码: from multiprocessing import Process class ProcHandler(Process): def __init__(self, *args, **kwargs): #Initialize Process.__init__(s ...
  • web.ctx.env结构使您可以访问WSGI环境变量 。 在WSGI应用程序中,内容类型标题被命名为CONTENT_TYPE : ct = web.ctx.env.get('CONTENT_TYPE') The web.ctx.env structure gives you access to the WSGI environment variable. In WSGI apps, the content type header is named CONTENT_TYPE: ct = web.ctx.e ...
  • 你有没有使用fastcgi的原因? 这可能比尝试使用一些高编号的端口好得多,特别是因为您的网络主机可能不会很满意。 在这篇文章中有一些关于这样做的注释(在dreamhost上,但它应该与你类似): http://thefire.us/archives/261 Is there a reason you're not using fastcgi? That's probably considerably better than trying to use some high-numbered port, pa ...
  • 我找到了答案! 我添加到这个字符串: '/(js|css|img)/(.*)', 'static', /( '/(js|css|img)/(.*)', 'static', 类静态实现较早。 这门课相似: class static: def GET(self, media, file): try: f = open(media+'/'+file, 'r') return f.read() except: ...
  • 在dict中添加函数并作为globals参数传递给render: render = web.template.render('templates/', globals={'sum': sum}) 然后在您的模板中,您可以使用它: $def with (numbers)

    Numbers add to $sum(numbers)

    Add the functions in a dict and pass as the globals argument to render: render = ...
  • 看起来您没有安装auth模块。 我假设您正在尝试使用http://jpscaletti.com/webpy_auth/上的auth模块。 您没有说明是通过easy_install安装web.py还是在下载tarball后运行setup.py。 在任何一种情况下,我都建议你: 找到web.py安装文件夹 从上面的链接下载auth模块,并将内容解压缩到web.py安装文件夹的contrib /文件夹中 It looks like you do not have the auth module installed ...
  • 接下来: http : //edvanbeinum.com/how-to-install-and-configure-supervisord我可以用supervisord轻松完成 Following this: http://edvanbeinum.com/how-to-install-and-configure-supervisord I can easily do it with supervisord
  • 解决方案! 在Apache配置中,我需要将AllowEncodedSlashes指令添加到NoDecode值。 请参阅https://httpd.apache.org/docs/2.2/fr/mod/core.html#allowencodedslashes Solution found ! Into Apache configuration, I need to add the AllowEncodedSlashes directive to NoDecode value. See https://htt ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)