标签: maven-3

下载jboss-messaging时出现Maven错误

您可以在编译我尝试使用JBoss AS运行的EJB示例时看到以下错误.

从错误中我可以理解指定的存储库URL是错误的.我没有得到的是如何找到这个URL的来源?此URL是否存储在我的存储库/项目中的任何现有POM文件中?

工件版本也是"$ {version.jboss.messaging}".这有点奇怪,我无法找出这个版本的指定位置?

这里需要一些帮助.

[错误]无法在项目上执行目标jboss-ejb3-examples-ch04-firstejb:无法解析项目的依赖项org.jboss.ejb3.examples:jboss-ejb3-examples-ch04-firstejb:jar:1.1.0-SNAPSHOT :无法收集[org.jboss.ejb3:jboss-ejb3-api:jar:3.1.0-Alpha1(compile),junit:junit:jar:4.8(compile),org.jboss.logging:jboss-logging的依赖项-log4j:jar:2.0.6.GA(compile),org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA(compile),org.jboss.arquillian.container:arquillian-openejb-embedded -3.1:jar:1.0.0.Alpha5(test),org.jboss.arquillian:arquillian-junit:jar:1.0.0.Alpha5(test),org.apache.openejb:openejb-core:jar:3.1.4 (test),javax.inject:javax.inject:jar:1(test),org.jboss.jbossas:jboss-as-profileservice-client:pom:6.0.0.Final(compile),org.jboss.arquillian. container:arquillian-jbossas-remote-6:jar:1.0.0.Alpha5(compile),org.jboss.jbossas:jboss-as-client:pom:6.0.0.M1(compile)]:

Failed to read artifact descriptor for jboss.messaging:jboss-messaging:jar:${version.jboss.messaging}: Could not transfer artifact jboss.messaging:jboss-messaging:pom:${version.jboss.messaging} from/to repository.jboss.org (http://repository.jboss.org/maven2):拒绝访问:http://repository.jboss.org/maven2/jboss/messaging/jboss-messaging/ $ {version.jboss.messaging}/jboss-messaging - $ {version.jboss.messaging} .pom - > [帮助1]


这是我在POM中的存储库元素:

<repositories>
    <repository>
        <id>jboss-public-repository-group</id>
        <name>JBoss Public Maven Repository Group</name>
        <url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
        <layout>default</layout>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
        </snapshots>
    </repository>
    <repository>
        <id>jboss-deprecated-public-repository-group</id>
        <name>JBoss Deprecated Public Maven Repository Group</name>
        <url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url>
        <layout>default</layout>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
        </snapshots>
    </repository>
</repositories>
Run Code Online (Sandbox Code Playgroud)

jboss repository maven-3 maven

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

在java和nsis代码中使用maven的"version"属性

我们需要java代码和NSIS安装程序脚本中的maven项目的软件版本号.遵循DRY原则,版本号应仅存储在maven pom中.在Java代码和NSIS脚本中获取此版本号的最佳方法是什么?当然,应该分发版本号的更新,而开发人员不必关心它.

当前的方法:只要需要版本号,就会插入$ {"versionNr"}作为替代.然后,在maven构建阶段,过滤所有java和NSIS源文件,并将密钥替换为版本号.为避免更改已签入的源代码,过滤后的文件实际上会复制到不在scm内的其他位置.原始源和maven过滤源会导致很多混乱,我想避免.

任何提示?

java nsis maven-3

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

Maven - 将代码移动到新工件; 传递依赖问题

这是我的情况:

  • 我在名为"web-ng-framework"的库中创建了一个新工件,并将代码从库中的旧工件"web"移入其中.
  • 我删除了'web'工件

这是问题所在:

  • ProjectA使用旧版本的库,因此它对'web'具有编译依赖性
  • ProjectB依赖于ProjectA
  • ProjectB使用最新版本的库,因此在构建ProjectB时,它包含'web'和'web-ng-framework'库,导致可能的冲突

有谁知道我怎么解决这个问题?谢谢!


编辑:

将'web''重新定位'到'web-ng-framework'可能会更好吗?在ProjectA中,我可以包含对'web'的依赖,以便Maven看到它真正需要的是'web-ng-framework'.那会有用吗?

java maven-3 maven

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

强制实施Maven皮肤依赖

我想在我的Maven项目中使用Fluido皮肤.如果我只是将它添加src/site/site.xmlmvn site失败,因为神器下落不明.它要求手动安装工件,但我想避开同事的那一步.

我已将以下依赖项添加到我的pom.xml:

<dependency>
  <groupId>org.apache.maven.skins</groupId>
  <artifactId>maven-fluido-skin</artifactId>
  <version>1.2.2</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

它似乎有效:当我这样做时,皮肤会被maven自动下载mvn site.但是我不希望我的项目被标记为该工件的依赖项; 我不希望在编译,测试等过程中该包在类路径中.

我没有看到任何依赖范围会限制依赖性site:site.

我是否错过了依赖范围?对这种关系使用依赖是正确的吗?

java dependencies skin maven-3 maven

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

Spring Security 3.0.3.RELEASE:ArtifactTransferException:无法传输

以下是解决依赖关系时spring spring 3的错误:

Multiple annotations found at this line:
    - Missing artifact org.springframework.security:org.springframework.security.web:jar:3.0.3.RELEASE
    - ArtifactTransferException: Failure to transfer 
     org.springframework.security:org.springframework.security.web:jar:3.0.3.RELEASE from http://
     repository.springsource.com/maven/bundles/release was cached in the local repository, resolution will not be 
     reattempted until the update interval of com.springsource.repository.bundles.release has elapsed or updates are 
     forced. Original error: Could not transfer artifact org.springframework.security:org.springframework.security.web:jar:
     3.0.3.RELEASE from/to com.springsource.repository.bundles.release (http://repository.springsource.com/maven/
     bundles/release): connection timed out to http://repository.springsource.com/maven/bundles/release/org/
     springframework/security/org.springframework.security.web/3.0.3.RELEASE/
     org.springframework.security.web-3.0.3.RELEASE.jar
Run Code Online (Sandbox Code Playgroud)

以下是我的pom文件中定义的spring security 3依赖项的方法:

        <!-- Spring Security dependencies -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>org.springframework.security.acls</artifactId>
            <version>${spring.security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>org.springframework.security.config</artifactId> …
Run Code Online (Sandbox Code Playgroud)

spring spring-security pom.xml maven-3

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

maven - 在EAR打包时不要在/ lib之外复制项目jar

包装EAR时会发生这种情况

我的pom.xml打包了ear文件,它应该包含projectA.jar文件和/ lib文件夹之外的projectB.war.显然,projectA.jar文件正在/ lib文件夹里面,这不应该是.我有我的application.xml,它告诉我们这两个项目应该在lib之外.

问题:我如何指示maven不将projectA.jar捆绑在/ lib文件夹中,而是将其捆绑在/ lib文件夹之外?

我的EAR结构应该是:

MyWebEAR

\lib
\META-INF
projectA.jar
ProjectB.war
Run Code Online (Sandbox Code Playgroud)

下面是我的pom.

<dependencies>
    <dependency>
        <groupId>com.xxx.sms</groupId> 
        <artifactId>projectA</artifactId> 
        <version>1.0-SNAPSHOT</version>             
    </dependency>
    <dependency>
        <groupId>com.xxx</groupId>
        <artifactId>projectB</artifactId>
        <version>1.0-SNAPSHOT</version>
        <type>war</type>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <defaultLibBundleDir>lib</defaultLibBundleDir>
                <earSourceDirectory>${basedir}</earSourceDirectory>
                <earSourceIncludes>META-INF/*</earSourceIncludes>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                    </manifest>
                </archive>
                <generateApplicationXml>false</generateApplicationXml>
                <applicationXML>${basedir}/META-INF/application.xml</applicationXML>
            </configuration>
        </plugin>
    </plugins>
    <finalName>MyWebEAR</finalName>
</build>
Run Code Online (Sandbox Code Playgroud)

谢谢你的时间.

maven-3 maven maven-ear-plugin

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

maven-war-plugin不使用maven3,'warSourceExcludes'属性出错

当我用maven2运行我的工作时一切正常,但是使用maven 3(3.0.3)我得到的错误.请注意,我没有在任何地方定义'warSourceExcludes'属性

message : Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.0:war (default-war) on project specific-admin: Unable to parse configuration of mojo org.apache.maven.plugins:maven-war-plugin:2.0:war: When configuring a basic element the configuration cannot contain any child elements. Configuration element 'warSourceExcludes'.
cause : Unable to parse configuration of mojo org.apache.maven.plugins:maven-war-plugin:2.0:war: When configuring a basic element the configuration cannot contain any child elements. Configuration element 'warSourceExcludes'.
Stack trace : 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.0:war (default-war) on project specific-admin: Unable to parse configuration of mojo org.apache.maven.plugins:maven-war-plugin:2.0:war: When …
Run Code Online (Sandbox Code Playgroud)

maven-3

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

没有从context.xml文件中的属性文件获取值

我无法从.properties文件中检索到我的值context.xml

pom.xml(没有提到依赖项)

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>


    <groupId>com</groupId>
    <artifactId>myproj</artifactId>
    <version>0.1.1</version>
    <packaging>war</packaging>

    <name>myproj</name>
    <url>http://maven.apache.org</url>

    <profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <env>dev</env>
                <build.number>0</build.number>
                <svn.revision.number>0</svn.revision.number>
            </properties>
        </profile>

    </profiles>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>

            </resource>
            <resource>
                <directory>src/main/environment</directory>
                <filtering>false</filtering>

            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <version>1.0-alpha-2</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                    <printSummary>false</printSummary>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <excludes>
                        <exclude>**/*_Roo_*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2.1</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId> …
Run Code Online (Sandbox Code Playgroud)

maven-2 maven-plugin pom.xml maven-3 maven

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

不同的Maven配置文件的不同持久性单元

我想根据所选的Maven配置文件使用两个不同的数据库.对于配置文件"生产",我想使用MySQL数据库,对于"开发"配置文件,我想使用内存中的HSQLDB.

我发现可以有两个persistence.xml文件.一个在"src/main/resources/META-INF"中,另一个存储在"src/test/resources/META-INF"中.这样就可以选择不同的数据库进行测试.

但是,是否也可以根据所选的Maven配置文件进行数据库选择?

database-connection persistence.xml java-ee maven-3 maven-profiles

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

java.util.zip.ZipException:打开zip文件时出错,tomcat

我的项目正在运作,但我不知道发生了什么.我在运行应用程序时遇到此问题:

Avertissement: Failed to scan JAR [file:/C:/Users/TOSHIBA/Desktop/Nouveau%20dossier%20(3)/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/1-BaseAppMaven/WEB-INF/lib/scala-library-2.10.4.jar] from WEB-INF/lib
java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
    at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
    at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
    at org.apache.tomcat.util.scan.FileUrlJar.<init>(FileUrlJar.java:41)
    at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:34)
    at org.apache.catalina.startup.ContextConfig$FragmentJarScannerCallback.scan(ContextConfig.java:2615)
    at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:258)
    at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:177)
    at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1871)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1259)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown …
Run Code Online (Sandbox Code Playgroud)

eclipse java-ee maven-3 maven

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