问题列表 - 第12591页

Maven-assembly-plugin:自定义jar文件名

我使用程序集插件创建了几个包含一些类的jar.我需要生成的罐子的自定义名称:app_business.jar app_gui.jar core.jar等.

目前我必须遵循以下配置:

    <plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
        <appendAssemblyId>false</appendAssemblyId>
    <finalName>app_business</finalName>
        <descriptors>
            <descriptor>assembly.xml</descriptor>
        </descriptors>
        <attach>true</attach>
    </configuration>
    <executions>
        <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
                <goal>single</goal>
            </goals>
        </execution>
    </executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

一个assembly.xml文件:

    <assembly>
      <id>app_business</id>
      <formats>
        <format>jar</format>
      </formats>
      <baseDirectory>target</baseDirectory>
      <includeBaseDirectory>false</includeBaseDirectory>

      <fileSets>
        <fileSet>
          <directory>${project.build.outputDirectory}</directory>
          <outputDirectory></outputDirectory> 
          <includes>
            <include>org/xyz/**</include>
          </includes>
        </fileSet>    
      </fileSets>
    </assembly>
Run Code Online (Sandbox Code Playgroud)

这会创建一个完美的文件app_business.jar.但我不知道如何创建我的其他文件.选项appendAssemblyId对我没有帮助,因为它以AppName-app_business.jar格式创建文件名.我真的需要确切的文件名app_business.jar.

任何的想法?非常感谢你!

maven-2 assemblies jar

16
推荐指数
2
解决办法
2万
查看次数

如何在Windows上编写脚本/批处理文件?

我正在使用一台我没有管理员权限的机器,我需要在JAVA_HOME每次启动时设置.

因此,我想编写一个classpath自动设置所需的脚本.
我该怎么做呢?

windows shell macros scripting cmd

1
推荐指数
1
解决办法
1392
查看次数

如何在Perl中找到Unicode字符串的长度?

length()perldoc页面告诉我,我应该使用以字节为单位查找Unicode字符串,或者字节页面回应它.bytes::length(EXPR)

use bytes;
$ascii = 'Lorem ipsum dolor sit amet';
$unicode = 'Lørëm ípsüm dölör sît åmét';

print "ASCII: " . length($ascii) . "\n";
print "ASCII bytes: " . bytes::length($ascii) . "\n";
print "Unicode: " . length($unicode) . "\n";
print "Unicode bytes: " . bytes::length($unicode) . "\n";
Run Code Online (Sandbox Code Playgroud)

但是,此脚本的输出不同于该联机帮助页:

ASCII: 26
ASCII bytes: 26
Unicode: 35
Unicode bytes: 35
Run Code Online (Sandbox Code Playgroud)

在我看来,length()和bytes :: length()对于ASCII和Unicode字符串都返回相同的值.我的编辑器设置默认将文件写为UTF-8,所以我认为Perl将整个脚本解释为Unicode,这意味着length()会自动正确处理Unicode字符串吗?

编辑:看我的评论; 我的问题没有多大意义,因为在上面的例子中,length()不能正常工作 - 它以字节为单位显示Unicode字符串的长度,而不是字符.我最初偶然发现的共鸣是一个程序,我需要在HTTP消息中设置Content-Lenth头(以字节为单位).我已经阅读了Perl中的Unicode,并且期望必须做一些有意义的工作,但是当length()完全返回我需要的蝙蝠时,我很困惑!见接受的答案对的概述use utf8,use bytes以及 …

unicode perl utf-8

12
推荐指数
2
解决办法
8894
查看次数

仅更新mysql DateTime字段中的时间

如何只更新MySQL中已存在的DateTime字段中的时间?我希望日期保持不变.

mysql sql

34
推荐指数
5
解决办法
4万
查看次数

Firebird别名

我使用Delphi和Firebird 1.5开发了一个应用程序,其中服务器与应用程序位于同一台机器上.我现在正在将应用程序部署到另一个站点,其中Firebird服务器(Superserver)在一台计算机(NT4)上运行,而客户端在另一台计算机上运行.

如果我在application(t:\db\cinema.gdb)中包含限定路径,应用程序可以连接到数据库,但我自然希望使用别名,以便相同的代码可以在我的开发机器上(使用本地服务器).

那么,有两个问题:

  1. "aliases.conf"文件应该放在哪里 - 在每台机器上连同应用程序,还是在服务器上?
  2. 别名应该是什么?cinema = t:\db\cinema.gdb,假设数据库位于映射驱动器上?cinema = 192.168.2.121:f:firebird\db\cinema.gdb,使用服务器的IP地址和服务器看到的数据库的路径?

delphi firebird aliases

3
推荐指数
1
解决办法
2162
查看次数

什么是管理模块(与装配相比)?

什么是.NET中的托管模块?它与Assemblies有何不同?PE文件(例如test.dll)是托管模块还是程序集?汇编/托管模块如何与磁盘上的物理文件相对应?

.net c#

17
推荐指数
1
解决办法
8030
查看次数

C#Winforms消息框属性

在C#winforms中,当我们显示一个消息框时,它在标题栏中没有标题,并且在任务栏的按钮中没有标题.

如果我想为消息框设置标题和图标该怎么办?

一个选项是创建一个出现的表单,其行为就像一个消息框,我可以在需要时显示和隐藏它.是的,可以做但我想修改"MessageBox"

c# properties messagebox title winforms

10
推荐指数
1
解决办法
5万
查看次数

如何禁用浏览器或元素滚动条,但仍允许使用滚轮或箭头键滚动?

我想隐藏我的div元素和我的整个滚动条body,但仍然让用户使用鼠标滚轮或箭头键滚动.如何使用原始JavaScript或jQuery实现这一目标?有任何想法吗?

javascript css browser jquery scrollbar

52
推荐指数
5
解决办法
4万
查看次数

正确公开List <T>?

我知道我不应该暴露一个List<T>属性,但我想知道这样做的正确方法是什么?例如,这样做:

public static class Class1
{
    private readonly static List<string> _list;

    public static IEnumerable<string> List
    {
        get
        {
            return _list;
            //return _list.AsEnumerable<string>(); behaves the same
        }
    }

    static Class1()
    {
        _list = new List<string>();
        _list.Add("One");
        _list.Add("Two");
        _list.Add("Three");
    }
}
Run Code Online (Sandbox Code Playgroud)

允许我的来电者简单地回到List<T>:

    private void button1_Click(object sender, EventArgs e)
    {
        var test = Class1.List as List<string>;
        test.Add("Four"); // This really modifies Class1._list, which is bad™
    }
Run Code Online (Sandbox Code Playgroud)

所以,如果我想要一个真正不可变的List<T>,我总是要创建一个新的列表?例如,这似乎有效(测试在转换后为null):

    public static IEnumerable<string> List
    {
        get
        {
            return new ReadOnlyCollection<string>(_list); …
Run Code Online (Sandbox Code Playgroud)

.net c#

12
推荐指数
2
解决办法
2599
查看次数

Rails 2.3.3 - 设置为生产模式

如何将应用程序设置为生产模式?

好吧,这一定是不费脑子的,但我要部署我的第一个Rails应用程序,我已经正确设置了一切:Ubuntu Hardy,Passenger,MySQL.但是,它仍然在开发模式下运行.我只能找到旧版本Rails的文档,并希望确保我做得对.

提前致谢.

mysql production ruby-on-rails passenger

6
推荐指数
2
解决办法
7674
查看次数