I have integrated twitter4j into my project via maven, using the depndencies / repositories as shown on the twitter4j homepage :
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>[2.2,)</version>
</dependency>
..
<repository>
<id>twitter4j.org</id>
<name>twitter4j.org Repository</name>
<url>http://twitter4j.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Unfortunately, not all resourcesfrom the twitter4j core project are available in my project. For example, the interface "StatusListener" is not.
Can maybe someone give me a hint what is wrong?
Looks like the twitter4j.StatusListener class moved to the twitter4j-stream artifact in version 2.2.0. Add it to your dependency list.
Related
I was looking for BIRT Dependency in the net. Package my code refers are
import org.eclipse.birt.chart.model.Chart;
import org.eclipse.birt.chart.model.attribute.Anchor;
It is using chartengineapi and below is the maven dependency entry for POM.
<!-- https://mvnrepository.com/artifact/org.eclipse.birt/chartengineapi -->
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>chartengineapi</artifactId>
<version>2.3.2</version>
</dependency>
Since it is part of other repository (https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/) it gives error in Pom.xml. Could any one help me to sort out this ?
added repository tag and resolved.
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
Add one more <repository></repository> and the give the new repo name and link. It worked for me though I am not sure whether this is a standard approach.
I tried re-configuring my project for snapshots in intellij, please why is my pom.xml not working according to the documentation
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>
<releases>..</releases> and <snapshots>..<snapshots/> are outlined in red with a Element 'releases' cannot have character [children], because the type's content type is element-only. error
I took your snippet and tried to build the project locally.
I haven't seen such kind of error, everything in tag looks valid.
The only thing that I have added to build you project is <version>${nd4j.version}</version> tag to
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>${nd4j.backend}</artifactId>
</dependency>
Could you please, make provided above changes and double check your pom.xml file syntax.
I'm trying to add server module dependencies for wildfly 10.0.0 Final in my pom but I can't find a a working repository.
I have this in my pom:
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-parent</artifactId>
<version>10.0.0.Final</version>
</dependency>
and I tried to add the jboss repository:
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
and what I get is this:
Could not find artifact org.wildfly:wildfly-parent:jar:10.0.0.Final in jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public/
I checked the repository. The pom is actually there but the jar at:
http://repository.jboss.org/nexus/content/groups/public/org/wildfly/wildfly-parent/10.0.0.Final/wildfly-parent-10.0.0.Final.jar
is not.
Which repository should I add?
My Android Maven project pom.xml contains the following entries. Now everything works fine. What is the difference between <repositories> entries and the <pluginRepositories> entries.
<repositories>
<repository>
<id>my-repo</id>
<url>http://10.10.10.230:8081/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>my-repo</id>
<name>my-repo</name>
<url>http://10.10.10.230:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
As #otakun85 stated, There is no technical difference at all. It's for having different configurations->behavior for plugins in contrary to normal artifacts. See repository vs. pluginRepository for more details.
Also check maven-users mailing list archives, It provides quite good explanation to it.
Maven will resolve plugin dependencies using the configured pluginRepository. Other artifact dependencies (eg. a parent pom) are resolved using repository.
Note: Things available on maven central will be resolved by default so you wouldn't normally need to include repository for those.
For example, if your pom.xml specifies a parent pom and a plugin dependency that both exist in the same repository you must still specify both repository AND pluginRepository. If you only configure one then maven will complain with "Unresolvable X" errors.
Can I add option to Maven to say WARNING if some artefact wasn't found in some repository. Let's I have
<repositories>
<repository>
<id>main</id>
<name>main-repo</name>
<url>http://repourl</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
But Maven not find some dependency of dependency in repo. Then he say WARNING in log. Can I do it?
A have in my company's repo resource 'org.apache.cxf:cxf-rt-frontend-jaxrs:pom:2.5.4'. But I havn't dependencies. This resource was copied to my JAR file. But no one dependency of 'cxf-rt-frontend-jaxrs' wasn't intsalled. In log
[INFO] Unable to find resource 'org.apache.cxf:cxf-rt-frontend-jaxrs:pom:2.5.4' in repository MAIN (http://url/)
Downloading: http://url//org/apache/cxf/cxf-rt-frontend-jaxrs/2.5.4/cxf-rt-frontend-jaxrs-2.5.4.pom
But no warning about dependencies of cxf-rt-frontend-jaxrs
Dependencies of cxf-rt-frontend-jaxrs are declared in org.apache.cxf:cxf-rt-frontend-jaxrs:pom:2.5.4 artifact, which Maven was not able to find. So, answer to your question is it can't be done.