English 中文(简体)
无法从Jbos仓库中收回依赖
原标题:Cannot retrieve dependency from Jboss repository

I made an EJB 3.0 and a client. This is the pom for my EJB:

  <repositories>
    <repository>
      <id>Jboss</id>
      <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>javax</groupId>
      <artifactId>javaee-api</artifactId>
      <version>6.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.ejb3</groupId>
      <artifactId>jboss-ejb3-ext-api</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.jboss.ejb3</groupId>
      <artifactId>jboss-ejb3-ext-api-impl</artifactId>
      <version>1.0.0</version>
    </dependency>
  </dependencies>

But jboss-ejb3-ext-api and it s implementation cannot be retrieved :/ eclipse is telling me :

The container Maven Dependencies references non existing library C:usrlocalm2-repositoryorgjbossejb3jboss-ejb3-ext-api1.0.0jboss-ejb3-ext-api-1.0.0.jar MyFirstMavenEjb

In my client I just added "jnp-client", and there is not problem about retrieving this one.
Any idea why I can t retrieve those 2 jars?
Thanks.

EDIT
I need this class: "org.jboss.ejb3.annotation.RemoteBinding" To use the @RemoteBinding.

Edit 2 : solution after doing some "mvn clean install" in cmd I saw that maven was trying to download some transitie dependency..... FROM THE OLD JBOSS REPO. since it was denied acces it just stopped before downloading the final .jar

“forbidden

加上以下的排他性解决了这一问题(拒绝提供治标)。

<exclusions>
<exclusion>
<groupId>gnu-getopt</groupId>
<artifactId>getopt</artifactId>
</exclusion>
<exclusion>
<groupId>apache-xerces</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>apache-xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>wutka-dtdparser</groupId>
<artifactId>dtdparser121</artifactId>
</exclusion>
<exclusion>
<groupId>sun-jaxb</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
</exclusions>

However isn t there a better solution? I m guessing that it s trying to get stuff from the old repo because this jar is not used anymore and a new one must be popular.

最佳回答

I found a better solution, In fact this repository is depreciated, meaning jboss managment don t want you to use what s in it anymore.

如果你给你的晚间环境增添一个形象,可以允许他查阅这本邮袋。

加入:

<profile>
  <id>jboss-deprecated-repository</id>
  <repositories>
    <repository>
      <id>jboss-deprecated-repository</id>
      <name>JBoss Deprecated Maven Repository</name>
      <url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url>
      <layout>default</layout>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
        <updatePolicy>never</updatePolicy>
      </snapshots>
    </repository>
  </repositories>
</profile>

And don t forget to activate the profile by addind that betwen

  <pluginGroups>
    <pluginGroup>org.jboss.maven.plugins</pluginGroup>
  </pluginGroups>
问题回答

Ok, so the jar you re looking for is in $JBOSS_HOME/common/lib so I would to the following to make it available in your Maven repo:
mvn install:install-file -Dfile=$JBOSS_HOME/common/lib/jboss-ejb3-ext-api.jar -DgroupId="org.jboss.javaee" -DartifactId="jboss-javaee" -Dversion="1.0.0" -Dpackaging=jar

在这样做之后,您的Maven附属于Eclipse。





相关问题
Recommended way to develop using Jetty and Eclipse

I am currently developing a J2EE application and I would like to use Jetty. I would like to have iot integrated with Eclipse, so I could debug the appliaction. I ve tried out couple of plugins (...

Call function periodically in Java

we need run one function periodically in Java web application . How to call function of some class periodically ? Is there any way that call function when some event occured like high load in server ...

Why make an EJB rather than a Web Service?

I would have thought that there is a lot of information out there on this, but I haven t found anything that really answers my question. What are the advantages of making an EJB rather than a web ...

Where should I put this configuration setting?

I m designing a fairly small web application which will run on a Sun application server (v9.1). It only has a few pages, no database of its own, and will retrieve/update data via web services. There s ...

JNDI Names -- Is Prefix "jdbc/" needed?

What s up with JNDI names? I m trying to get a javax.sql.DataSource using the new annotations feature of Java 5. It s not working for me, so I want to ask... I have a in my web.xml, inside of it is ...

hibernate interceptors : afterTransactionCompletion

I wrote a Hibernate interceptor : public class MyInterceptor extends EmptyInterceptor { private boolean isCanal=false; public boolean onSave(Object entity, Serializable arg1, Object[] arg2, String[]...

热门标签